title: How to fix dependencyproperty for custom style
body: <p>I'm working on a personal library to define styles.
  I have created some DependecyProperty to manage style size.
  <a href="https://i.stack.imgur.com/6yN7T.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6yN7T.png" alt="Exemple of the style when it works"></a></p>
  
  <p>Here is a part of the dependencies I have created :</p>
  
  <pre><code>public class CheckboxExtensions : CheckBox
  {
      public static readonly DependencyProperty CheckHeightProperty =
          DependencyProperty.RegisterAttached(
              "CheckHeight",
              typeof(double),
              typeof(CheckboxExtensions),
              new PropertyMetadata(OnHeightChange));
  
      public static void SetCheckHeight(UIElement element, double value)
      {
          element.SetValue(CheckHeightProperty, value);
      }
  
      public static readonly DependencyProperty LeftColorProperty =
          DependencyProperty.RegisterAttached(
              "LeftColor",
              typeof(SolidColorBrush),
              typeof(CheckboxExtensions));
  
      public static void SetLeftColor(UIElement element, SolidColorBrush value)
      {
          element.SetValue(LeftColorProperty, value);
      }
  
      public static SolidColorBrush GetLeftColor(UIElement element)
      {
          return (SolidColorBrush)element.GetValue(LeftColorProperty);
      }
  }
  </code></pre>
  
  <p>And I can define colors like this in my style :</p>
  
  <pre><code>&lt;Setter Property="extensions:CheckboxExtensions.LeftColor" Value="{DynamicResource Foreground}" /&gt;
  &lt;Setter Property="extensions:CheckboxExtensions.RightColor" Value="{DynamicResource ControlBackground.Flash}" /&gt;
  </code></pre>
  
  <p>When I use it directly in window, it's working but I have a design time that isn't showing the "bullet" <a href="https://i.stack.imgur.com/1Y6DR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1Y6DR.png" alt="enter image description here"></a></p>
  
  <p>But I have a bigger problem. When I use it in a UserControl library and load that UserControl into an application. I got the same result as in design time. No color at all but size are correctly set.</p>
  
  <p>How can I fix this ?</p>