Skip to main content

Animation settings

This section describes how Animation playback can be customized.

Easing functions​

Easing functions describe how quickly an animated property changes from its starting value into its ending value across the animation time. Avalonia.Animation.Easings contains the following easings:

Default
LinearEasing
Graph showing linear easing curve
Ease-InEase-OutEase-In-Out
SineEaseIn
Graph showing SineEaseIn curve
SineEaseOut
Graph showing SineEaseOut curve
SineEaseInOut
Graph showing SineEaseInOut curve
QuadraticEaseIn
Graph showing QuadraticEaseIn curve
QuadraticEaseOut
Graph showing QuadraticEaseOut curve
QuadraticEaseInOut
Graph showing QuadraticEaseInOut curve
CubicEaseIn
Graph showing CubicEaseIn curve
CubicEaseOut
Graph showing CubicEaseOut curve
CubicEaseInOut
Graph showing CubicEaseInOut curve
QuarticEaseIn
Graph showing QuarticEaseIn curve
QuarticEaseOut
Graph showing QuarticEaseOut curve
QuarticEaseInOut
Graph showing QuarticEaseInOut curve
QuinticEaseIn
Graph showing QuinticEaseIn curve
QuinticEaseOut
Graph showing QuinticEaseOut curve
QuinticEaseInOut
Graph showing QuinticEaseInOut curve
ExponentialEaseIn
Graph showing ExponentialEaseIn curve
ExponentialEaseOut
Graph showing ExponentialEaseOut curve
ExponentialEaseInOut
Graph showing ExponentialEaseInOut curve
CircularEaseIn
Graph showing CircularEaseIn curve
CircularEaseOut
Graph showing CircularEaseOut curve
CircularEaseInOut
Graph showing CircularEaseInOut curve
BackEaseIn
Graph showing BackEaseIn curve
BackEaseOut
Graph showing BackEaseOut curve
BackEaseInOut
Graph showing BackEaseInOut curve
ElasticEaseIn
Graph showing ElasticEaseIn curve
ElasticEaseOut
Graph showing ElasticEaseOut curve
ElasticEaseInOut
Graph showing ElasticEaseInOut curve
BounceEaseIn
Graph showing BounceEaseIn curve
BounceEaseOut
Graph showing BounceEaseOut curve
BounceEaseInOut
Graph showing BounceEaseInOut curve

Additionally, you can provide your own easing by deriving from Easing or by providing parameters to SplineEasing or SpringEasing.

Fill mode​

The FillMode attribute of an Animation defines how the animated property persists after an animation completes and during delays in between runs.

ValueDescription
NoneLast value does not persist after animation. First value is not applied if the animation is delayed.
ForwardThe last interpolated value is persisted after the animation ends.
BackwardThe first interpolated value is displayed if the animation is delayed.
BothBoth Forward and Backward behaviors are applied.

Playback direction​

PlaybackDirection defines how the Animation is played. By default, an animation plays forward, following the profile of the easing function from left to right.

ValueDescription
Normal(Default) Played forward.
ReversePlayed backward.
AlternatePlayed forward first, then backward.
AlternateReversePlayed backward first, then forward.

Playback behavior​

By default, a keyframe animation pauses when its target control is not effectively visible. When the control becomes visible again, the animation resumes from where it paused.

This behavior is intended to avoid waking the CPU to run animations the user cannot see. A control becomes effectively invisible when IsVisible is false on the control itself, or when an ancestor is hidden.

ValueDescription
Auto(Default) Animation pauses when the control is not effectively visible. Animations started with RunAsync, or containing keyframes where IsVisible="True", always play regardless of visibility.
AlwaysAnimation always plays, regardless of visibility.
OnlyIfVisibleAnimation always pauses when the control is not effectively visible, even if started with RunAsync.

Iteration count​

The IterationCount on an Animation element sets how many times it is to be replayed. There are two formats for this setting:

ValueDescription
NWhere N is an integer. Play N times. N can be zero.
infiniteRepeats forever.

See also​