title: Brush to Brush Animation
body: <p>I managed to find out how to make a WPF animation - transition between two colors.</p>
  
  <p>It's called ColorAnimation and works well.</p>
  
  <pre><code>ColorAnimation animation = new ColorAnimation
  {
      From = Colors.DarkGreen,
      To = Colors.Transparent,
      Duration = new Duration(TimeSpan.FromSeconds(1.5)),
      AutoReverse = false
  };
  animation.Completed += new EventHandler(animation_Completed);
  SolidColorBrush brush = new SolidColorBrush(Colors.Transparent);
  animation.AccelerationRatio = 0.5;
  
  Background = brush;
  brush.BeginAnimation(SolidColorBrush.ColorProperty, animation);
  </code></pre>
  
  <p>I am using this to animate background of my usercontrol. My controls background is <code>SolidColorBrush</code>. Recently I changed to <code>LinearGradientBrush</code>. Now I can use my animation no more.</p>
  
  <p>I need animation from brush to brush, not color to color. And best option is  Abstract brush type, which includes SolidColor, LinearGradient etc, so I can animate for example from <code>SolidColorBrush</code> to <code>LinearGradientBrush</code>. Is that even possible? Thank you.</p>