Everything daisy-chains together. When the property value changes, you
raise the INotifyPropertyChangee.PropertyChanged event. That is
normally the end of what you need to implement.
For completeness, a bindable list (such as BindingList<T>) which
supports notification (IBindingList.SupportsChangeNotification) should
internally subscribe to (for example) the PropertyChanged event for
the items it holds, and (when it is raised) raise the
IBindingList.ListChanged event with ListChangeType of ItemChanged;
equally, it should raise the ListChanged event (with suitable
change-type) when items are added, removed or re-ordered. Luckily,
BindingList<T> does all of this for you, although it doesn't provide
the optional sort/etc features of IBindingList.
A binding-source / currency-manager will subscribe to the ListChanged
event, raising things like CurrentItemChanged, ItemChanged,
ListChanged, etc.
This will be further notified to any bindings, which will get the
value from the source. So through a potentially complex chain of smoke
and mirrors, the UI should indirectly receive word that a property
changed, and update itself.
A simple example of raising the PropertyChanged event follows.
Marc
class Person : INotifyPropertyChanged
{
public Person() { }
public Person(string name, DateTime dateOfBirth)
{
Name = name;
DateOfBirth = dateOfBirth;
}
private DateTime dateOfBirth;
private string name;
public DateTime DateOfBirth
{
get { return dateOfBirth; }
set { UpdateField(ref dateOfBirth, value, "DateOfBirth"); }
}
public string Name
{
get { return name; }
set { UpdateField(ref name, value, "Name"); }
}
public event PropertyChangedEventHandler PropertyChanged;
protected void UpdateField<T>(ref T field, T value, string
propertyName)
{
if (!EqualityComparer<T>.Default.Equals(field, value)) {
field = value;
if (PropertyChanged != null) PropertyChanged(this, new
PropertyChangedEventArgs(propertyName));
}
}
}