How do I bind IsEnabled
property in Silverlight 4 (XAML)?
I tried simply IsEnabled="{Binding ABC}"
but this is not working - the MenuItem
is always enabled.
Thanks in advance for the clues!
Cheers
Edit:
What is interesting, when setting Mode=TwoWay
the bindings seem to work. However, the look of context menu is updated after moving the mouse over a menu item. Is that working asynchronously? What is the way to update the layout of my context menu just after right-clicking? (I tries UpdateLayout()
but it didn't work)
Okay, it is a known bug in Silverlight Toolkit - the look of context menu does not change even if IsEnabled
property is bound and notified properly. I had to implement a workaround (simple updating the view of the control). Anyway, thanks for the replies :)
A good way to debug this is to take a look at the Output Window while debugging with Visual Studio. Problems with bindings are printed there.
Have you set your DataContext to an object that has a public property ABC
?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With