XAML
<TextBlock FontSize="14" Foreground="Red">
<TextBlock.Style>
<Style TargetType="TextBlock">
<Setter Property="Visibility" Value="Collapsed"/>
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<!--Here I want to compare with an OR behavior-->
<Condition Binding="{Binding Username}" Value="" />
<Condition Binding="{Binding Username}" Value="{x:Null}"/>
</MultiDataTrigger.Conditions>
<Setter Property="Text" Value="No Username"/>
<Setter Property="Visibility" Value="Visible"/>
</MultiDataTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
For this to be triggered, Username
has to be null
and empty
which make no sense. In fact, I want an OR behavior with these two values.
NOTE
I know that I could add multiple <DataTrigger>
(like for example in MultiDataTrigger with OR instead of AND) and since they are handled in order it would be fine, but that's exactly what I'm trying to avoid. I'm looking more for a one-liner solution.