I have the following animation
AxisAngleRotation3D rotation = (AxisAngleRotation3D)Template.FindName(rotationName, this);
DoubleAnimation angleAnimation = new DoubleAnimation();
angleAnimation.From = 0.0d;
angleAnimation.To = _currentAngle;
angleAnimation.Duration = new Duration(new TimeSpan(0, 0,3 );
rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, angleAnimation);
Is there a way to skip to the end of the animation immediately, that is effectively removing the animation once I start it using BeginAnimation() call?
Thanks!
You can remove the current animation by calling again, with null:
Use that in the case that you need to show the animation for some amount of time, and terminate it early (or ensure that it has stopped before applying another animation).
However, if all you are trying to do is rotate your UIElement without displaying an animation, then don’t use an animation at all — just set the property directly.