A small extension to ObservableCollection that allows for multiple items to be added, removed or replaced in a single operation.
A small extension to ObservableCollection that allows for multiple items to be added, removed or replaced in a single operation.
This library is simple and just adds a few extra methods:
var collection = new RangedObservableCollection<int>();
// bulk add
var itemsToAdd = new [] { 1, 2, 3, 4, 5 };
collection.AddRange(itemsToAdd);
// bulk remove
var itemsToRemove = new [] { 1, 2, 3, 4, 5 };
collection.RemoveRange(itemsToRemove);
// bulk clear and add
var itemsToReplace = new [] { 1, 2, 3, 4, 5 };
collection.ReplaceRange(itemsToReplace);