Filtering CollectionViewSource
I guess this is the first real post on this blog? And really, the first actual post about really anything in a little while for me, since Christmas Eve apparently. This post is about how to filter a CollectionViewSource in WPF using C#.
Recently I decided to refactor parts of the code base I have been working on for the last few months. This software relies heavily on a few ObservableCollection<Person>
, where Person
is a custom class for this specific project.
One is the main collection, carrying every object available to the user. Another collection is a subset of the first, where every element fulfilled a specific criteria. Each collection is also set as the source for separate CollectionViewSource
s as DataContext
for its own control. In the actual application I also used a third list, but for this example, it really is not of interest.