Question

I'm trying to invoke my filter with out having to re initiate it every time

i.e. I want to call

myCollectionView.Refresh(); 

instead of

myCollectionView.Filter = new Predicate<object>(Filter);

The thing is that Refresh has no effect and does not invoke the filter .

Any ideas why this is ?

Was it helpful?

Solution

From the CollectionView.Refresh Method page at MSDN.

When you set the Filter, SortDescriptions, or GroupDescriptions property; a refresh occurs. You do not have to call the Refresh method immediately after you set one of those properties.

If you really want to call Refresh() instead of setting the Filter property, then you can extend the CollectionView class and override the protected RefreshOverride method to override the behaviour of the method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top