Because a three-state CheckBox can take on any one of three different values, its current value can’t be represented by a simple bool. A bool can only take on true and false values.A three-state CheckBox can instead be bound to a nullable bool (represented by bool?), which can take on three different values. true (checked)
false (not checked)
null (indeterminate)In the example below, we bind a CheckBox control’s IsChecked property to a nullable bool property. <CheckBox Content="Happy" IsChecked="{Binding IsHappy}" IsThreeState="True"/>
Read more: 2,000 Things You Should Know About WPF
QR:
false (not checked)
null (indeterminate)In the example below, we bind a CheckBox control’s IsChecked property to a nullable bool property. <CheckBox Content="Happy" IsChecked="{Binding IsHappy}" IsThreeState="True"/>
Read more: 2,000 Things You Should Know About WPF
QR:
0 comments:
Post a Comment