IsChecked Property
Collapse the table of content
Expand the table of content

ToggleButton.IsChecked Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets or sets whether the ToggleButton is checked.

Namespace:  System.Windows.Controls.Primitives
Assembly:  System.Windows (in System.Windows.dll)
XMLNS for XAML: Not mapped to an xmlns.

'Declaration
<TypeConverterAttribute(GetType(NullableBoolConverter))> _
Public Property IsChecked As Nullable(Of Boolean)
<togglebutton IsChecked="bool"/>
-or-
<togglebutton IsChecked="{x:Null}"/>

XAML Values

togglebutton

A literal ToggleButton, or a derived type such as CheckBox or RadioButton.

Property Value

Type: System.Nullable(Of Boolean)
true if the ToggleButton is checked; false if the ToggleButton is unchecked; otherwise Nothing. The default is false.

Dependency property identifier field: IsCheckedProperty

A control that inherits from ToggleButton determines its behavior when this property is Nothing. In XAML, set the IsChecked property to the empty string ("") to display the indeterminate state. In code, you can set this property to Nothing.

CheckBox

When the IsThreeState property is set to true, a user can tap a CheckBox to pick three possible states. The following table describes the three states of a CheckBox.

State of the CheckBox

Value of IsChecked

Checked

true

Unchecked

false

Indeterminate

Nothing

If IsThreeState is false, you can still programmatically set this property to Nothing to put the CheckBox in an indeterminate state, but the user cannot set the CheckBox to the indeterminate state through the user interface.

RadioButton

If you set this property to Nothing on a RadioButton, the RadioButton is unchecked.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft