How to use Triggers to Style a CheckBox

The following example creates a style that changes the appearance of a CheckBox in response to events that are raised on the control. When you move the mouse pointer over the CheckBox, the Background color changes and if you select the CheckBox, the Foreground color changes.


<Style x:Key="Triggers" TargetType="{x:Type CheckBox}">
<Style.Triggers>
<Trigger Property="CheckBox.IsPressed" Value="true">
<Setter Property = "Foreground" Value="Green"/>
</Trigger>
<Trigger Property="CheckBox.IsMouseOver" Value="true">
<Setter Property = "Background" Value="Red"/>
</Trigger>
</Style.Triggers>
</St