Beispiel #1
0
        public static void MoveTo(this ImageAwesome image, double from, double to, TimeSpan?duration = null)
        {
            if (duration == null)
            {
                duration = new TimeSpan(0, 0, 1);
            }
            var anim = new DoubleAnimation()
            {
                Duration       = duration.Value,
                From           = from,
                To             = to,
                EasingFunction = new QuadraticEase(),
                By             = (from + to) / 2
            };

            image.BeginAnimation(ImageAwesome.SpinDurationProperty, anim);
        }