private void UnsubscribeFromItem(T item) { bool wasLastInstanceOfItemRemovedFromCollection = this.ReferenceCountTracker.Remove(item); if (!wasLastInstanceOfItemRemovedFromCollection || !this.IsMonitoringChildProperties) { return; } if (_propertyChangedSubscription != null) { _propertyChangedSubscription.UnsubscribeFromChanges((INotifyPropertyChanged)item, this); } else { this.Subscriptions[item].PropertyChanged -= OnAnyPropertyChangeInSubscriptionTree; this.Subscriptions.Remove(item); } }
internal void UnsubscribeFromChanges(T subject) { if (EntireTreeSupportINotifyPropertyChanging) { if (_PropertyAccessTree == null) { return; } _PropertyAccessTree.UnsubscribeFromChanges(subject, this); } else { if (_Subscriptions == null) { return; } _Subscriptions[subject].PropertyChanged -= OnAnyPropertyChangeInSubscriptionTree; _Subscriptions.Remove(subject); } }