title: Template binding on ContentPresenter not working
body: <p>I'm writing a custom button:</p>
  
  <pre><code>&lt;UserControl x:Class="WpfSinergoHMIControls.RoundedButton"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           xmlns:local="clr-namespace:WpfSinergoHMIControls"
           mc:Ignorable="d"&gt;
  
  &lt;UserControl.Template&gt;
      &lt;ControlTemplate TargetType="UserControl"&gt;
          &lt;Button Content="{TemplateBinding Content}" Foreground="{TemplateBinding Foreground}" Click="button_Click" PreviewMouseDown="Button_MouseDown" PreviewMouseUp="Button_MouseUp"&gt;
              &lt;Button.Resources&gt;
  
              &lt;/Button.Resources&gt;
              &lt;Button.Template&gt;
                  &lt;ControlTemplate TargetType="Button"&gt;
                      &lt;Border Width="{Binding Size}"
                              Height="{Binding Size}"
                              BorderBrush="#FF3C7FB1"
                              BorderThickness="1"
                              CornerRadius="5"
                              Name="RoundedButtonBorder"&gt;
                          &lt;Border.Background&gt;
                              &lt;LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"&gt;
                                  &lt;GradientStop Color="#3a4451" Offset="0"/&gt;
                                  &lt;GradientStop Color="#0b2039" Offset="1"/&gt;
                              &lt;/LinearGradientBrush&gt;
                          &lt;/Border.Background&gt;
                          &lt;ContentPresenter VerticalAlignment="{TemplateBinding VerticalAlignment}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}"/&gt;
                      &lt;/Border&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Button.Template&gt;
          &lt;/Button&gt;
      &lt;/ControlTemplate&gt;
  &lt;/UserControl.Template&gt;
  </code></pre>
  
  <p></p>
  
  <p>and I'm trying to bind 'HorizontalAlignement' and 'VerticalAlignment' of the ContentPresenter to the template. What I would like to do, then, is to use the button like this:</p>
  
  <pre><code>&lt;local:RoundedButton HorizontalAlignment="Center" VerticalAlignment="Center" Height="73" Margin="35,10,282,236" FontSize="30"  Width="200" Content="Hello" Foreground="Red"/&gt;
  </code></pre>
  
  <p>And having the text inside the button being centered in both axis. This doesn't work and I cannot figure out the reason. What do I miss in my code? Thank you!</p>