title: silverlight storyboard animation with rotatetransform code behind
body: <p>i am trying to rotate an object from code behind. Code below:</p>
  
  <pre><code>        Storyboard storyBoard = new Storyboard();
  
          //Transform
          RotateTransform rotate = new RotateTransform();
          rotate.Angle = 45;
          rotate.CenterX = 50;
          rotate.CenterY = 20;
          RodBorder.RenderTransform = rotate;
  
          DoubleAnimation Anim = new DoubleAnimation();
          Anim.Duration = new Duration(TimeSpan.FromMilliseconds(3000));
          Anim.SetValue(Storyboard.TargetPropertyProperty, rotate);
  
  
          Storyboard.SetTargetProperty(Anim, new PropertyPath("RenderTransform.Angle"));
          Storyboard.SetTarget(Anim, RodBorder);
  
          storyBoard.Children.Add(Anim);
          storyBoard.Begin();
  </code></pre>
  
  <p>RodBorder is a Border which i want to rotate. The problem here is probably the PropertyPath, because i got an exception there.(System.Windows.PropertyPath cannot be set to type System.Windows.Media.RotateTransform) Any ideas are welcome, thank you for your help.</p>