コード例 #1
0
        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)
            {
            }
        }
コード例 #2
0
 /// <summary>
 /// Pauses the animation.
 /// </summary>
 public void Pause()
 {
     _clockController.Pause();
 }
コード例 #3
0
 /// <summary>
 /// Pauses the animation.
 /// </summary>
 public void Pause()
 {
     IsPaused = true;
     _clockController.Pause();
 }