O'Reilly logo

XAML Unleashed by Adam Nathan

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

ToggleButton

ToggleButton is a “sticky” button that holds its state when it is clicked. Clicking it the first time sets its IsChecked property to true, and clicking it again sets IsChecked to false. The default appearance of ToggleButton is the same as that of Button and RepeatButton, and when IsChecked is true it retains its pressed appearance. It can be used for enabling and disabling features, such as bold/italic/underline buttons on a text editor’s toolbar, and is great when space is limited. Otherwise, it’s often more appropriate to use a ToggleSwitch control (covered in Chapter 14, “Other Controls”) instead.

ToggleButton also has an IsThreeState property that, if set to true, gives IsChecked three possible values: true, false, or null ...

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