ObservableCollection implements both INotifyCollectionChanged and INotifyPropertyChanged .
INotifyPropertyChanged used to indicate that the ObservableCollection property has changed, as has the number of its elements ( "Count" ), or an element accessible through the collection indexer ( "Item[]" ). In addition, ObservableCollection implements INotifyCollectionChanged to indicate which item has changed exactly and how.
See Monorealization of an ObservableCollection to see what exactly an ObservableCollection does. For example, here is the InsertItem method:
protected override void InsertItem (int index, T item) { CheckReentrancy (); base.InsertItem (index, item); OnCollectionChanged (new NotifyCollectionChangedEventArgs ( NotifyCollectionChangedAction.Add, item, index)); OnPropertyChanged (new PropertyChangedEventArgs ("Count")); OnPropertyChanged (new PropertyChangedEventArgs ("Item[]")); }
If you want to implement your own ObservableCollection -like collection class, it seems like the right way to implement both INotifyCollectionChanged and INotifyPropertyChanged .
source share