Is there a smart pattern for nullable parameters using data binding?
In my application, I have controls bound to properties of an object.
But the controls always look like this:
- Checkbox
- Shortcut that explains the setting
- Edit control (ex: text box)
If the checkbox is unchecked, I use the anchor to disable the textbox.
If the checkbox is unchecked, I want the property value to be null.
If the checkbox checked, I would like the property to contain the value from the textbox.
A text field can be NumericUpDown
, ComboBox
, DatePicker
, etc.
Is there a sane way to get this behavior using binding, or is this my only option?
I would really like to create a control that supports this and reuse it.
0
source to share