O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required