Amazon.com Widgets

WatermarkedTextBox for Silverlight 2 Beta 2

One breaking change you may have noticed between Silverlight 2 Beta 1 and Beta 2 is that WatermarkedTextBox is no longer available in the Silverlight SDK (System.Windows.Controls.Extended.dll). 

We decided to remove the control because in a future version of Silverlight, we will be adding a “Watermark” property to TextBox. Given this upcoming change, it does not make sense to have "WatermarkedTextBox" as a separate control, so we decided to remove the control from Silverlight 2.

Kathy has all the details on her blog, but you can download the WatermarkedTextBox source code and unit test here.  

Published 24 June 08 09:19 by BradA
Filed under:

Comments

# Brad Abrams : WatermarkedTextBox for Silverlight 2 Beta 2 said on June 24, 2008 1:53 PM:

PingBack from http://blogs.msdn.com/brada/archive/2008/06/24/watermarkedtextbox-for-silverlight-2-beta-2.aspx

# Michael Reynolds said on June 24, 2008 3:58 PM:

Hi Brad!  Thanks for the head up on removing the watermarked text box.  When you say that in a future version you will have a watermark property of the textbox, would it be safe to assume that in the final Silverlight 2 version the watermark property will be there.  Or do you suspect we'll be waiting longer than that?

Thanks for your blog, I always read your updates!

# Patrick said on June 25, 2008 2:09 AM:

Hi Brad,

I think a better solution would have be to remove TextBox and rename WatermarkedTextBox to TextBox. With little change, we will still have a watermarked text box.

# di .NET e di altre Amenit said on June 25, 2008 3:55 AM:

Silverlight 2.0: La desaparecida WatermarkedTextBox

# AndyL said on June 25, 2008 10:01 PM:

Several attendees at a recent meeting of the local .Net Users Group were complaining about the lack of this control, and were also very surprised to hear that you can duplicate it with just 3 lines of Xaml (a TextBlock whose visibility is bound to the IsEmpty property of an overlaid transparent TextBox).  It won't satisfy everyone (no separate disabled visual style, for example), but many devs seem to find this solution perfectly adequate for their needs.  Many devs often automatically assume they need to write code-behind when a little Xaml might serve just as well.  The related issue of knowing when you've begun to cross over the border into Xaml abuse is also probably going to be an interesting code maintenance topic at alot of dev. shops going forward.

http://www.codeproject.com/KB/WPF/WatermarkTextBox.aspx

# Dave Friedel said on June 26, 2008 6:22 AM:

Thank you...  I would prefer they build out the text box to include a masked property as well.  They could even kill the password box - and allow us the ability to set that option.

# Matt said on July 17, 2008 9:10 PM:

Sorry for bringing that up again, but in my opinion

"[...] a TextBlock whose visibility is bound to the IsEmpty property of an overlaid transparent TextBox [...]" is just dirty and I prefer to drop the feature than to implement it that way.

Cheers,

Matt

New Comments to this post are disabled

Search

Go

This Blog

Syndication

Page view tracker