private void AttachListener(PropertyPathToken link)
        {
            IObservableDependencyObject dependencyObject = link.Object as IObservableDependencyObject;
            INotifyPropertyChanged      inpc             = link.Object as INotifyPropertyChanged;

            if (dependencyObject != null)
            {
                dependencyObject.AttachPropertyChangedHandler(link.PropertyName, this.DependencyPropertyChanged);
            }
            else if (inpc != null)
            {
                inpc.PropertyChanged += this.PropertyChanged;
            }
        }
Example #2
0
        internal override void Attach(FrameworkElement target, DependencyObject parent)
        {
            DependencyObject source = parent;

            if (this.SourceName != null)
            {
                source = (DependencyObject)target.FindName(this.SourceName);
            }

            this.attached.Add(source, target);

            if (this.CheckCondition(source))
            {
                this.Setters.Attach(target);
                this.applied.Add(target);
            }

            IObservableDependencyObject observable = (IObservableDependencyObject)source;

            observable.AttachPropertyChangedHandler(this.Property.Name, this.ValueChanged);
        }