Why it need?
ObservableCollection<T> allow to automatic renew to UI. (Only WPF)
So you don't need to concern about changing of Collection.
But Sometime need binding UI with Dictionary and automatical renewal.
Because ObservableDictionary is not exist in standard library, need to implement.
How implement?
ObservableCollection<T> class use INotifyCollectionChanged interface.
So if you want to implement own ObservableCollection class,
need to implement INotifyCollectionChanged interface.
INotifyCollectionChanged interface expose only CollectionChanged
and it require NotifyCollectionChangedEventArgs.
- Add : NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction, Object)
- Remove : NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction, Object, Int32)
- Reset : NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction)
- Replace : NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction, Object, Object, Int32)
When collection changed, must call CollectionChanged event.
Example(C#)
Example code is created in Visual Studio 2013.
If you use lower version, just copy "ObservableDictionary.cs"