M
mjmeans
Guest
I need a view into an ObservableCollection that permits sorting and filtering in a dynamic/live way. What I see is simple filtering and sorting where a LINQ query is re-run and a new collection is created and displayed. This is not what I want. I want the view to react to any changes in the underlying ObservableCollection, or changes to the sort or filter.
- As items are added, removed or updated in the underlying ObservableCollection, the view is dynamically updated according to whatever filter and sort are currently set. I.e as items are added or removed from the ObservableCollection they are correspondingly added or removed form the view as appropriate to the filter and sort selected.
- If the filter is changed, items are added or removed from the view to bring it in compliance ... NOT a wholesale replacement of the collection.
- If the sort is changed, items are moved to their new position … NOT a wholesale replacement of the collection.
- When the view changes for any reason, either because the underlying ObservableCollection changes, or the sort or filter changes, then any ListView that is displaying the view keeps the current item selected if it still exists, or keeps the scroll position relative to whatever the originally selected it's closest neighbor would have been if it still existed in the view.
Is there a solution for this?
Continue reading...
- As items are added, removed or updated in the underlying ObservableCollection, the view is dynamically updated according to whatever filter and sort are currently set. I.e as items are added or removed from the ObservableCollection they are correspondingly added or removed form the view as appropriate to the filter and sort selected.
- If the filter is changed, items are added or removed from the view to bring it in compliance ... NOT a wholesale replacement of the collection.
- If the sort is changed, items are moved to their new position … NOT a wholesale replacement of the collection.
- When the view changes for any reason, either because the underlying ObservableCollection changes, or the sort or filter changes, then any ListView that is displaying the view keeps the current item selected if it still exists, or keeps the scroll position relative to whatever the originally selected it's closest neighbor would have been if it still existed in the view.
Is there a solution for this?
Continue reading...