Skip to content
This repository was archived by the owner on Aug 27, 2020. It is now read-only.

OptimizedObservableCollection

Mark Smith edited this page Aug 29, 2016 · 1 revision

OptimizedObservableCollection<T>

This class provides a derived version of the ObservableCollection<T> which allows you to turn change notifications off for a period of time. This is useful if a lot of data is going to change in the collection at once to avoid a bunch of binding updates being done serially.

Methods

  • BeginMassUpdate : turns off change notifications and returns an IDisposable object which must be disposed to turn them back on.

Example

var collection = new OptimizedObservableCollection<string>() { ... };

using (collection.BeginMassUpdate())
{
   .. // Do a bunch of changes here.

} // UI is notified about all changes here.