title: WPF: How to animate color change?
body: <p>I have a grid, a window root element. I want to apply an animation which would change it's background color from white to green in 5 seconds. Here's what I did: </p>
  
  <pre><code>private void Window_Loaded(object sender, RoutedEventArgs e)
  {
      ColorAnimation animation;
  
      animation = new ColorAnimation();
      animation.From = Colors.White;
      animation.To = Colors.Green;
      animation.Duration = new Duration(TimeSpan.FromSeconds(5));
      rootElement.BeginAnimation(Grid.BackgroundProperty, animation);
  }
  </code></pre>
  
  <p>The code doesn't work. Nothing is changing. Where am I making a mistake? Thanks. </p>