Multi trigger

This is almost like the property trigger, but here it is used to set an action on multiple property changes and will execute when all the conditions within MulitTrigger.Conditions are satisfied:

<Style TargetType="{x:Type CheckBox}"> 
  <Style.Triggers> 
     <MultiTrigger> 
        <MultiTrigger.Conditions> 
          <Condition Property="IsEnabled" Value="True"/> 
          <Condition Property="IsChecked" Value="False"/> 
        </MultiTrigger.Conditions> 
        <MultiTrigger.Setters> 
          <Setter Property="Background" Value="Red"/> 
          <Setter Property="Opacity" Value="0.5"/> 
        </MultiTrigger.Setters> 
     </MultiTrigger> 
  </Style.Triggers> 
</Style> 

Here, in this example, we have a multi trigger associated with the checkbox control's style. When the control is enabled and unchecked, the trigger will get fired and set the background of the control to Red and opacity to 50%:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.220.16.184