title: Can not find resource in custom control template
body: <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:local="clr-namespace:CuratioCMS.Client.UI.Controls"&gt;
  &lt;Style BasedOn="{StaticResource {x:Type Button}}" TargetType="{x:Type local:ImageButton}"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type local:ImageButton}"&gt;
                  &lt;StackPanel Height="Auto" Orientation="Horizontal"&gt;
                      &lt;Image Width="20"
                             Height="20"
                             Margin="10,4,0,4"
                             Source="{Binding Path=Image,
                                              RelativeSource={RelativeSource TemplatedParent}}"
                             Stretch="Fill" /&gt;
                      &lt;TextBlock Margin="5,0,10,0"
                                 HorizontalAlignment="Left"
                                 VerticalAlignment="Center"
                                 FontSize="12"
                                 FontWeight="Bold"
                                 Foreground="{TemplateBinding Foreground}"
                                 Text="{TemplateBinding Label}" /&gt;
                  &lt;/StackPanel&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p></p>
  
  <p>this is the code inside Generic.xaml for ImageButton custom control. whit works as expected but I can not inherit from Base button stale so instead of inheriting all base styling from Button this style only creates custom control without any base styles and as far as </p>
  
  <pre><code>BasedOn="{StaticResource {x:Type Button}}"
  </code></pre>
  
  <p>inside VS with line shows error which says <strong>Resource '{x:Type System.Windows.Controls.Button}' is not found</strong></p>
  
  <p>I do not know how to achieve desired styling and why this error message is there showing up inside Visual studio editor</p>