title: wpf default style and style base
body: <p>I'm trying to make a wpf style that will allow me to: 
  1. Base alternate styles off a base style
  2. Have the base style be a default that every control uses when no style is applied.</p>
  
  <p>For example, I have code to make style for a button...</p>
  
  <pre><code>&lt;!--Base Button--&gt;
  &lt;Style TargetType="Button" x:Key="BaseButton"&gt;
      &lt;Setter Property="Width" Value="auto"/&gt;
      &lt;Setter Property="MaxWidth" Value="100"/&gt;
      &lt;Setter Property="Height" Value="auto"/&gt;
      &lt;Setter Property="MaxHeight" Value="50"/&gt;
  
      &lt;Style.Triggers&gt;
          &lt;Trigger Property="IsMouseOver" Value="True"&gt;
              &lt;Setter Property="Cursor" Value="Hand"/&gt;
          &lt;/Trigger&gt;
          &lt;Trigger Property="IsMouseOver" Value="True"&gt;
              &lt;Setter Property="Opacity" Value=".85"/&gt;
          &lt;/Trigger&gt;
      &lt;/Style.Triggers&gt;
  &lt;/Style&gt;
  &lt;!--Apply Base to any Button without a style--&gt;
  &lt;Style TargetType="Button" BasedOn="{StaticResource BaseButton}"/&gt;
  </code></pre>
  
  <p>and here is  a style for a specific button...</p>
  
  <pre><code>&lt;Style TargetType="Button" x:Key="DeleteBtn" BasedOn="{StaticResource BaseButton}"&gt;
      &lt;Setter Property="Width" Value="100"/&gt;
      &lt;Setter Property="Height" Value="35"/&gt;
      &lt;Setter Property="ContentTemplate"&gt;
          &lt;Setter.Value&gt;
              &lt;DataTemplate&gt;
                  &lt;StackPanel Orientation="Horizontal"&gt;
                      &lt;Image Source="(some url)" Height="16" HorizontalAlignment="Left" VerticalAlignment="Center"/&gt;
                      &lt;Label Content="Delete" HorizontalAlignment="Left" VerticalAlignment="Center"/&gt;
                  &lt;/StackPanel&gt;                    
              &lt;/DataTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>As you can see, I would like to be able to base the "DeleteBtn" Style off of the base, but also have the base be the default for every button placed on the screen that doesn't have a specific style set. This currently only works for buttons and no other control. The above example does work, but I can't seem to do the same thing for labels, textboxes etc. Any thoughts or input would be greatly appreciated :)</p>
  
  <p>Here's an example of one that doesn't work..</p>
  
  <pre><code>&lt;!--Base Icon--&gt;
  &lt;Style TargetType="Image" x:Key="BaseIcon"&gt;
      &lt;Setter Property="VerticalAlignment" Value="Top"/&gt;
      &lt;Setter Property="HorizontalAlignment" Value="Right"/&gt;
  &lt;/Style&gt;
  &lt;!--Apply Base to any Icon without a style--&gt;
  &lt;Style TargetType="Image" BasedOn="{DynamicResource BaseIcon}"/&gt;
  </code></pre>
  
  <p>It gives an error: 'DynamicResourceExtension' cannot be set on the 'BasedOn' property of type 'Style'. A 'DynamicResourceExtension' can only be set on a DependencyProperty of a DependencyObject.</p>