title: How do I alter the default style of a button without WPF reverting from Aero to Classic?
body: <p>I've added PresentationFramework.Aero to my App.xaml merged dictionaries, as in...</p>
  
  <pre><code>&lt;Application
      x:Class="TestApp.App"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
      &lt;Application.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;ResourceDictionary.MergedDictionaries&gt;
                  &lt;ResourceDictionary
                      Source="/PresentationFramework.Aero;component/themes/Aero.NormalColor.xaml" /&gt;
                  &lt;ResourceDictionary
                       Source="pack://application:,,,/WPFToolkit;component/Themes/Aero.NormalColor.xaml" /&gt;
                  &lt;ResourceDictionary
                      Source="/CommonLibraryWpf;component/ResourceDictionaries/ButtonResourceDictionary.xaml" /&gt;
                      &lt;!-- Note, ButtonResourceDictionary.xaml is defined in an external class library--&gt;
              &lt;/ResourceDictionary.MergedDictionaries&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/Application.Resources&gt;
  &lt;/Application&gt;
  </code></pre>
  
  <p>I'm trying to modify the default look of buttons just slightly. I put this style in my ButtonResourceDictionary:</p>
  
  <pre><code>&lt;Style TargetType="Button"&gt;
      &lt;Setter Property="Padding" Value="3" /&gt;
      &lt;Setter Property="FontWeight" Value="Bold" /&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>All buttons now have the correct padding and bold text, but they look "Classic", not "Aero". How do I fix this style so my buttons all look Aero but also have these minor changes? I would prefer not to have to set the <code>Style</code> property for every button.</p>
  
  <p><strong>Update</strong></p>
  
  <p>I should have mentioned this in the first place, but if I try to use <code>BasedOn</code>, as shown below, I get a <code>StackOverflowException</code>:</p>
  
  <pre><code>&lt;Style BasedOn="{StaticResource {x:Type Button}}" TargetType="{x:Type Button}"&gt;
      &lt;Setter Property="Padding" Value="3" /&gt;
      &lt;Setter Property="FontWeight" Value="Bold" /&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>This would normally work, but not with the Aero dictionaries merged in. If I comment those dictionaries out, the exception disappears.</p>
  
  <p><strong>Update 2</strong></p>
  
  <p>If I add an <code>x:Key</code> attribute and manually set the style, it works properly (Aero style with padding and bold), but as I said, I'd prefer that the style is automatically applied globally to all buttons.</p>
  
  <p><strong>Update 3</strong></p>
  
  <p>I just discovered a new wrinkle. In my app, ButtonResourceDictionary.xaml is placed in a class library (i.e., in an external project). If I move this file to a local folder, everything works fine. So, the problem seems to be a bad interaction caused by referencing various external resource dictionaries. I'm correcting my App.xaml code snippet (above) to reflect that ButtonResourceDictionary is actually defined externally.</p>