WPF Button on or off coloured state
- by wonea
I'm trying to create a set of button which have an off or on state, much a checkbox without the check. Ideally I want the colour to change to represent the two different states off(red), green(on). I've tried setting a control template but this only changes the colour for a selection, then reverts back to it's original colour once the mouse leaves the button's vicinity.
<ControlTemplate.Triggers>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" TargetName="Background" Value="Green"/>
</Trigger>
</ControlTemplate.Triggers>