Filtering an Observable Collection in WPF MVVM via ICollectionView
I have an observabelCollection of a data object:
public ObservableCollection<GistViewModel> Gists { get => gists; set => SetProperty(ref gists, value); }
public ObservableCollection<GistViewModel> Gists { get => gists; set => SetProperty(ref gists, value); }
Each
GistViewModel
GistViewModel
has the following:
public BindingList<GistFileViewModel> GistFiles { get => gistFiles; }
public BindingList<GistFileViewModel> GistFiles { get => gistFiles; }
In terms of what this represents, each Gist has a collection of GistFiles. I am mapping this onto a TreeViewControl (root being Gists, Child being GistFiles) via the following xaml (abridged):