ToggleButton
During the articles describing the WPF selection controls, we saw the CheckBox and RadioButton controls. These controls have are similar, in that they can be toggled between two or three states. Both controls can be either checked or unchecked, and the state can be obtained as a nullable Boolean value using the IsChecked property. A third state exists, known as the indeterminate state. By default, this state cannot be selected by the user but can be set from code or in the XAML for the control. However, if the IsThreeState property is set to true, it becomes possible to switch to this third value.
Both the IsChecked and IsThreeState properties are provided by the ToggleButton base class. Additionally, ToggleButton provides the three events that allow you to detect the change to a new state, these being Checked, Unchecked and Indeterminate.
As we've seen these properties and events in the earlier article, they will not be described again here.
30 June 2014