Exemplo n.º 1
0
        public void Spin()
        {
            Front.InvalidateVisual();
            Back.InvalidateVisual();
            //DoubleAnimation rotationAnimation = new DoubleAnimation(FrontVisible ? 0 : 180, new Duration(TimeSpan.FromSeconds(SpinTime)));
            DoubleAnimation rotationAnimation = new DoubleAnimation(rotation.Angle - 180, new Duration(TimeSpan.FromSeconds(SpinTime)));

            rotationAnimation.Completed += new EventHandler(rotationAnimation_Completed);
            rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, rotationAnimation);

            //DoubleAnimationUsingKeyFrames translationAnimation = new DoubleAnimationUsingKeyFrames();
            //translationAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(-0.5, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(SpinTime / 2.0)), new SineEase()));
            //translationAnimation.KeyFrames.Add(new EasingDoubleKeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(SpinTime)), new SineEase { EasingMode = EasingMode.EaseIn }));
            //translation.BeginAnimation(TranslateTransform3D.OffsetZProperty, translationAnimation);
        }