Esempio n. 1
0
                public void Unsubscribe(
                    INotifyPropertyChanged subject,
                    object rootSubject,
                    TListener listener)
                {
                    WeakPropertyChangedEventManager.Unregister(subject, _propertyAccessNode.PropertyName, listener, rootSubject);

                    UnsubscribeFromChildren(listener, subject, rootSubject);
                }
Esempio n. 2
0
        public void Unregister_MonitoredPropertyChanged_DoesNotFireCallback()
        {
            RegisterOnPersonName();

            WeakPropertyChangedEventManager.Unregister(_person, "Name", _listener, null);
            _person.Name = "Bob";

            Assert.AreEqual(0, _listener.CallCount);
        }
Esempio n. 3
0
        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();
                }
            }
        }