private void SourcePropertyChanged(object sender, DependencyPropertyChangedEventArgs e)
        {
            if (this.weakDependencyPropertyListener == null)
            {
                return;
            }
            DependencyPropertyListener target = this.weakDependencyPropertyListener.Target as DependencyPropertyListener;

            if (target == null)
            {
                this.Disconnect();
                return;
            }
            target.SourcePropertyChanged(sender, e.Property);
        }
 internal static WeakDependencyPropertyChangedListener CreateIfNecessary(DependencyObject source, bool isCoreProperty, DependencyPropertyListener dependencyPropertyListener)
 {
     return new WeakDependencyPropertyChangedListener(source, isCoreProperty, dependencyPropertyListener);
 }
 private WeakDependencyPropertyChangedListener(DependencyObject source, bool isCoreProperty, DependencyPropertyListener dependencyPropertyListener)
 {
     this.source = source;
     this.source.DPChanged += this.SourcePropertyChanged;
     this.weakDependencyPropertyListener = new WeakReference(dependencyPropertyListener);
 }
 internal static WeakDependencyPropertyChangedListener CreateIfNecessary(DependencyObject source, bool isCoreProperty, DependencyPropertyListener dependencyPropertyListener)
 {
     return(new WeakDependencyPropertyChangedListener(source, isCoreProperty, dependencyPropertyListener));
 }
 private WeakDependencyPropertyChangedListener(DependencyObject source, bool isCoreProperty, DependencyPropertyListener dependencyPropertyListener)
 {
     this.source            = source;
     this.source.DPChanged += this.SourcePropertyChanged;
     this.weakDependencyPropertyListener = new WeakReference(dependencyPropertyListener);
 }