Beispiel #1
0
        private static T CreateExpressionAnimation <T>(this AnimationGroup group, FrameworkElement element, AnimationSettings settings, string expression, bool isFrom = false)
            where T : ExpressionAnimationBase, new()
        {
            var animation = new T()
            {
                Expression = expression,
                Settings   = settings
            };

            group.Add(element, animation, isFrom);

            return(animation);
        }
Beispiel #2
0
        // TODO: If not used anymore, remove it (or simply keep for any future need?)
        private static T CreateVectorAnimation <T>(this AnimationGroup group, FrameworkElement element, AnimationSettings settings, Vector3 to, double duration = AnimationSettings.DEFAULT_DURATION, bool isFrom = false)
            where T : VectorAnimationBase, new()
        {
            var animation = new T()
            {
                To       = to,
                Duration = duration,
                Settings = settings
            };

            group.Add(element, animation, isFrom);

            return(animation);
        }
Beispiel #3
0
        private static TAnimation CreateEffectAnimation <TAnimation, TValue>(this AnimationGroup group, FrameworkElement element, AnimationSettings settings, TValue to, double duration = AnimationSettings.DEFAULT_DURATION, bool isFrom = false)
            where TAnimation : EffectAnimationBase <TValue>, new()
        {
            var animation = new TAnimation()
            {
                To       = to,
                Duration = duration,
                Settings = settings
            };

            group.Add(element, animation, isFrom);

            return(animation);
        }
Beispiel #4
0
        private static T CreateScalarAnimation <T>(this AnimationGroup group, FrameworkElement element, AnimationSettings settings, double to = 1, double duration = -1, bool isFrom = false)
            where T : ScalarAnimationBase, new()
        {
            var animation = new T()
            {
                To       = to,
                Duration = duration == -1
                                        ? DefaultSettings.Duration
                                        : duration,
                Settings = settings
            };

            group.Add(element, animation, isFrom);

            return(animation);
        }