I have a simple DTO class which I set as the datasource of a bindingsource on a form.
The form contains a custom control with a Value
property. This is the property:
[Browsable(false)]
[Bindable(BindableSupport.Yes, BindingDirection.TwoWay)]
public virtual T Value
{
get { return this.value; }
set { this.value = value; }
}
When the control is bound to the bindingsource, the setter is called 6 times. When the control is not bound, the setter is called only 2 times
In both cases, the first call is because the designer code has a line:
mycontrol.Value = null;
And the last call is because I set a value. So the first and last calls are normal. However when the control is bound, why is the setter called an extra 4 times?