title: Swapping Colors in Button-Template on pressed
body: <p>I am trying to design a button-template, that swaps its colors, when pressed.</p>
  
  <p>Unluckily I cant get it to work.</p>
  
  <p>I am using the BorderBrush as a temporary variable. Most likely there are more sophisticated solutions possible. </p>
  
  <p>Here is my code.</p>
  
  <pre><code>    &lt;Style TargetType="{x:Type Button}"&gt;
          &lt;Style.Setters&gt;
              &lt;Setter Property="Foreground"
                      Value="{StaticResource RahmenFarbe}" /&gt;
              &lt;Setter Property="Background"
                      Value="{StaticResource HintergrundFarbe}" /&gt;
              &lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type Button}"&gt;
                          &lt;Grid Width="{TemplateBinding Width}"
                                Height="{TemplateBinding Height}"
                                ClipToBounds="True"&gt;
                              &lt;Border BorderBrush="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button, AncestorLevel=1}, Path=Foreground}"
                                      x:Name="ButtonBorder"
                                      CornerRadius="25"
                                      BorderThickness="4"
                                      Background="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button, AncestorLevel=1}, Path=Background}"
                                      RenderTransformOrigin="0.5,0.5"&gt;
                                  &lt;TextBlock  x:Name="ButtonTextBlock"
                                              Foreground="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=Button, AncestorLevel=1}, Path=Foreground}"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="Center"&gt;
                                  &lt;ContentPresenter x:Name="myContentPresenter"
                                                    Content="{TemplateBinding Content}" /&gt;
                                  &lt;/TextBlock&gt;
                              &lt;/Border&gt;
                          &lt;/Grid&gt;
                          &lt;ControlTemplate.Triggers&gt;
                              &lt;Trigger Property="IsPressed"
                                       Value="True"&gt;
                                  &lt;Setter Property="BorderBrush"
                                          Value="{Binding Mode=OneTime, Path=Foreground}" /&gt;
                                  &lt;Setter Property="Foreground"
                                          Value="{Binding Mode=OneTime, Path=Background}" /&gt;
                                  &lt;Setter Property="Background"
                                          Value="{Binding Mode=OneTime, Path=BorderBrush}" /&gt;
                              &lt;/Trigger&gt;
                          &lt;/ControlTemplate.Triggers &gt;
  
                      &lt;/ControlTemplate&gt;
                  &lt;/Setter.Value&gt;
              &lt;/Setter&gt;
          &lt;/Style.Setters&gt;
      &lt;/Style&gt;
  </code></pre>
  
  <p>Any help would be appreciated.</p>
  
  <p>Regards Sebastian</p>