title: Getting exception while applying style in on button in wpf
body: <p>I have 2 button on window. I am applying the style. but got this exception.</p>
  
  <p>'Set property 'System.Windows.FrameworkElement.Style' threw an exception.' Line number '38' and line position '7'.</p>
  
  <p>My Code.</p>
  
  <pre><code>&lt;Window.Resources&gt;
          &lt;Image x:Key="btnconnect" Source="images/img-1.png" /&gt; 
          &lt;Image x:Key="btnshow" Source="images/img-2.png" /&gt;
          &lt;Image x:Key="btnclick" Source="images/img-2clicked.png"/&gt;
          &lt;Style x:Key="buttonconnect" TargetType="Button"&gt;
              &lt;Setter Property="Content" Value="{StaticResource btnconnect}"&gt;
              &lt;/Setter&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="Button"&gt;
                          &lt;Grid x:Name="grid"&gt;
                              &lt;Border x:Name="border" CornerRadius="8" BorderThickness="2"&gt;
                                  &lt;ContentPresenter HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              TextElement.FontWeight="Bold"&gt;&lt;/ContentPresenter&gt;
                              &lt;/Border&gt;
                          &lt;/Grid&gt;
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;Trigger Property="IsPressed" Value="true"&gt;
                                  &lt;Setter Value="{StaticResource btnclick}" /&gt;
                              &lt;/Trigger&gt;
                              &lt;Trigger Property="IsEnabled" Value="False"&gt;
                                  &lt;Setter Property="Opacity" TargetName="grid" Value="0.25"/&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers&gt;
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style&gt;
          &lt;Style x:Key="buttonshow" TargetType="{x:Type Button}"&gt;
              &lt;Setter Property="Content" Value="{StaticResource btnshow}" /&gt;
          &lt;/Style&gt;
      &lt;/Window.Resources&gt;
      &lt;Grid&gt;
          &lt;Button Margin="50 100 50 100" Style="{StaticResource buttonconnect}" Height="50" Width="120"/&gt;
          &lt;Button Margin="50 110 50 10" Style="{StaticResource buttonshow}" Height="50" Width="120"/&gt;
      &lt;/Grid&gt;
  </code></pre>