title: How can I animate the rotation of a WPF Button in XAML AND in C#?
body: <p>This is my XAML Code, the button is in a Stackpanel. 
  This doestn work with rotation! But for example with  <code>Storyboard.TargetProperty="Opacity"</code> it works. </p>
  
  <pre><code>&lt;Button Content="Button" x:Name="RotateBtn"  Style="{StaticResource rainbow}" &gt;
      &lt;Button.Triggers&gt;
          &lt;EventTrigger RoutedEvent="Button.Click"&gt;
              &lt;BeginStoryboard&gt;
                  &lt;Storyboard&gt;
                      &lt;DoubleAnimation
                          Storyboard.TargetProperty="(Button.RenderTransform).(RotateTransform.Angle)"
                          From="1" To="36" Duration="0:0:3" /&gt;
                  &lt;/Storyboard&gt;
              &lt;/BeginStoryboard&gt;
          &lt;/EventTrigger&gt;
      &lt;/Button.Triggers&gt;
  &lt;/Button&gt;
  </code></pre>
  
  <p>Other question: How can I get the same animation with C#? </p>