Multi-Condition
triggers are useful when we need to evaluate multiple condition evaluation at a
particular time. This element provides a check constraint for all of the
conditional statements to be evaluated to True in order for it to take effect.
<Window.Resources>
<Style TargetType="{x:Type Button}">
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="Content" Value="Mahak" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="Pink" />
</MultiTrigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Button Height="26" Name="Button1" >Mahak
</Button>
</Grid>
In this example we check two conditions:
Condition Property="IsMouseOver" Value="True" />
<Condition Property="Content" Value="Mahak" />
First we check the InMouseOver
property and after that we check the content of the control Button if it is
“Mahak” the background of the Button must be pink.
Ratnesh KhandelwalPosted Feb 20, 2013, 11:57 PM
I have applied two condition one is mouse over and second is of value, but its working like OR operator and setter is applying the changes. what to do??