title: Style content via setters v ContentTemplate
body: <p>The xaml for the first style works as I want, producing a button with a Wingding glyph using setters to lay out the content and it's properties. The second version of this style is trying to do the same thing but with a DataTemplate for the Content, but it just displays the type of a DataTemplate (ie, System.Windows.DataTemplate).</p>
  
  <ol>
  <li>Why won't the 2nd version display the same content as the 1st?</li>
  <li>Assuming the fix is trivial, would one version of the style be preferable over the other for any reason beyond personal preference?</li>
  </ol>
  
  <p>NOTE: I am showing the bindings and triggers in case there is something in there that is affecting the content, but it's only the the first part of the style that varies</p>
  
  <p>Cheers,<br>
  Berryl </p>
  
  <h1>Style 1</h1>
  
  <p>Displays: <img src="https://i.stack.imgur.com/LONOi.jpg" alt="enter image description here"></p>
  
  <pre><code>&lt;Style x:Key="EditCommandButtonStyle" TargetType="{x:Type Button}" &gt;
      &lt;Setter Property="Content" Value="a" /&gt;
      &lt;Setter Property="Foreground" Value="Navy" /&gt;
      &lt;Setter Property="FontFamily" Value="Wingdings 3" /&gt;
      &lt;Setter Property="FontWeight" Value="Bold" /&gt;
      &lt;Setter Property="FontSize" Value="18" /&gt;
      &lt;Setter Property="Width" Value="30" /&gt;
      &lt;Setter Property="Height" Value="Auto" /&gt;
  
      &lt;!--What makes it an Edit button--&gt;
      &lt;Setter Property="Command" Value="{Binding ActivateThisSatelliteVmCommand}"/&gt;
      &lt;Setter Property="ToolTip"&gt;
          &lt;Setter.Value&gt;
              &lt;TextBlock&gt;
                  &lt;TextBlock.Text&gt;
                      &lt;Binding Path="HeaderLabel" StringFormat="{resx:Resx ResxName=Smack.Core.Presentation.Resources.MasterDetail, Key=Item_Edit_Label}"/&gt;
                  &lt;/TextBlock.Text&gt;
              &lt;/TextBlock&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  
      &lt;!-- WHen its available --&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                  &lt;Border x:Name="theBorder" CornerRadius="4"&gt;
                      &lt;ContentPresenter x:Name="theContent" VerticalAlignment="Center" HorizontalAlignment="Center" /&gt;
                  &lt;/Border&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="IsMouseOver" Value="False"&gt;
                          &lt;Setter TargetName="theContent" Property="Visibility" Value="Hidden"/&gt;
                          &lt;Setter TargetName="theBorder" Property="Background" Value="Transparent"/&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                          &lt;Setter TargetName="theContent" Property="Visibility" Value="Visible"/&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsPressed" Value="True"&gt;
                          &lt;Setter TargetName="theContent" Property="Visibility" Value="Visible"/&gt;
                          &lt;Setter TargetName="theBorder" Property="Background" Value="Orange"/&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <h1>Style 2</h1>
  
  <p>Displays "System.Windows.DataTemplate"</p>
  
  <pre><code>&lt;Style x:Key="EditCommandButtonStyle" TargetType="{x:Type Button}" &gt;
      &lt;Setter Property="Content"&gt;
          &lt;Setter.Value&gt;
              &lt;DataTemplate&gt;
                  &lt;TextBlock Text="a" FontFamily="Wingdings 3" FontWeight="Bold" FontSize="18" Foreground="Navy" /&gt;
              &lt;/DataTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  
      &lt;!--What makes it an Edit button--&gt;
      &lt;Setter Property="Command" Value="{Binding ActivateThisSatelliteVmCommand}"/&gt;
      &lt;Setter Property="ToolTip"&gt;
          &lt;Setter.Value&gt;
              &lt;TextBlock&gt;
                  &lt;TextBlock.Text&gt;
                      &lt;Binding Path="HeaderLabel" StringFormat="{resx:Resx ResxName=Core.Presentation.Resources.MasterDetail, Key=Item_Edit_Label}"/&gt;
                  &lt;/TextBlock.Text&gt;
              &lt;/TextBlock&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  
      &lt;!-- When its available --&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                  &lt;Border x:Name="theBorder" CornerRadius="4"&gt;
                      &lt;ContentPresenter x:Name="theContent" VerticalAlignment="Center" HorizontalAlignment="Center" /&gt;
                  &lt;/Border&gt;
                  &lt;ControlTemplate.Triggers&gt;
                      &lt;Trigger Property="IsMouseOver" Value="False"&gt;
                          &lt;Setter TargetName="theContent" Property="Visibility" Value="Hidden"/&gt;
                          &lt;Setter TargetName="theBorder" Property="Background" Value="Transparent"/&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsMouseOver" Value="True"&gt;
                          &lt;Setter TargetName="theContent" Property="Visibility" Value="Visible"/&gt;
                      &lt;/Trigger&gt;
                      &lt;Trigger Property="IsPressed" Value="True"&gt;
                          &lt;Setter TargetName="theContent" Property="Visibility" Value="Visible"/&gt;
                          &lt;Setter TargetName="theBorder" Property="Background" Value="Orange"/&gt;
                      &lt;/Trigger&gt;
                  &lt;/ControlTemplate.Triggers&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>