title: How to propagate PropertyChanged changes in DependencyProperty
body: <p>I have a class which implements INotifyPropertyChanged.  An instance of this class is declared as a DependencyProperty in a Window, e.g., </p>
  
  <pre><code>    public IMyClass MyClass
      {
          get { return (IMyClass)GetValue(MyClassProperty); }
          set { SetValue(MyClassProperty, value); }
      }
      public static readonly DependencyProperty MyClassProperty=
          DependencyProperty.Register("MyClass", typeof(IMyClass), typeof(MainWindow), new UIPropertyMetadata(null));
  </code></pre>
  
  <p>In the XAML, I have an element which is bound to this class using</p>
  
  <pre><code>Text="{Binding MyClass, Converter={StaticResource someConverter}}
  </code></pre>
  
  <p>Whenever I change a property in MyClass, I would like someConverter to be triggered.  However, it only happens when I completely swap out MyClass.  Is there a way to tie DependencyProperty updates to my MyClass PropertyChanged?</p>
  
  <p><strong>Update.</strong> In the spirit of AresAvatar's solution, here's what we have so far.  The issue remaining is how to call InvalidateProperty (without having MyClass track it...)</p>
  
  <pre><code>    public IMyClass MyClass
      {
          get { return (IMyClass)GetValue(MyClassProperty); }
          set { SetValue(MyClassProperty, value); }
      }
      public static readonly DependencyProperty MyClassProperty =
          DependencyProperty.Register("MyClass", typeof(IMyClass), typeof(MainWindow),
          new UIPropertyMetadata(null, new PropertyChangedCallback(OnMyClassChanged)));
  
      private static void OnMyClassChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
      {
          if (e.OldValue != null)
          {
              ((IMyClass)e.OldValue).PropertyChanged -= ((MainWindow)d).MyClass_PropertyChanged;
          }
  
          if (e.NewValue != null)
          {
              ((IMyClass)e.NewValue).PropertyChanged += ((MainWindow)d).MyClass_PropertyChanged;
          }
      }
  
      private void MyClass_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
      {
          this.InvalidateProperty(MyClassProperty);  &lt;----- still does not refresh binding, but called.
      }
  </code></pre>