Why is IsChecked property nullable boolean in WPF CheckBox? Why is IsChecked property nullable boolean in WPF CheckBox? wpf wpf

Why is IsChecked property nullable boolean in WPF CheckBox?


It is null when you don't know if its checked or not: http://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.togglebutton.ischecked.aspx

In many systems a checkbox like this is shaded instead of being checked.


If that is the case then it's probably a three-state-checkbox, have a look at http://msdn.microsoft.com/en-us/library/system.windows.forms.checkbox.threestate.aspx for an explaination.


Null means the CheckBox is indeterminate (is neither blank nor checked, instead it either has a line through it, or the box has a gray box inside it)