コード例 #1
0
        private void SetupPropertyChangeSubscription()
        {
            if (this.PropertyAccessTree == null)
            {
                return;
            }

            if (this.PropertyAccessTree.DoesEntireTreeSupportINotifyPropertyChanging)
            {
                _propertyChangedSubscription = this.PropertyAccessTree.CreateCallbackSubscription <NotifyCollectionChangedMonitor <T> >(OnAnyPropertyChange);
            }
            else
            {
                this.Subscriptions = new Dictionary <T, SubscriptionTree>();
            }
        }
コード例 #2
0
        internal void SubscribeToChanges(T subject)
        {
            if (EntireTreeSupportINotifyPropertyChanging)
            {
                if (_PropertyAccessTree == null)
                {
                    _PropertyAccessTree = PropertyAccessTree.CreateCallbackSubscription <PropertyNotifier <T> >(OnItemChanging, OnItemChanged);
                }
                _PropertyAccessTree.SubscribeToChanges(subject, this);
            }
            else
            {
                if (_Subscriptions == null)
                {
                    _Subscriptions = new Dictionary <T, SubscriptionTree>();
                }

                SubscriptionTree tree = PropertyAccessTree.CreateSubscriptionTree(subject);
                tree.PropertyChanged += OnAnyPropertyChangeInSubscriptionTree;
                _Subscriptions.Add(subject, tree);
            }
        }