Why is IsChecked property nullable boolean in WPF CheckBox?

前端 未结 4 1923
囚心锁ツ
囚心锁ツ 2020-12-11 14:36

Is there a case when IsChecked property on WPF CheckBox null ?

I guess that will answer my question from title of question.

4条回答
  •  再見小時候
    2020-12-11 15:32

    If we want to bind a value from DB and if that value is null then we have to handle that also. A boolean DB value can be True, False or NULL. So the UI checkbox also must be handle the there states. That's why WPF CheckBox has three state.

提交回复
热议问题