I got a ListView with an ItemsSource collection, where ObservableCollection<string> is set.
And, the ListView contains a filter in its ListView.Items.Filter property (as a Predicate<bool,object>.
So let’s say there are conditions when the filter can change its behavior without changing its own reference.
And when those conditions change i need to let the ListView know that it has to reconstruct its view according to the new filter.
The only solution i’ve figured is
ListView.Items.Filter = ListView.Items.Filter;
which is wrong but it still works. Updates each item again with the filter.
So is there right solution for that?
You need to get a hold of the collection view (
ICollectionView) that theListViewis bound to andRefresh()it. It’s not clear to me how you’ve bound to your data, but you can either:It sounds like you’ve done the latter, in which case you can use: