Reputation: 3265
Does it any good implementation of Filterable Collection for C#?
What is 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.
Upvotes: 0
Views: 208
Reputation: 292425
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;
Upvotes: 2