title: WPF Set value by trigger when using binding
body: <p>Why will not this work:</p>
  
  <pre><code>    &lt;Button Width="200" Height="50"&gt;
      &lt;Button.Style&gt;
      &lt;Style TargetType="Button"&gt;
          &lt;Setter Property="Height" Value="{Binding RelativeSource={RelativeSource Self}, Path=Height}"/&gt;
          &lt;Setter Property="Background" Value="Blue"/&gt;
          &lt;Style.Triggers&gt;
                  &lt;Trigger Property="Button.IsPressed" Value="true"&gt;
                      &lt;Setter Property="Background" Value="green"/&gt;
                      &lt;Setter Property="Height" Value="20"/&gt;
                  &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
      &lt;/Button.Style&gt;
  
  &lt;Button.Template&gt;
      &lt;ControlTemplate&gt;
          &lt;Canvas x:Name="MainCanvas" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"&gt;
              &lt;Border 
              Width="{TemplateBinding Width}"  Height="{TemplateBinding Height}"
                        x:Name="Border"  
                        CornerRadius="2" 
                        BorderThickness="1"
                        Background="{TemplateBinding Background}"
                        BorderBrush="black"&gt;
                 &lt;ContentPresenter 
                   Margin="2"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   RecognizesAccessKey="True"/&gt;
               &lt;/Border&gt;
          &lt;/Canvas&gt;
      &lt;/ControlTemplate&gt;
  &lt;/Button.Template&gt;
  Hello
  &lt;/Button&gt;
  </code></pre>
  
  <p>Like this:</p>
  
  <pre><code>&lt;Button Width="200" &gt;
  &lt;Button.Style&gt;
      &lt;Style TargetType="Button"&gt;
          &lt;Setter Property="Height" Value="50"/&gt;
          &lt;Setter Property="Background" Value="Blue"/&gt;
          &lt;Style.Triggers&gt;
                  &lt;Trigger Property="Button.IsPressed" Value="true"&gt;
                      &lt;Setter Property="Background" Value="green"/&gt;
                      &lt;Setter Property="Height" Value="20"/&gt;
                  &lt;/Trigger&gt;
          &lt;/Style.Triggers&gt;
      &lt;/Style&gt;
  &lt;/Button.Style&gt;
  &lt;Button.Template&gt;
      &lt;ControlTemplate&gt;
          &lt;Canvas x:Name="MainCanvas" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"&gt;
              &lt;Border 
              Width="{TemplateBinding Width}"  Height="{TemplateBinding Height}"
                        x:Name="Border"  
                        CornerRadius="2" 
                        BorderThickness="1"
                        Background="{TemplateBinding Background}"
                        BorderBrush="black"&gt;
                 &lt;ContentPresenter 
                   Margin="2"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   RecognizesAccessKey="True"/&gt;
               &lt;/Border&gt;
          &lt;/Canvas&gt;
      &lt;/ControlTemplate&gt;
  &lt;/Button.Template&gt;
  Hello
  &lt;/Button&gt;  
  </code></pre>
  
  <p>I want the button to shrink when I press it. This is a prototype for a custom control so the Style will be lift out to a Generics.xmal files later on. And why does it not show the 'Hello' string on the Button???</p>