protected override void RemoveItem(int index) { if (IsNotificationsSuspended) { _IsDirty = true; } else { var collectionChangingEventArgs = new CollectionChangingEventArgs <T>(Items[index], index, CollectionChangeAction.Remove); CollectionChanging(this, collectionChangingEventArgs); if (collectionChangingEventArgs.Cancel) { return; } } base.RemoveItem(index); }
protected override void ClearItems() { if (IsNotificationsSuspended) { _IsDirty = true; } else { var collectionChangingEventArgs = new CollectionChangingEventArgs <T>(default(T), 0, CollectionChangeAction.Refresh); CollectionChanging(this, collectionChangingEventArgs); if (collectionChangingEventArgs.Cancel) { return; } } base.ClearItems(); }
protected override void InsertItem(int index, T item) { if (IsNotificationsSuspended) { _IsDirty = true; base.InsertItem(index, item); } else { var collectionChangingEventArgs = new CollectionChangingEventArgs <T>(item, index, CollectionChangeAction.Add); CollectionChanging(this, collectionChangingEventArgs); if (collectionChangingEventArgs.Cancel) { return; } base.InsertItem(index, collectionChangingEventArgs.Item); } }