A MultiTrigger
is similar to a standard Trigger
in that it only applies to properties within the same control. The difference is that a MultiTrigger
has multiple conditions which must be satisfied before the trigger will operate. Conditions are defined using the <Condition>
tag.
<TextBlock x:Name="_txtBlock" IsEnabled="False">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Text" Value="Pass"/>
<Condition Property="IsEnabled" Value="True"/>
</MultiTrigger.Conditions>
<Setter Property="Foreground" Value="Green"/>
</MultiTrigger>
</Style.Triggers>
</Style>
</TextBlock.Style>
</TextBlock>
Notice the MultiTrigger
will not activate until both conditions are met.