public static void LogAnimation(int beginValue, int endValue, int duration, AnimationFunc scene) { using (Animation a = new Animation()) { a.Mode = AnimationMode.Log; a.Acceleration = 0.05f; a.BeginValue = beginValue; a.EndValue = endValue; a.Duration = duration; a.Scene += new EventHandler<AnimationEventArgs>(scene); a.StartModal(); } }
public static Animation AsyncLogAnimation(int beginValue, int endValue, int duration, AnimationFunc scene, CompletedFunc completed, object data) { Animation a = new Animation(); a.Mode = AnimationMode.Log; a.Acceleration = 0.05f; a.BeginValue = beginValue; a.EndValue = endValue; a.Duration = duration; a.Data = data; if (completed != null) a.Completed += new EventHandler(completed); a.Scene += new EventHandler<AnimationEventArgs>(scene); a.Start(); return a; }
Animation EnsureAnimation() { if (animation == null) { animation = new Animation(); animation.Scene += new EventHandler<AnimationEventArgs>(animation_Scene); animation.Started += new EventHandler(animation_Started); //animation.Mode = AnimationMode.Log; //animation.Acceleration = 0.05f; animation.Mode = AnimationMode.Accelerated; animation.Acceleration = -3.3f; animation.Completed += new EventHandler(animation_Completed); } return animation; }
protected virtual void OnTransitionCompleted(Animation a) { if (TransitionCompleted != null) { TransitionCompleted(this, a.eventArgs); } }
private Animation EnsureTopAnimation() { if (topAnimation == null) { topAnimation = new Animation(); topAnimation.Mode = AnimationMode.Log; topAnimation.Acceleration = 0.05f; topAnimation.Completed += new EventHandler(OnAnimationCompleted); topAnimation.Scene += new EventHandler<AnimationEventArgs>(OnAnimationScene); topAnimation.Started += new EventHandler(OnAnimationStarted); } return topAnimation; }
private Animation EnsureAlphaAnimation() { if (alphaAnimation == null) { alphaAnimation = new Animation(); alphaAnimation.Mode = AnimationMode.Log; alphaAnimation.Acceleration = 0.05f; alphaAnimation.Completed += new EventHandler(OnAnimationCompleted); alphaAnimation.Scene += new EventHandler<AnimationEventArgs>(AlphaAnimationScene); alphaAnimation.Started += new EventHandler(OnAnimationStarted); } return alphaAnimation; }
public AnimationEventArgs(Animation storyboard) : base() { this.storyboard = storyboard; }
/// <summary> /// Animates TopOFfsewt to the specified position. /// </summary> /// <param name="pos"></param> private void AnimateTopOffset(int pos, int duration, AnimationMode mode) { if (scrollAnimation == null) { scrollAnimation = new Animation(250, TopOffset, 0); scrollAnimation.Scene += new EventHandler<AnimationEventArgs>(scrollAnimation_Scene); scrollAnimation.Interval = 40; // set to 25 pictures per seconds. } StopAutoScroll(); scrollAnimation.Mode = mode; switch (mode) { case AnimationMode.Log: scrollAnimation.Acceleration = 0.05f; break; case AnimationMode.Accelerated: scrollAnimation.Acceleration = -5f; break; } scrollAnimation.Duration = duration; scrollAnimation.BeginValue = TopOffset; scrollAnimation.EndValue = pos; scrollAnimation.Start(); }