Wednesday, August 4, 2010

ObservableCollection Class in .Net (WPF)

WPF provides the ObservableCollection class, which is a built-in implementation of a data collection that implements the INotifyCollectionChanged interface.

We can enumerate over any collection that implements the IEnumerable interface. However, to set up dynamic bindings so that insertions or deletions in the collection update the UI automatically, the collection must implement the INotifyCollectionChanged interface. This interface exposes the CollectionChanged event, an event that should be raised whenever the underlying collection changes.

So, by using ObservableCollection, we no need to Implement the INotifyCollectionChanged interface.

References

ObservableCollection Class

List vs ObservableCollection vs INotifyPropertyChanged in Silverlight

Silverlight Databinding – The Observable Collection

No comments: