views:

21

answers:

2

I have Button control and I have to set the IsEanbled property based on the bool variable.

bool IsBoolVariable

I want if IsBoolVariable property is true then I want to set the IsEnabled property to false AND when IsBoolVariable property is false then I want to set the IsEnabled property to true.

Is it possible to apply not(!) operator while defining the binding as given below

<Button
IsEnabled = "{Binding Path = **!**IsBoolVariable}" />

I can very well do that by applying convertors , but that is the only way to do that?

+2  A: 

Short answer: yes, converters are the only way.

Julien Lebosquain
+1  A: 

You could bind it to a bool Property that returns false when IsEnabled is true....

Tony