I am using CollectionViewSource to filter the records displayed in a ListBox. The xaml follows.
I think the better solution is, as usual, Linq!
_viewSource.View.Cast<[your_type]>().Count();
...or...
_viewSource.View.Cast().Count();
...if you don't know the items' type at runtime!