private static AnimationTimeline GetEasingAnimation(EasingFunction function, EasingMode mode, double from, double to, int durationMS) { AnimationTimeline returnTimeline = null; switch (function) { case EasingFunction.Quad: returnTimeline = new QuadEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Linear: returnTimeline = new LinearEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Back: returnTimeline = new BackEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Expo: returnTimeline = new ExpoEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Elastic: returnTimeline = new ElasticEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Sine: returnTimeline = new SineEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; default: break; } return(returnTimeline); }
private static AnimationTimeline GetEasingAnimation(EasingFunction function, EasingMode mode, double from, double to, int durationMS) { AnimationTimeline returnTimeline = null; switch (function) { case EasingFunction.Quad: returnTimeline = new QuadEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Linear: returnTimeline = new LinearEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Back: returnTimeline = new BackEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Expo: returnTimeline = new ExpoEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Elastic: returnTimeline = new ElasticEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; case EasingFunction.Sine: returnTimeline = new SineEasingDoubleAnimation(from, to, mode, new Duration(new TimeSpan(0, 0, 0, 0, durationMS))); break; default: break; } return returnTimeline; }