Filterable collection mvvm
Does it any good implementation of Filterable Collection for C#?
What i开发者_如何学运维s required:
var data = GetEmployees();
_filtered = new FilterableCollection<Employee>(data);
_filtered.SetFilterExpression(empl => empl.DepartmentId == SelectedDepartment.Id);
...
set
{
SelectedDepartment = value;
_filtered.UpdateRepresentation();
}
Paging, CustomFilterBuilder and Virtualization would be a plus but not required at the moment.
I'm not sure why you need this... WPF already does supports this, via the ICollectionView interface.
ICollectionView view = CollectionViewSource.GetDefaultView(data);
view.Filter = o => ((Employee)o).DepartmentId == SelectedDepartment.Id;
精彩评论