i'm having a ICollectionView with filtering in colde. the problem is that the filtering never executes...
this is the code:
private ObservableCollection<string> _jobSizes;
private CollectionViewSource _jobSizesSource;
public ICollectionView JobSizesView
{
get
{
if (_jobSizesSource == null)
{
_jobSizesSource = new CollectionViewSource
{
Source = JobSizes
};
}
_jobSizesSource.View.Filter = OnSizeFilter;
return _jobSizesSource.View;
}
}
private bool OnSizeFilter(object item)
{
if (string.IsNullOrEmpty(_size))
return true;
if (((string) item).StartsWith(Size))
return true;
return false;
}
i use JobSizesView.Refresh(); to refresh the list... but also while constructing the list the filter is not executes...