Esempio n. 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)
            {
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Pauses the animation.
 /// </summary>
 public void Pause()
 {
     _clockController.Pause();
 }
 /// <summary>
 /// Pauses the animation.
 /// </summary>
 public void Pause()
 {
     IsPaused = true;
     _clockController.Pause();
 }