This class manages the set of active animations and is responsible for scheduling them, and executing them from start to finish.
        public static ProceduralAnimationController Play(ProceduralAnimation animation, FrameworkElement associatedElement)
        {
            ProceduralAnimationController controller = GetAnimationController(associatedElement);

            controller.PlayCore(animation);

            return(controller);
        }
        private static ProceduralAnimationController GetAnimationController(FrameworkElement fe)
        {
            ProceduralAnimationController controller = (ProceduralAnimationController)fe.GetValue(AnimationControllerProperty);

            if (controller == null)
            {
                controller = new ProceduralAnimationController(fe);
                fe.SetValue(AnimationControllerProperty, controller);
            }

            return(controller);
        }
Exemplo n.º 3
0
 /// <summary>
 /// Stops playing the animation mid-way. The specified stopState determines
 /// the state in which the element being animated is left in.
 /// </summary>
 /// <param name="stopState">The state of the element upon stopping the animation.</param>
 public void Stop(ProceduralAnimationStopState stopState)
 {
     ProceduralAnimationController.Stop(this, stopState);
     _controller = null;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Schedules the animation to be played.
 /// </summary>
 /// <param name="associatedElement">The element to use to control the animation.</param>
 public void Play(FrameworkElement associatedElement)
 {
     _completed  = false;
     _controller = ProceduralAnimationController.Play(this, associatedElement);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Stops playing the animation mid-way. The specified stopState determines
 /// the state in which the element being animated is left in. 
 /// </summary>
 /// <param name="stopState">The state of the element upon stopping the animation.</param>
 public void Stop(ProceduralAnimationStopState stopState)
 {
     ProceduralAnimationController.Stop(this, stopState);
     _controller = null;
 }
Exemplo n.º 6
0
 /// <summary>
 /// Schedules the animation to be played.
 /// </summary>
 /// <param name="associatedElement">The element to use to control the animation.</param>
 public void Play(FrameworkElement associatedElement)
 {
     _completed = false;
     _controller = ProceduralAnimationController.Play(this, associatedElement);
 }
        private static ProceduralAnimationController GetAnimationController(FrameworkElement fe)
        {
            ProceduralAnimationController controller = (ProceduralAnimationController)fe.GetValue(AnimationControllerProperty);
            if (controller == null) {
                controller = new ProceduralAnimationController(fe);
                fe.SetValue(AnimationControllerProperty, controller);
            }

            return controller;
        }