I'm a bit stuck playing with DataBinding in a tryout project. I have a simple form with just a spinbox, which I want to bind to a member of the form.
class Form1 {
public class Data : System.ComponentModel.INotifyPropertyChanged {
int _value = 10;
public int value {get;set;}
public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
}
public Data data; // the member I want to bind to
}
In the VS IDE, the Data section in the Properties of my spin box allows me to select Form1.data as a data source, but
- the spinbox isn't initialized with 10, as I would expect
- changing the spinbox value doesn't trigger the get/set of Data.value.
And I just can't live with that. Any ideas?