Rotatetransform with DoubleAnimationUsingKeyFrames (silverlight, c#)

Hi,
I have a problem with my project, I have to make a storyboard in c#

Could anybody tell me why this storyboard doesn’t work?

private void ellipse2_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
Ellipse ellipse = new Ellipse();
ellipse.Width = 40;
ellipse.Height = 40;
ellipse.Margin = new Thickness(100, 0, 0, 0);
this.LayoutRoot.Children.Add(ellipse);

        ellipse.Fill = new SolidColorBrush(Colors.Red);

        RotateTransform obroc3 = new RotateTransform();
        ellipse.RenderTransform = obroc3;
        obroc3.CenterX = 20;
        obroc3.CenterY = 115;

        SplineDoubleKeyFrame splajn1 = new SplineDoubleKeyFrame();
        splajn1.KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0));
        splajn1.Value = 0;
        
        SplineDoubleKeyFrame splajn2 = new SplineDoubleKeyFrame();
        splajn1.KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(1));
        splajn1.Value = 90;

        SplineDoubleKeyFrame splajn3 = new SplineDoubleKeyFrame();
        splajn1.KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(2));
        splajn1.Value = 180;

        SplineDoubleKeyFrame splajn4 = new SplineDoubleKeyFrame();
        splajn1.KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(3));
        splajn1.Value = 270;

        SplineDoubleKeyFrame splajn5 = new SplineDoubleKeyFrame();
        splajn1.KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(4));
        splajn1.Value = 360;

        DoubleAnimationUsingKeyFrames dable = new DoubleAnimationUsingKeyFrames();
        Storyboard.SetTarget(dable, obroc3);
        Storyboard.SetTargetProperty(dable, new PropertyPath("(UIElement.RenderTransform).(RotateTransform.Angle)"));
        dable.KeyFrames.Add(splajn1);
        dable.KeyFrames.Add(splajn2);
        dable.KeyFrames.Add(splajn3);
        dable.KeyFrames.Add(splajn4);
        dable.KeyFrames.Add(splajn5);

        Storyboard animacja2 = new Storyboard();
        animacja2.Children.Add(dable);

        animacja2.Begin();
    }

I’m losing my mind…

Please help :slight_smile: