protected void NotifyCollectionChanged(object sender) { NotifyCollectionReset(sender); if (CollectionChangedInternal == null) { return; } CollectionChangedInternal.Invoke(sender, this); }
/// <summary> Check and assert for reentrant attempts to change this collection. </summary> /// <exception cref="InvalidOperationException"> raised when changing the collection /// while another collection change is still being notified to other listeners </exception> private void CheckReentrancy() { if (_monitor.Busy) { // we can allow changes if there's only one listener - the problem // only arises if reentrant changes make the original event args // invalid for later listeners. This keeps existing code working // (e.g. Selector.SelectedItems). if ((CollectionChangedInternal != null) && (CollectionChangedInternal.GetInvocationList().Length > 1)) { throw new InvalidOperationException("RowDefinitionCollection Reentrancy not allowed"); } } }
protected void NotifyCollectionChanged(object sender, NotifyCollectionChangedAction action, IEnumerable <T> changedItems) { //NotifyCollectionReset( sender); if (CollectionChangedInternal != null) { CollectionChangedInternal.Invoke(sender, this); } if (CollectionChanged == null) { return; } CollectionChanged.Invoke(this, new NotifyCollectionChangedEventArgs(action, changedItems)); }