I’m attempting to bind a Dictionary to a ListView who’s item template constist of a grid with 2 textboxes. Ideally I’d like to be able to modify both the key and the value of the KeyValuePair displayed in the ListView . Is that possible?
I’m attempting to bind a Dictionary to a ListView who’s item template constist of
Share
What you’re looking for is something akin to an
ObservableCollection<T>but for a dictionary. A bit of Googling found the following from Dr. WPF on building anObservableDictionary:Now, you may run into a problem with updating the Key, as you would then need to somehow convince the dictionary to Move your item. I would suggest taking Dr. WPF’s
ObservableDictionaryand instead using aKeyedCollectionas the backing store. That way the Key is derived from the Item itself, and updates move the object in theObservableDictionaryautomatically.