internal ImageAnimationController(Image image, ObjectAnimationUsingKeyFrames animation, bool autoStart) { _image = image; try { _animation = animation; _animation.Completed += AnimationCompleted; _clock = _animation.CreateClock(); _clockController = _clock.Controller; _sourceDescriptor.AddValueChanged(image, ImageSourceChanged); // ReSharper disable once PossibleNullReferenceException _clockController.Pause(); _image.ApplyAnimationClock(Image.SourceProperty, _clock); if (autoStart) { _clockController.Resume(); } } catch (Exception) { } }
/// <summary> /// Pauses the animation. /// </summary> public void Pause() { _clockController.Pause(); }
/// <summary> /// Pauses the animation. /// </summary> public void Pause() { IsPaused = true; _clockController.Pause(); }