title: How do I use VisualStateManager correctly?
body: <p>my Code for changing properties does not work and I have absolutely no idea whats wrong, but maybe you do.</p>
  
  <p>Here is an simplified example of my Code, which reproduces the error.
  This is my Xaml-Code:</p>
  
  <pre><code>&lt;Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"&gt;
      &lt;Button x:Name="MyButton"
              Height="100" 
              Width="300" 
              Content="Click" 
              FontSize="40" 
              FontWeight="Bold" 
              VerticalAlignment="Center" 
              HorizontalAlignment="Center" 
              Background="Red" Click="MyButton_Click"/&gt;
  &lt;/Grid&gt;
  &lt;VisualStateManager.VisualStateGroups&gt;
      &lt;VisualStateGroup&gt;
          &lt;VisualState x:Name="Blue"&gt;
              &lt;Storyboard&gt;
                  &lt;ObjectAnimationUsingKeyFrames Storyboard.TargetName="MyButton"
                                                 Storyboard.TargetProperty="Background"&gt;
                      &lt;DiscreteObjectKeyFrame KeyTime="0" Value="Aqua"/&gt;
                  &lt;/ObjectAnimationUsingKeyFrames&gt;
              &lt;/Storyboard&gt;
          &lt;/VisualState&gt;
      &lt;/VisualStateGroup&gt;
  &lt;/VisualStateManager.VisualStateGroups&gt;
  </code></pre>
  
  <p>This is the Code-Behind:</p>
  
  <pre><code>public sealed partial class MainPage : Page
  {
      public MainPage()
      {
          this.InitializeComponent();
      }
  
      private void MyButton_Click(object sender, RoutedEventArgs e)
      {
          VisualStateManager.GoToState(this, "Blue", true);
      }
  }
  </code></pre>
  
  <p>In theory, this should change the Button-Color to "Aqua" when clicking it, but nothing happens.</p>