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

Using the ToggleSwitch

Like the ToggleButton, ToggleSwitch uses a nullable Boolean value to represent its state. In its On position, its IsChecked property is true. In the Off position, IsChecked is false. If the IsChecked property is null, the ToggleSwitch is displayed using its Off position.

You can use the ToggleSwitch by either binding its IsChecked property to a property in your viewmodel, or by responding to its Checked and Unchecked events in your code-beside. The later approach involves subscribing to the ToggleSwitch.Checked and Unchecked events, as shown:

<toolkit:ToggleSwitch        Header="ToggleSwitch"        IsChecked="true"        Checked="ToggleSwitch_Checked"        Unchecked="ToggleSwitch_Unchecked"/> ...

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