Changing the Switch Color

By default, the ToggleSwitch control template presents the On state using the phone’s theme color. You can explicitly set the ToggleSwitch color using its SwitchForeground property, as shown in the following excerpt:

<toolkit:ToggleSwitch        Header="ToggleSwitch with custom switch color"        IsChecked="true"        SwitchForeground="Red"/>

In most cases, ToggleSwitch makes for a better choice than the standard CheckBox control. And after you start using it, it becomes almost as ubiquitous as the Button control.

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.