コード例 #1
0
        private static void ApplyAnimation(this FrameworkElement element, AnimationSettings settings, Color from, Color to, string targetProperty, ref Storyboard storyboard)
        {
            var anim = new ColorAnimation()
            {
                From           = from,
                To             = to,
                Duration       = new Duration(TimeSpan.FromMilliseconds(settings.Duration)),
                BeginTime      = TimeSpan.FromMilliseconds(settings.Delay),
                EasingFunction = settings.GetEase()
            };

            element.ApplyAnimationCore(anim, settings, from.ToString(), to.ToString(), targetProperty, ref storyboard);
        }