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); }
// 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); }
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); }
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); }