How to link ItemsSource with multiple collections?

I have several sources that display the ObservableCollection<MyData> property. Now I want to associate ListBox.ItemsSource with all of them and support CollectionChanged notifications, sorting and filtering. How to do it? CompositeCollection does not support filtering.

+4
source share
1 answer

You can use CompositeCollection and CollectionViewSource together. Use CompositeCollection to combine all collections, and then create a collection view source from this CompositeCollection. Filter properties can be used in CollectionViewSource.

Look at the sample

How to handle CompositeCollection elements with CollectionView functions?

0
source

Source: https://habr.com/ru/post/1442025/


All Articles