Infosys Microsoft Alliance and Solutions blog

« Silverlight - CheckBox issue when in ListBox | Main | Silverlight - Animating Wrap Panel »

Silverlight - Are you missing WatermarkedTextBox?

One of controls that I had been using when working with SL 2 Beta 1 was WatermarkedTextBox and when this was taken off from SL 2 Beta 2, I had to rework our application code. It is great to see the control now posted on Kathy's blog here. The discussion seem to incidate that we won't get the updated TextBox with Watermark property in Silverlight 2 RTM.

I downloaded this, but wasn't able to use it as is since the code continues to use System.Windows.Controls.Extended assembly name. I was using other controls like Calendar and DatePicker from the released System.Windows.Controls.Extended assembly with SL2 and this caused conflict when trying to add the assembly for using WatermarkedTextBox. This was however easily fixed by changing the project properties to create the assembly with the name WatermarkedTextBox.dll. I also had to change the namespace in the WatermarkedTextBox.xaml to the following to get the control working.

   xmlns:local= "clr-namespace:System.Windows.Controls;assembly=WatermarkedTextBox" 

Till the new property is available, this will do !


I ran into the same problem, just to add some extra details the specific steps I took were:
1. Rename the System.Windows.Controls.Extended project to WatermarkedTextBox
2. Change the Assembly name in the properties page to WatermarkedTextBox, then build to create WatermarkedTextBox.dll
3. After adding the reference to WatermarkedTextBox.dll in my own project use xmlns:wtb="clr-namespace:System.Windows.Controls;assembly=WatermarkedTextBox"
and access the textbox using wtb:WatermarkedTextBox

Worked fine for me, hope this helps.

Nick, thanks. I did the same as mentioned above. However I don't think step 1 (as you mentioned) is necessary. The output assembly name and the namespace is what really matters. The project name can be pretty much anything.

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)

Please key in the two words you see in the box to validate your identity as an authentic user and reduce spam.

Subscribe to this blog's feed

Follow us on

Blogger Profiles

Infosys on Twitter