예제 #1
0
        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));
        }
예제 #2
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);
            }
        }
예제 #3
0
 protected override void OnClear(BulkUpdateableCollection <T> collection)
 {
     collection.Clear();
     collection.OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Reset));
 }
예제 #4
0
 protected virtual void OnClear(BulkUpdateableCollection <T> collection)
 => collection.Clear();