how to bind a boolean to combobox in wpf

前端 未结 4 2000
傲寒
傲寒 2020-12-06 10:26

Well I was wondering how to bind a boolean property to a combobox.Combobox will be a yes/no combobox.

4条回答
  •  情歌与酒
    2020-12-06 11:09

    First solution is to replace your 'Yes/No' combobox with a checkbox because, well, checkbox exists for a reason.

    Second solution is to fill your combobox with true and false objects and then bind the 'SelectedItem' of your combobox to your Boolean property.

提交回复
热议问题