title: WPF: Run Code when DependencyProperty Is Changed
body: <p>In a simple user control I want to be able to run code any time that a dependency property changes.  </p>
  
  <pre><code>    public static readonly DependencyProperty Text1Property =
      DependencyProperty.Register("Text1", typeof(string), 
          typeof(BasicControl));
  
      public string Text1
      {
          get { return GetValue(Text1Property).ToString(); }
          set
          {                
              SetValue(Text1Property, value.ToString());
              OnPropertyChanged("Text2");
          }
      }
  </code></pre>
  
  <p>Text2 in this case is another property that is derived from Text1 and displayed on the UI.  </p>
  
  <p>When running this the function is never reached.  How can I get the code to run every time that a dependency property is changed?</p>