Пример #1
0
        /// <summary>
        /// Animates a <see cref="PerspexProperty"/>.
        /// </summary>
        /// <typeparam name="T">The property type.</typeparam>
        /// <param name="target">The target object.</param>
        /// <param name="property">The target property.</param>
        /// <param name="start">The value of the property at the start of the animation.</param>
        /// <param name="finish">The value of the property at the end of the animation.</param>
        /// <param name="easing">The easing function to use.</param>
        /// <param name="duration">The duration of the animation.</param>
        /// <returns>An <see cref="IDisposable"/> that can be used to stop the animation.</returns>
        public static IDisposable Property(
            PerspexObject target,
            PerspexProperty property,
            object start,
            object finish,
            IEasing easing,
            TimeSpan duration)
        {
            var o = GetTimer(duration).Select(progress => easing.Ease(progress, start, finish));

            return(target.Bind(property, o, BindingPriority.Animation));
        }