我有Button控件,我必須根據bool變量設置IsEanbled屬性。DataBinding控件的屬性時可以應用NOT(!)運算符嗎?
bool IsBoolVariable
我想如果IsBoolVariable屬性爲真然後我想將的IsEnabled屬性設置爲假,當IsBoolVariable屬性爲假那麼我想設置的的IsEnabled property to true。
是否有可能通過應用轉換器,同時定義如下
<Button
IsEnabled = "{Binding Path = **!**IsBoolVariable}" />
給出結合我可以很好地做到不適用(!)運算符,但就是這樣做的唯一途徑?