title: Overriding themes in WPF
body: <p>I have a got a small issue with the wpf project I am currently working on. I am new to WPF. In my app.xaml I am using the Microsoft Aero theme for my application. I have got something like this in my app.xaml</p>
  
  <pre><code> &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="/PresentationFramework.Aero;V3.0.0.0;31bf3856ad364e35;component/themes/Aero.NormalColor.xaml" /&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>Now what I would like to know how to override certain style properties e.g. For Buttons I want to override the font style meanwhile retaining the rest of the aero style.</p>
  
  <p>If I define a style for button in my window resources e.g.</p>
  
  <pre><code> &lt;Style TargetType="{x:Type Button}" BasedOn="{StaticResource {x:Type Button}}" x:Key="RedTextBasedOnButton"&gt;
              &lt;Setter Property="Foreground" Value="Red" /&gt;
          &lt;/Style&gt;
  </code></pre>
  
  <p>and define a button based on the above style</p>
  
  <p></p>
  
  <p>the button looses all the aero style properties. I think the problem is to do with the way I define the <strong>BasedOn</strong> property for the style</p>
  
  <pre><code>BasedOn="{StaticResource {x:Type Button}}"
  </code></pre>
  
  <p>I don't think the resource is static as it comes from a dll, it should probably be something like this. Not sure though.</p>
  
  <pre><code>BasedOn="{DynamicResource {x:Type Button}}"
  </code></pre>
  
  <p>but the above throws exception and what if I had multiple resourcedictionary in my app.xaml e.g. luna and classic. How can I tell which one to use as the default and at the sametime using and overriding another (e.g. luna) specifically for certain controls in my ui? So some of my buttons will be based on luna style and some on aero style with some further modifications?</p>
  
  <p>Any idea?</p>
  
  <p>Regards,</p>