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