Silverlight 2 Watermarked TextBox Control

http://blogs.msdn.com/kathykam/archive/2008/06/23/watermarkedtextbox-for-silverlight-2-beta-2.aspx

One breaking change you may have noticed between Silverlight 2 Beta 1 and Beta 2 is thatWatermarkedTextBox 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.

Because the update to TextBox will not happen until a future version of Silverlight feel free download and use the WatermarkedTextBox source code and unit test in the mean time. By downloading the source and unit tests you accept the license.

Here is an example on how to use it:

image

 

image 

For more information on how to use this control, check out our Beta1 documentation in MSDN:

http://msdn.microsoft.com/en-us/library/system.windows.controls.watermarkedtextbox(VS.95).aspx

In additional to porting the source code & unit test for Beta 1, we also did the following:

  • Updated the template to use new features in the framework (i.e. VisualStateManager)
  • Bug fixing: When the control has focus, MouseOver state will no longer be active after moving the mouse away from the cotnrol
  • Bug fixing: Allow setting BorderBrush correctly

If you run into any problems, let me know! :)

<Editorial Note>
This is also a great example on how to use the new Visual State Manager for Silverlight 2 Beta 2! 
Also a special "Thank you" to the WatermarkedTextBox dev Alex Bulankou for porting the source code, updating & fixing the bugs.
</Editorial Note>

Posted: Monday, June 23, 2008 6:55 PM by  KathyKam

Comments

Brad Abrams said: 

One breaking change you may have noticed between Silverlight 2 Beta 1 and Beta 2 is that WatermarkedTextBox

# June 24, 2008 12:19 PM
Silverlight SDK said: 

Just a quick note that one of the breaking changes from beta 2 was that the WatermarkedTextBox control

# June 24, 2008 1:16 PM
Silverlight SDK said: 

With Silverlight 2 Beta 2 coming out there were a number of changes that will break applications written

# June 24, 2008 1:21 PM
Programming said: 

One breaking change you may have noticed between Silverlight 2 Beta 1 and Beta 2 is that WatermarkedTextBox

# June 24, 2008 1:35 PM
BenHayat said: 

Kathy, one quick question: When you say "Future version of SL" do you mean like SL 3 or are we still talking version 2?

Thanks!

..Ben

# June 24, 2008 6:00 PM
KathyKam said: 

Hi Ben,

"future" means some future version after SL 2.

Thanks,

Kathy

# June 24, 2008 7:01 PM
KierenH said: 

Hope watermark is available on similar controls like ComboBox - this could be exposed via control template or attached property like ToolTip.

# June 24, 2008 9:32 PM
di .NET e di altre Amenit said: 

Silverlight 2.0: La desaparecida WatermarkedTextBox

# June 25, 2008 3:55 AM
Craig Nicholson said: 

Hi Kathy,

I previously upgraded the control for Silverlight 2 beta 2 as well (http://craign.net/2008/06/10/watermarkedtextbox-control-for-silverlight-2-beta-2/) however I never took advantage of the VSM.

Are you going to update the control to use the DefaultStyle and generic.xaml so that it can be styled using a future build of Blend? I was about to blog the updated code when I saw your post on it. Would you like a copy of my changes perhaps?

# June 25, 2008 4:20 AM
Thomas Lebrun said: 

Dans la Beta 1 de Silverlight 2 , on disposait d'un contrôle bien sympathique nommé WatermarkTextBox.

# June 25, 2008 4:42 AM
Community Blogs said: 

Emil Stoychev with a Silverlight Twitter Widget, Kathy Kam on the missing WatermarkedTextBox, Adam Kinney

# June 26, 2008 12:29 AM
Atul Gupta said: 

Kathy, Thanks for providing the same, but i guess we will have to either copy the source code into our projects, or rename the assembly, as it otherwise conflicts with the released System.Windows.Controls.Extended assembly which I would use to work with controls inside of it.

# July 3, 2008 11:26 PM
Infosys | Microsoft said: 

Silverlight WatermarkedTextBox control code

# July 3, 2008 11:53 PM
The Last Mind said: 

작년 12월에 Silverlight 1.0 애플리케이션 맛보기 개발에 대한 글을 쓴 적이 있다. 어제 새벽 2시 정도에 잠을 깨는 바람에 Silverlight 2 애플리케이션 개발을 위한 튜터리얼을 보면서 실제로 개발하는 과정을 체험해보았다. Silverlight 1.0은 Javascript 만을 지원했고, GUI 애플리케이션 개발을 위한 라이브러리에 기본적으로 포함되어있는 레이아웃이나 컨트롤(위젯)들을 포함하고 있지 않았기 때문에, 이렇다 할

# July 17, 2008 2:31 PM
shan said: 

How can I System.Windows.Controls in silverlight 2 beta 2.

# August 8, 2008 10:01 AM
d_jedi said: 

How does this work now?

Source code sln file opens with errors.

I'm trying to follow Scott Guthrie's silverlight tutorial.. but I can't do it with this.

AARGH.

# August 12, 2008 9:35 PM
Mc David said: 

Why you don't built a watermarkedtextbox .dll file cause when I download the zip file above I can't build it, they said it's not my currently using version!

# August 17, 2008 9:56 PM
Nagapito said: 

The System.Windows.Controls.Extended.Test project misses a reference to the System.Windows.Controls.Extended project.

After adding the reference, the solution builds!

# October 14, 2008 5:57 PM
zazi said: 

I've just tested my compiled WatermarkedTextBox project with the Silverlight 2.0 RTW assemblies. When I built my Silverlight project with a WatermarkedTextBox inside I get the error:

unknown attribute "Duration" for element "VisualTransition". [Line: 1 Position: 997]

How I can solve this problem?

Cheers zazi

# October 15, 2008 2:59 PM
Joshua said: 

Hi~

I tried using that.

But it isn't working.

Could you explain to use that control in Silverlight 2 RTW(2.0.31005.0)?

I want to use that control.

Please~

# October 15, 2008 9:32 PM
zazi said: 

For all who tried to get the WatermarkedTextBox assembly to work with Silverlight 2.0 RTW:

You have to change the "Duration" property of the VisualTransition class in the WatermarkedTextBox.xaml of the project to "GeneratedDuration" - then it will work.

Cheers Zazi

# October 16, 2008 9:51 AM
Method ~ of ~ failed by Tim Heuer said: 

Silverlight.net updated code samples

# October 20, 2008 4:18 PM
Tim Heuer said: 

With the release of Silverlight 2 many people faced the task of ensuring their applications/code written

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值