protected override void OnReplace(BulkUpdateableCollection <T> collection, IReadOnlyList <T> items) { collection.Clear(); foreach (var e in items) { collection.Items.Add(e); } collection.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, items as IList ?? items.ToList(), 0)); }
protected virtual void OnReplace(BulkUpdateableCollection <T> collection, IReadOnlyList <T> items) { if (TryInsert(collection, items) || TryRemove(collection, items)) { return; } collection.Clear(); foreach (var e in items) { collection.Add(e); } }
protected override void OnClear(BulkUpdateableCollection <T> collection) { collection.Clear(); collection.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset)); }
protected virtual void OnClear(BulkUpdateableCollection <T> collection) => collection.Clear();