ToggleSwitch supports two or three check states, and includes several options for customizing the look of the switch.
The IsChecked property determines the position of the switch (up for
true, down for
false, or in the middle for
null). By default, only
false are supported, but if IsThreeState is set to
null (or indeterminate) is also supported.
Two ToggleSwitch controls with one checked (left) and one unchecked (right)
When animating from one state to another, the SwitchInterval determines how long it takes the switch to travel to the new location.
There are two switch types supported (circular and flat), which can be specified using the SwitchType property.
Two ToggleSwitch controls with a flat switch (left) and one with a circular switch (right)
Brush and Effect
The switch can be broken down into two different parts; the base of the switch and then the switch itself. The brushed used for each part can be customized independenty.
ToggleSwitch with the base in red and the base accent in blue
Two ToggleSwitch control, one circular and one flat, with a green ball, yellow shaft, and blue tip
The switch includes an effect that can be disabled by setting IsSwitchEffectEnabled to
The led effect is only supported when IsSwitchEffectEnabled is set to
trueand the associated brush is set to a