user1436929
user1436929

Reputation: 11

Process ReactiveCollection CollectionChangeEvent in batches asynchronously

I am exploring Reactive UI. I have an ObservableCollection of models in which objects are added at a very high speed. I handle the collectionchanged event and add viewModels for each model in another ObservableCollection. Can we suppress the CollectionChanged event for Model list and raise an event for a bunch of records or after a specified time interval has lapsed?

Upvotes: 1

Views: 237

Answers (1)

Ana Betts
Ana Betts

Reputation: 74652

Yes, here's how to do it:

using (someReactiveCollection.SuppressChangeNotifications()) {
    // TODO: Add a bunch of items
}

Upvotes: 2

Related Questions