I have a CollectionView
derived from an ObservableCollection
:
private static ObservableCollection<CalculationViewModel> _calculations;
CalculationViewModelsCollection = (CollectionView)CollectionViewSource.GetDefaultView(_calculations);
My problem is that, when the result of the filter is nothing, I'd like to clear the filter, and re-filter with other conditions, but the CollectionView
is always empty.
I tried to reset the filter these ways:
CalculationViewModelsCollection.Filter = null;
CalculationViewModelsCollection.Refresh();
and
CalculationViewModelsCollection.Filter = delegate(object p)
{
return true;
};
But none of them worked.
Could you give some advice how to reset a filter on a CollectionView
?