public static void AnimatePropertyTo <T, R, AT>(this T element, Expression <Func <T, R> > p, R finalValue, double duration, bool autoReverse)
            where T : IAnimatable
            where AT : AnimationTimeline
        {
            AnimationTimeline animation = (AnimationTimeline)Activator.CreateInstance(typeof(AT));

            if (animation == null)
            {
                return;
            }

            var prop         = (p.Body as MemberExpression).Member.Name;
            var currentValue = p.Compile()(element);

            DependencyPropertyDescriptor dFrom = DependencyPropertyDescriptor.FromName("From", animation.GetType(), animation.GetType());

            animation.SetValue(dFrom.DependencyProperty, currentValue);

            DependencyPropertyDescriptor dTo = DependencyPropertyDescriptor.FromName("To", animation.GetType(), animation.GetType());

            animation.SetValue(dTo.DependencyProperty, finalValue);

            animation.Duration    = new Duration(TimeSpan.FromSeconds(duration));
            animation.AutoReverse = autoReverse;

            DependencyPropertyDescriptor d = DependencyPropertyDescriptor.FromName(prop, typeof(T), typeof(T));

            element.BeginAnimation(d.DependencyProperty, null);
            element.BeginAnimation(d.DependencyProperty, animation);
        }