title: How to inherit/extend styles from a resource dictionary?
body: <p>I am having trouble extending one of my styles that I have defined in the Windows dictionary.  Alone, it seems to apply the style to my controls as expected.  However, if try to extend the style in one of my userControls, using the basedOn property, it simply overrides the main one and all the base styles dissapear.  Here's an example:</p>
  <p>In a resource dictionary, named dict1.xaml:</p>
  <pre><code>&lt;Style TargetType=&quot;{x:Type Button}&quot;&gt;
      &lt;Setter Property=&quot;Background&quot; Value=&quot;Pink&quot;/&gt;
  &lt;/Style&gt;  
  </code></pre>
  <p>In the main window.xaml:</p>
  <pre><code>&lt;Window.Resources&gt;
      &lt;ResourceDictionary Source=&quot;dict1.xaml&quot;/&gt;
  &lt;/Window.Resources&gt;
  </code></pre>
  <p>In a user control called userControl1.xaml:</p>
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;Style  BasedOn=&quot;{StaticResource {x:Type Button}}&quot; 
              TargetType=&quot;{x:Type Button}&quot;&gt;
          &lt;Setter Property=&quot;FontWeight&quot; Value=&quot;Bold&quot;/&gt;
      &lt;/Style&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  <p>The style in the user control simply overrides the one in the resource dictionary and the font is Bold. If I remove the style in the user control, the style in the dictionary kicks in and the background becomes pink. I want both.</p>