0

I think I have a rather interesting problem. I have a model where the main data structure really needs to be a dictionary. I want to bind the values of that dictionary to a listbox. I have an ObservableDictionary class that fires collection changed events when necessary. Unfortunately if I bind to this observable dictionary, the listbox is populated with KeyValuePairs and I can't make an IValueConverter for it because KeyValuePairs aren't objects, they're structs. Is there some way in xaml to specify that I want the .value of all the Pairs?

If I just return the values of the Dictionary in the property I'm binding to, that list isn't observable and so doesn't update with the dictionary. Is there a way to use INotifyPropertyChanged to force the UI to update when binding to a collection?

Thanks!

H.B.
  • 166,899
  • 29
  • 327
  • 400
markv12
  • 334
  • 1
  • 11
  • `KeyValuePairs aren't objects` 'tis a lie! Also: How is them being structs a problem for a ValueConverter? – H.B. Jul 11 '12 at 20:49

1 Answers1

0

Use DisplayMemberPath or ItemTemplate.

H.B.
  • 166,899
  • 29
  • 327
  • 400