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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access