I have Cusom collection object containing a collection of objects. I then have two UI elements (a grid and chart) bound to this single object. The grid shows all the objects and the chart shows a subset of the same collection.
What I want to be able to do is register a filter in the collection (Func<>?) and conditionally execute the filter to create the subset collection.
Really not sure how to approach this. Any pointers would be really helpful.
You can just pass in the Func<> into the Where() static method. The output will be a new IEnumerable collection you can bind to your UI elements. The function you register must be of type
Func<ItemInYourCollection, Boolean>.If you want to switch between using the filter and not using the filter, it may be easiest to use a “non-filtering” function: