views:

20

answers:

1

Hello everyone,

what I want to achieve is a pretty common thing, but I want to use the Silverlight advantage to keep the UI-Behaviour in XAML.

I want a Textbox which has an 'empty' state like this:

[ Name ]
(Name in gray font), and when the Textbox receives Focus, the Fontcolor is supposed to change to black and the Textbox is supposed to be really empty.

When Unfocused and still empty it's supposed to say "Name" in gray font again.

Now I fail to find information on how to achieve this extended behaviour without using Codebehind... and gratefully appreciate any hints ;-)

+1  A: 

You may try to use control templates to create textbox acting your way. Check this blog entry

for an example (it's done there with checkbox). Also a good tool for creating templates is Microsoft Blend

tchrikch