Skip to main content

KeyFrameAnimation Class

Definition

Assembly:Avalonia.Base
Package:Avalonia

A time-based animation with one or more key frames. These frames are markers, allowing developers to specify values at specific times for the animating property. KeyFrame animations can be further customized by specifying how the animation interpolates between keyframes.

public class KeyFrameAnimation

Methods

NameDescription
InsertExpressionKeyFrameInserts an expression keyframe.
ClearAllParametersClears all of the parameters of the animation. Inherited from CompositionAnimation.
ClearParameterClears a parameter from the animation. Inherited from CompositionAnimation.
SetColorParameterInherited from CompositionAnimation.
SetMatrix3x2ParameterInherited from CompositionAnimation.
SetMatrix4x4ParameterInherited from CompositionAnimation.
SetQuaternionParameterInherited from CompositionAnimation.
SetReferenceParameterInherited from CompositionAnimation.
SetScalarParameterInherited from CompositionAnimation.
SetVector2ParameterInherited from CompositionAnimation.
SetVector3ParameterInherited from CompositionAnimation.
SetVector4ParameterInherited from CompositionAnimation.
StartAnimationConnects an animation with the specified property of the object and starts the animation. Inherited from CompositionObject.
StartAnimationGroupStarts an animation group. The StartAnimationGroup method on CompositionObject lets you start CompositionAnimationGroup. All the animations in the group will be started at the same time on the object. Inherited from CompositionObject.
StopAnimationDisconnects an animation from the specified property and stops the animation. Inherited from CompositionObject.
StopAnimationGroupStops an animation group. Inherited from CompositionObject.

InsertExpressionKeyFrame Method

Inserts an expression keyframe.

public void InsertExpressionKeyFrame(float normalizedProgressKey, string value, Avalonia.Animation.Easings.Easing easingFunction)

Parameters

normalizedProgressKey float

The time the key frame should occur at, expressed as a percentage of the animation Duration. Allowed value is from 0.0 to 1.0.

value string

The expression used to calculate the value of the key frame.

easingFunction Avalonia.Animation.Easings.Easing

The easing function to use when interpolating between frames.

Properties

NameDescription
DelayBehaviorThe delay behavior of the key frame animation.
DelayTimeDelay before the animation starts after Avalonia.Rendering.Composition.CompositionObject.StartAnimation(string,Avalonia.Rendering.Composition.Animations.CompositionAnimation) is called.
DirectionThe direction the animation is playing. The Direction property allows you to drive your animation from start to end or end to start or alternate between start and end or end to start if animation has an Avalonia.Rendering.Composition.Animations.KeyFrameAnimation.IterationCount greater than one. This gives an easy way for customizing animation definitions.
DurationThe duration of the animation. Minimum allowed value is 1ms and maximum allowed value is 24 days.
IterationBehaviorThe iteration behavior for the key frame animation.
IterationCountThe number of times to repeat the key frame animation.
StopBehaviorSpecifies how to set the property value when animation is stopped
TargetInherited from CompositionAnimation.
CompositorThe associated Compositor Inherited from CompositionObject.
ImplicitAnimationsThe collection of implicit animations attached to this object. Inherited from CompositionObject.
IsDisposedInherited from CompositionObject.

DelayBehavior Property

The delay behavior of the key frame animation.

public Avalonia.Rendering.Composition.Animations.AnimationDelayBehavior DelayBehavior { get; set; }

DelayTime Property

Delay before the animation starts after Avalonia.Rendering.Composition.CompositionObject.StartAnimation(string,Avalonia.Rendering.Composition.Animations.CompositionAnimation) is called.

public TimeSpan DelayTime { get; set; }

Direction Property

The direction the animation is playing. The Direction property allows you to drive your animation from start to end or end to start or alternate between start and end or end to start if animation has an Avalonia.Rendering.Composition.Animations.KeyFrameAnimation.IterationCount greater than one. This gives an easy way for customizing animation definitions.

public Avalonia.Animation.PlaybackDirection Direction { get; set; }

Duration Property

The duration of the animation. Minimum allowed value is 1ms and maximum allowed value is 24 days.

public TimeSpan Duration { get; set; }

IterationBehavior Property

The iteration behavior for the key frame animation.

public Avalonia.Rendering.Composition.Animations.AnimationIterationBehavior IterationBehavior { get; set; }

IterationCount Property

The number of times to repeat the key frame animation.

public int IterationCount { get; set; }

StopBehavior Property

Specifies how to set the property value when animation is stopped

public Avalonia.Rendering.Composition.Animations.AnimationStopBehavior StopBehavior { get; set; }