Access the filtered collection from viewmodel
abid76 opened this issue · comments
abid76 commented
First of all thanks for this great project.
In my project datagrid is populated by an ObservableCollection
in the viewmodel.
AFAIK the viewmodel doesn't know about filtering as filtering is performed in the view. Right?
Problem: the viewmodel needs to know which items of the ObservableCollection
are currently displayed according to the filter.
Is there any way to access/create a subset of the viewmodel's ObservableCollection
according to the filter?
Thanks in advance.
tom-englert commented
You could create the CollectionView in the view model and bind the DataGrid to that. The CollectionView holds the filtered collection.
abid76 commented
Ok, that's easy. Thanks!