Saturday, August 21, 2010

Binding the IsEnabled property to whether a text block has data

Programmer Question

I'm using silverlight for windows phone and I want to bind the IsEnabled property of a button to whether a textblock has text in it or not. In other words, I want my button to be enabled when the textblock's Text is not empty and disabled otherwise.



Is it possible to do this purely in XAML using Styles/Setters/Triggers or any other mechanism or do I have to write a converter?



PS: I'm still learning silverlight, .NET etc ..



Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails