The fundamental two-way binding
interface in the .NET Framework is IBindingList. The IBindingList interface is
required for two way data binding and implemented by data access layers such as
ADO.NET. In VS 2005, we have implemented a concrete, generic version of
IBindingList called BindingList<T>. The goals of BindingList<T>
are:
- Make it easier for developers to implement IBindingLists (lists
that have the same binding fidelity as ADO.NET). IBindingList is not trivial
to implement due to the subtle interaction between IBindingList,
IEditableObject and the CurrencyManager.
- Provide consistency with other generic lists provided in the
Whidbey release of the framework (e.g. List<T>).
When a data source is a list, the data source needs to
provide both list and property change notification via the IBindingList
interface. List change notification is used to notify user interface elements
when an item has been added, removed or deleted from the list. Property change
notification on a list is used to notify user interface elements that a
property on an item in the list has changed (e.g. the "Name" property on
Customer instance in the nth position of the list changed).
One key aspect of list binding in Windows Forms is that IBindingList provides
both list based change notification and property based change notification. In
other words, and this is a key point, Windows Forms controls that are bound to
a list will not listen to property change notification provided by items within
the list – rather Windows Forms requires the list to provide this notification
on behalf of the contained items. One key advantage of using
BindingList<T> is that it will automatically translate child
INotifyPropertyChanged events into IBindingList.ListChanged events.