3using System.Threading.Tasks;
4using Microsoft.Maui.Controls;
20 if (Duration < TimeSpan.Zero)
21 throw new ArgumentOutOfRangeException(nameof(Duration),
"Duration cannot be negative.");
22 this.BaseDuration = Duration;
23 this.Easing =
Easing ??
throw new ArgumentNullException(nameof(
Easing));
47 if (Options?.DurationOverride is TimeSpan Override)
50 double Scale = Context.DurationScale <= 0 ? 1 : Context.
DurationScale;
51 double Milliseconds = this.BaseDuration.TotalMilliseconds * Scale;
54 return TimeSpan.FromMilliseconds(Milliseconds);
66 double Milliseconds = Math.Round(Duration.TotalMilliseconds);
69 return (uint)Milliseconds;
Options applied for an individual animation execution.
Base class providing timing helpers for view animations.
TimedViewAnimation(TimeSpan Duration, Easing Easing)
Initializes a new instance of the TimedViewAnimation class.
uint ResolveDurationMilliseconds(IAnimationContext Context, AnimationOptions? Options)
Resolves the duration expressed in milliseconds.
TimeSpan BaseDuration
Gets the base duration.
abstract Task RunAsync(VisualElement Target, IAnimationContext Context, AnimationOptions? Options, CancellationToken Token)
Executes the animation against the specified target. Task tracking execution.
Easing Easing
Gets the base easing.
TimeSpan ResolveDuration(IAnimationContext Context, AnimationOptions? Options)
Resolves the effective duration, respecting overrides and duration scale.
Represents contextual information required when executing an animation.
double DurationScale
Gets the multiplier applied to animation durations.
Defines a view-based animation executor.