-api-id | -api-type |
---|---|
P:Windows.UI.Xaml.Controls.Primitives.ToggleButton.IsChecked |
winrt property |
Gets or sets whether the ToggleButton is checked.
<togglebutton IsChecked="bool"/>
-or-
<togglebutton IsChecked="{x:Null}"/>
- togglebutton
- togglebutton A literal ToggleButton, or a derived type such as CheckBox or RadioButton.
true if the ToggleButton is checked; false if the ToggleButton is unchecked; otherwise null. The default is false.
If you are programming using C# or Microsoft Visual Basic, the type of this property is projected as bool? (a nullable Boolean).
ToggleButton and can have three states:
State | Property | Value |
---|---|---|
checked | IsChecked | true |
unchecked | IsChecked | false |
indeterminate | IsChecked | null |
For the ToggleButton to report the indeterminate state, you must set the IsThreeState property to true.
Note
ToggleButton has the same visual state for the indeterminate and unchecked states. Derived controls, like CheckBox, may define different visual states for each state.
To set the value to null in XAML, use the {x:Null} markup extension.