forked from xamarinhq/xamu-infrastructure
-
Notifications
You must be signed in to change notification settings - Fork 0
OptimizedObservableCollection
Mark Smith edited this page Aug 29, 2016
·
1 revision
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.
-
BeginMassUpdate: turns off change notifications and returns anIDisposableobject which must be disposed to turn them back on.
var collection = new OptimizedObservableCollection<string>() { ... };
using (collection.BeginMassUpdate())
{
.. // Do a bunch of changes here.
} // UI is notified about all changes here.