I have several grids that are bound to large collections of objects that change frequently either from a background updater thread or by an edit in the xamgrid. For performance, and simplicity, I would like to use something like an ObservableDictionary<int, MyObject> to store the data where the key is a unique lookup value and the value is the object itself.
I can't figure out how to bind xamgrid to this type of data structure. Obviously, I can make an ObservableCollection<MyObject> off the dictionary Values but this is problematic in that to add update items you have to manually sync bptj the observablecollection and the dictionary.
Anyone else ever wanted to this.
Hello,
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I created a class that Derives from Dictionary and INotifyCollectionChanged and implemented Add and Remove methods and added notification to the setters. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.
Well, that was simpler than I thought. I took your example and added a few things (implemented INotifyPropertyChanged on MyObject and added another button to test it). Works just like I wanted. Thanks so much!