Hello all,

I am having a weird issue and I was wondering if anyone had some insight
into my issue. I am trying to implement a ObservableDictionary in .net 3.0.
its somewhat like the ObservableCollection but I need keyed access to the
collection. So what I did was I created a new class that implements
IDictionary<TKey, TValue>, INotifyCollectionChanged, and
INotifyPropertyChanged. Everything seems to work fine but....

Lets assume I have a listbox bound to my ObservableDictionary. My dictionary
is <string,TestClass> where TestClassjust has 2 properties of Id and Name.
The ListView displays the ID and Name properties of the TestClass.

If I add 2 objects with ID's of 1 and 2 to the Dictionary I see:
1
2
If I remove both they go away, but if I add 3 new objects with Id's 3,4,5 I see:
3
3 <-Should be 4
5

Its almost like the old values are stuck...somewhere. I tried using another
control such as a listbox but I see the same result.

Has anyone ever done anything like this before?

TJ

===================================
This list is hosted by DevelopMentorĀ®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to