The amount of items in collection: ~100k The amount of field displayed in columns: 4-10
The problem itself - the collection is taken from a database using EntityFramework. It takes about 10-12s on dev computers to load and materialize all the required data. Yet another thing that comes up is that the same collection can be bound to several controls, and, therefore, they must be filtered separately (= not setting the default collection view filters). Currently, I set the binding as follows:
Binding b = new Binding();
b.Source = new CollectionViewSource() { Source = MyLargeCollection }.View;
MyDataGrid.SetBinding(DataGrid.ItemsSourceProperty, b);
Creating a new CollectionViewSource greatly increases the time it takes to initialize - several minutes (and I suspect that it is enumerating the 100k collection for some reason). I mean that if I just set:
b.Source = MyLargeCollection;
It will just take those 10-12 seconds to load and materialize data from the database.
The question - is there some problem with my code? If not - what would be the right approach for binding the same large collection to different items controls but with different collection views?