I bind a collection ObservableCollection<Foo>
to a dependency property on my controller, but I run it through an IValueConverter to make it ObservableCollection<object>
instead, which is what my controller expect. The conversion works fine - I create an ObservableCollection<object>
and fill it with all the Foo's from the original list. This however brings a problem which is that now I'm observing on the collection created in the value converter, and hence doesn't see any of the changes to the original collection.
So; do I have to hook up eventhandlers in the converter to manually keep the converted collection in sync with the original one, or is there a better way to handle this? I guess I can't do the convertion without actually creating a new collection? Or can I do the binding in some clever way such that I don't have to do the convert?