ListDifference NotifyDeletion(ListDifference diff, TResult[] items) { if (items.Length == 1) { OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, items[0], diff.NewIndex)); } else { OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Remove, items, diff.NewIndex)); } return(diff); }
ListDifference NotifyInsertion(ListDifference diff, TResult[] items) { int index = diff.NewIndex; foreach (var item in items) { OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, item, index)); ++index; } /* * if (items.Length == 1) * { * OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, items[0], diff.NewIndex)); * } * else * { * OnCollectionChanged(new NotifyCollectionChangedEventArgs(NotifyCollectionChangedAction.Add, items, diff.NewIndex)); * }*/ return(diff); }