Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the easiest way to do negation in triggers?

I want to do something like

<DataTrigger Binding="{Binding Something}" ValueIsNot="{x:Null}">
like image 216
CannibalSmith Avatar asked Oct 10 '09 12:10

CannibalSmith


1 Answers

I think your best bet is to use a Converter. See this blog post for a sample for converting a result into a boolean.

<DataTrigger
    Binding="{Binding Path=x, Converter={StaticResource IsNotNullConverter}}"
    Value="true">
like image 127
tvanfosson Avatar answered Sep 18 '22 17:09

tvanfosson