title: Firing custom DependencyProperty's PropertyChangedCallback on initialize
body: <p>I'm implementing a boolean DependencyProperty that adds an adorner to the DependencyObject when it is set to true. I want the DependencyProperty's default value to be true, but doing so does not fire the PropertyChangedCallback, so the adorner is not created by default. Is there a way to have the PropertyChangedCallback fire on initialization?</p>
  
  <pre><code>public static bool GetIsAdorned(DependencyObject obj)
  {
      return (bool)obj.GetValue(IsAdornedProperty);
  }
  
  public static void SetIsAdorned(DependencyObject obj, bool value)
  {
      obj.SetValue(IsAdornedProperty, value);
  }
  
  public static readonly DependencyProperty IsAdornedProperty =
         DependencyProperty.RegisterAttached("IsAdorned",
         typeof(bool),
         typeof(UIElement),
         new UIPropertyMetadata(true, OnIsAdornedChanged));
  
  private static void OnIsAdornedChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs e)
  {
      var uiElement = dependencyObject as UIElement;
      var newValue = (bool)e.NewValue;
      var adornerLayer = AdornerLayer.GetAdornerLayer(uiElement);
  
      if (newValue)
      {
          adornerLayer.Add(new MyAdorner(uiElement));
      }
  }
  </code></pre>