- changed milestone to 1.0.9
-
assigned issue to
- marked as major
Implement an easy way to add filters for collections
For collection, yes something more generic I guess. You can take a look at this maybe : https://wpftutorial.net/DataViews.html. For my specific case, I have a collection of InventorySlotContext, and I want to filter them by ItemType, but right now the only way is to modify the all collection.
Some generic base class for custom filters would be helpful plus a CollectionFilter that can be added as a script, takes a collection as a data binding and provides the filtered collection.
Comments (8)
-
reporter -
reporter - removed milestone
-
Do you have any examples, I can't figure it out how to setup simple filter with ColleectionFilter component.
-
reporter @nicloay: This feature doesn't exist yet and is not planned for a release yet. It was an idea because I thought such filters would be helpful, especially during prototyping. But it would need a good concept to be useful in a generic way, which would a bit too time-consuming for the moment.
-
reporter In version 1.13 CollectionAggregations where introduced which might be useful to implement collection filters as they already observe a collection and work with their items to provide a result.
-
reporter - marked as minor
-
reporter There are already some possibilities, therefore I'll close the issue for now. If another feature should be required, a new specific issue should be created. This one is too unspecific.
-
reporter - changed status to resolved
- Log in to comment
Filters (Where) and Converters (Select) are quite similar as they take a collection, modify it and provide a new collection. So the new CollectionItemsConverter should be a good starting point to add filters.
Right now the converter has to be a class derived from ValueConverter class. Maybe delegates/methods plus an attribute to flag them is the better way.