Play() публичный Метод

Schedules the animation to be played.
public Play ( FrameworkElement associatedElement ) : void
associatedElement System.Windows.FrameworkElement The element to use to control the animation.
Результат void
Пример #1
0
        /// <summary>
        /// Indicates that the effect should start playing.
        /// </summary>
        /// <param name="direction">Indicates whether to play the direction in forward direction or reverse direction.</param>
        public void PlayEffect(EffectDirection direction)
        {
            if (_animation != null)
            {
                _animation.Stopped -= OnAnimationStopped;
                if (_animation.IsPlaying)
                {
                    _animation.Stop(ProceduralAnimationStopState.Complete);
                }
                _animation = null;
            }

            if ((direction == EffectDirection.Reverse) && (AutoReverse || (Reversible == false)))
            {
                direction = EffectDirection.Forward;
            }
            if (_reversed)
            {
                direction = (direction == EffectDirection.Forward) ? EffectDirection.Reverse : EffectDirection.Forward;
            }

            _animation = CreateEffectAnimation(direction);
            if (_animation != null)
            {
                _direction          = direction;
                _animation.Stopped += OnAnimationStopped;

                OnStarting();
                _animation.Play(AssociatedObject);
            }
        }
Пример #2
0
        /// <summary>
        /// Indicates that the effect should start playing.
        /// </summary>
        /// <param name="direction">Indicates whether to play the direction in forward direction or reverse direction.</param>
        public void PlayEffect(AnimationEffectDirection direction)
        {
            if (_animation != null) {
                _animation.Stopped -= OnAnimationStopped;
                if (_animation.IsPlaying) {
                    _animation.Stop(ProceduralAnimationStopState.Complete);
                }
                _animation = null;
            }

            if ((direction == AnimationEffectDirection.Reverse) && (AutoReverse || (Reversible == false))) {
                direction = AnimationEffectDirection.Forward;
            }
            if (_reversed) {
                direction = (direction == AnimationEffectDirection.Forward) ? AnimationEffectDirection.Reverse :
                                                                              AnimationEffectDirection.Forward;
            }

            _animation = CreateEffectAnimation(direction);
            if (_animation != null) {
                _direction = direction;
                _animation.Stopped += OnAnimationStopped;

                OnStarting();
                _animation.Play(AssociatedObject);
            }
        }
Пример #3
0
        /// <summary>
        /// Plays the current layout animation when an arrange pass is completed.
        /// </summary>
        protected void EndArrange()
        {
            if ((_animations != null) && (_animations.Count != 0)) {
                _layoutAnimation = new ProceduralAnimationSet(_animations.ToArray());
                _layoutAnimation.Play(this);
            }

            _animations = null;
        }