title: slider value to change the duration of spin using DoubleAnimation class
body: <p>I am trying to do a basic animation using the DoubleAnimation class in WPF. On a button click the rectangle spins. The cs code is</p>
  
  <pre><code>DoubleAnimation da = new DoubleAnimation();
  da.From = 0; // start from 0 to 360, full circle
  da.To = 360;
  da.Duration = new Duration(TimeSpan.FromSeconds(0.5));
  da.RepeatBehavior = RepeatBehavior.Forever;
  RotateTransform rt = new RotateTransform();
  rectangle1.RenderTransform = rt;
  rt.BeginAnimation(RotateTransform.AngleProperty, da);
  </code></pre>
  
  <p>What i am trying to do is to update the <code>da.Duration = new Duration(TimeSpan.FromSeconds(0.5))</code> value with the slider value.</p>
  
  <p>Tried with slider value binding, but not able to get this correctly.</p>