AddChildAnimator() public méthode

Adds a child animation to be activated when the current EventToken's animation completes.
public AddChildAnimator ( IAnimator child ) : void
child IAnimator
Résultat void
        /// <summary>
        /// Executes the animation after the animation represented by the specified token.
        /// </summary>
        /// <param name="token"></param>
        /// <returns>A token representing the animation</returns>
        public virtual EventToken After(EventToken token)
        {
            if (_storyboard == null)
            {
                CreateStoryboard();
            }

            _storyboard.AutoReverse = _reverse;

            token.AddChildAnimator(this);

            if (_eventToken == null)
            {
                _eventToken = new EventToken(_animation, _storyboard);
            }
            return _eventToken;
        }
Exemple #2
0
        /// <summary>
        /// Executes the animation after a specified duration after the animation represented by the specified token.
        /// </summary>
        /// <param name="token"></param>
        /// <param name="duration"></param>
        /// <param name="timeType"></param>
        /// <returns>A token representing the animation</returns>
        public virtual EventToken After(EventToken token, double duration, OrSo timeType)
        {
            if (_storyboard == null)
            {
                CreateStoryboard();
            }

            _storyboard.AutoReverse = _reverse;

            token.AddChildAnimator(this, GetTimeSpan(duration, timeType));

            if (_eventToken == null)
            {
                _eventToken = new EventToken(_animation, _storyboard);
            }
            return(_eventToken);
        }
Exemple #3
0
        /// <summary>
        /// Executes the animation after the animation represented by the specified token.
        /// </summary>
        /// <param name="token"></param>
        /// <returns>A token representing the animation</returns>
        public virtual EventToken After(EventToken token)
        {
            if (_storyboard == null)
            {
                CreateStoryboard();
            }

            _storyboard.AutoReverse = _reverse;

            token.AddChildAnimator(this);

            if (_eventToken == null)
            {
                _eventToken = new EventToken(_animation, _storyboard);
            }
            return(_eventToken);
        }
Exemple #4
0
        /// <summary>
        /// Passes on child animations to the specified successor.
        ///
        /// The current EventToken's child animations are activated by the
        /// successor's completion events.
        ///
        /// Used in conjunction with EventToken.PlaceHolderToken for creating
        /// animations out of order.
        /// </summary>
        /// <param name="successor"></param>
        /// <returns></returns>
        public EventToken PassOn(EventToken successor)
        {
            // Unregister for the predecessor's completion events
            if (_Animation != null)
            {
                _Animation.Completed -= AnimationEventHandler;
            }

            // Hand off the children to the successor
            if (_Children != null)
            {
                foreach (IAnimator anim in _Children.Keys)
                {
                    successor.AddChildAnimator(anim, _Children[anim]);
                }

                _Children.Clear();
            }

            return(successor);
        }
        /// <summary>
        /// Executes the animation after a specified duration after the animation represented by the specified token.
        /// </summary>
        /// <param name="token"></param>
        /// <param name="duration"></param>
        /// <param name="timeType"></param>
        /// <returns>A token representing the animation</returns>
        public virtual EventToken After(EventToken token, double duration, OrSo timeType)
        {
            if (_storyboard == null)
            {
                CreateStoryboard();
            }

            _storyboard.AutoReverse = _reverse;

            token.AddChildAnimator(this, GetTimeSpan(duration, timeType));

            if (_eventToken == null)
            {
                _eventToken = new EventToken(_animation, _storyboard);
            }
            return _eventToken;
        }
Exemple #6
0
        /// <summary>
        /// Passes on child animations to the specified successor.
        ///
        /// The current EventToken's child animations are activated by the
        /// successor's completion events.
        ///
        /// Used in conjunction with EventToken.PlaceHolderToken for creating
        /// animations out of order.
        /// </summary>
        /// <param name="successor"></param>
        /// <returns></returns>
        public EventToken PassOn(EventToken successor)
        {
            // Unregister for the predecessor's completion events
            if (_Animation != null)
            {
                _Animation.Completed -= AnimationEventHandler;
            }

            // Hand off the children to the successor
            if (_Children != null)
            {
                foreach (IAnimator anim in _Children.Keys)
                {
                    successor.AddChildAnimator(anim, _Children[anim]);
                }

                _Children.Clear();
            }

            return successor;
        }