在触发器中做出否定的最简单方法是什么?

Can*_*ith 5 c# wpf xaml datatrigger

我想做点什么

<DataTrigger Binding="{Binding Something}" ValueIsNot="{x:Null}">
Run Code Online (Sandbox Code Playgroud)

tva*_*son 9

我认为你最好的选择是使用转换器.有关将结果转换为布尔值的示例,请参阅此博客文章.

<DataTrigger
    Binding="{Binding Path=x, Converter={StaticResource IsNotNullConverter}}"
    Value="true">
Run Code Online (Sandbox Code Playgroud)