title: DependencyProperty PropertyChangedCallback vs placing code directly into the setter
body: <p>Was just wondering about DependencyProperties.</p>
  
  <p>Usually I'm seeing this kind of coding standard when executing some code after a DependencyProperty has changed.</p>
  
  <pre><code>public int SomeProperty
      {
          get { return (int)GetValue(SomePropertyProperty); }
          set { SetValue(SomePropertyProperty, value); }
      }
  
      public static readonly DependencyProperty SomePropertyProperty =
          DependencyProperty.Register("SomeProperty", typeof(int), typeof(MainWindow), new UIPropertyMetadata(new DependencyPropertyChangedEventHandler(OnSomePropertyChanged)));
  
      private static void OnSomePropertyChanged(object obj, DependencyPropertyChangedEventArgs e)
      {
          //Some logic in here
      }
  </code></pre>
  
  <p>But I don't think I've never seen this kind of implementation - </p>
  
  <pre><code>public int SomeProperty
      {
          get { return (int)GetValue(SomePropertyProperty); }
          set 
          { 
              SetValue(SomePropertyProperty, value);
  
              //Execute code in here
          }
      }
  
      public static readonly DependencyProperty SomePropertyProperty =
          DependencyProperty.Register("SomeProperty", typeof(int), typeof(MainWindow), new UIPropertyMetadata(0));
  </code></pre>
  
  <p>Is this considered a bad practice?</p>
  
  <p>Thanks!</p>