Beispiel #1
0
        /// <summary>
        /// Runs the KeyFrames Animation.
        /// </summary>
        private IDisposable RunKeyFrames(Animation animation, Animatable control, IClock clock, Action onComplete)
        {
            var instance = new AnimationInstance <T>(
                animation,
                control,
                this,
                clock ?? control.Clock ?? Clock.GlobalClock,
                onComplete,
                DoInterpolation);

            return(control.Bind <T>((AvaloniaProperty <T>)Property, instance, BindingPriority.Animation));
        }
        /// <inheritdocs/>
        public virtual IDisposable Apply(Animatable control, IClock clock, object oldValue, object newValue)
        {
            var transition = DoTransition(new TransitionInstance(clock, Delay, Duration), (T)oldValue, (T)newValue);

            return(control.Bind <T>((AvaloniaProperty <T>)Property, transition, Data.BindingPriority.Animation));
        }
Beispiel #3
0
        /// <inheritdocs/>
        public virtual IDisposable Apply(Animatable control, object oldValue, object newValue)
        {
            var transition = DoTransition(Timing.GetTransitionsTimer(control, Duration, TimeSpan.Zero), (T)oldValue, (T)newValue).Select(p => (object)p);

            return(control.Bind(Property, transition, Data.BindingPriority.Animation));
        }