public void Unsubscribe( INotifyPropertyChanged subject, object rootSubject, TListener listener) { WeakPropertyChangedEventManager.Unregister(subject, _propertyAccessNode.PropertyName, listener, rootSubject); UnsubscribeFromChildren(listener, subject, rootSubject); }
public void Unregister_MonitoredPropertyChanged_DoesNotFireCallback() { RegisterOnPersonName(); WeakPropertyChangedEventManager.Unregister(_person, "Name", _listener, null); _person.Name = "Bob"; Assert.AreEqual(0, _listener.CallCount); }
private void Unsubscribe() { INotifyPropertyChanged subject = this.Subject; if (subject == null) { return; } for (int i = 0; i < this.AccessNode.Children.Count; i++) { PropertyAccessNode propertyNode = (PropertyAccessNode)this.AccessNode.Children[i]; WeakPropertyChangedEventManager.Unregister(subject, propertyNode.Property.Name, this, null); } if (this.Children != null) { for (int i = 0; i < this.Children.Count; i++) { this.Children[i].Unsubscribe(); } } }