What you are looking for is similar to ObservableCollection<T> , but for a dictionary. A little Googling found the following from Dr. WPF on creating an ObservableDictionary :
Advantages and disadvantages
The advantage of using an observable dictionary, of course, is that the dictionary can serve as an ItemsSource element to control data binding, and you can still access the dictionary in the code just like any other dictionary. This is a truly indexed dictionary of objects. Of course, there are some limitations inherent in the idea of making the dictionary visible. Dictionaries are made for speed. When you enter the behavior of the observed collection in the dictionary so that the infrastructure can bind to it, you add overhead.
In addition, the dictionary provides collections of Values and Keys through separate properties with the same name. These collections are of types Dictionary<TKey, TValue>.ValueCollection and Dictionary<TKey, TValue>.KeyCollection , respectively. These CLR-specific collections are not observed. Thus, you cannot directly bind to the Values collection or to the Keys collection and expect to receive notifications of changes to the dynamic collection. Instead, you should be tied directly to an observable dictionary.
Now you may have a problem updating the key, since then you need to somehow convince the dictionary to move your element. I suggest taking Dr. WPF ObservableDictionary and use KeyedCollection as your backup storage instead. Thus, the key is inferred from the element itself, and updates automatically move the object to an ObservableDictionary .
source share