WatermarkedTextBox control for Silverlight 2 beta 2

Microsoft SilverlightWhen Microsoft released Silverlight 2 beta 1 they included a really cool control called the System.Windows.Controls.WatermarkedTextBox control. It lived in the assembly System.Windows.Controls.Extended.dll and was included in your XAP file when you did a build. However in Silverlight 2 beta 2 the one control that didn’t make it was the WatermarkedTextBox control.

So by popular request, I have upgraded the original source code which Microsoft published under the Microsoft Public License, I have repackaged the control to ease the migration of existing beta 1 applications. In order to avoid any confusion I’ve changed the namespace of the control. This should hopefully prevent any issues when or if Microsoft decide to release their own version again.

To use the replacement control, simply build the provided solution and add a reference from your existing project to the assembly CraigN.Windows.Controls.dll and use the namespace CraigN.Windows.Controls. So typically this will involve adding xmlns:CraigN_Windows_Controls="CraigN.Windows.Controls;assembly=CraigN.Windows.Controls" to the UserControl element of your XAML file.

Then simply prefix all WatermarkedTextBox elements in the XAML file with CraigN_Windows_Controls: and all code should build again.

You can download the source code from here. I have taken the time to ensure that original test cases build. If you have any comments or suggestions, I’d like to hear them.

Be Sociable, Share!