Previously to implementing filtering on the CollectionView, i used this to display the number of rows within the datagrid;
<TextBlock Text="{Binding ElementName=dataGrid1, Path=ItemsSource.Count}" />
I have since implemented a filter as so;
ICollectionView cvs = CollectionViewSource.GetDefaultView(datagrid1.ItemsSource);
cvs.Filter = new Predicate<object>(FilterMethod);
...
public bool FilterMethod(object item) {
// conditionally returns true/false
}
The TextBlock above still shows the unfiltered count, when visually the filter is removing items from view. How can I get the TextBlock above to show the row count as a result of the filter?