I have a NumericUpDown
control, which is a part of a UserControl.
The UserControl has Value property:
[Browsable(true)]
public override double Value
{
get { return this.ControlValue; }
set
{
this.ControlValue = value;
InvokePropertyChanged(new PropertyChangedEventArgs("Value"));
}
}
I used DataBindings
for the NumericUpDown
:
NumericUpDown.DataBindings.Add(nameof(NumericUpDown.Value), this, nameof(UserControl.Value), false, DataSourceUpdateMode.OnPropertyChanged);
The Value property used to be Int32, but I had to change it to Double. And suddenly the binding stopped working.
I know for sure the Value property is changing, but the NumericUpDown's value doesn't.
Correction: it appears the Binding only fails to update NumericUpDown's value when the Value property is changed. Changing NumericUpDown's value DOES change the Value property.