It appears that filtering an ObservableCollection
with CollectionViewSource
is not possible in WinRT:
I can filter using LINQ, but how do I get the UI to update if changes that affect the filtered data are made?
It appears that filtering an ObservableCollection
with CollectionViewSource
is not possible in WinRT:
I can filter using LINQ, but how do I get the UI to update if changes that affect the filtered data are made?
I ended up writing my own class to achieve the desired effect:
Not yet perfect. So improvements/suggestions welcomed.
You can now bind this object, directly to a control using the View property.
You need to make sure the filtering changes are observable, so you can set the source of the
CollectionViewSource
to anObservableCollection
and make the changes on that collection or assign a newSource
of the CVS to a new, filtered collection.