Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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;
        }