KeyFrameAnimation Class
Definition
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
| Name | Description |
|---|---|
| InsertExpressionKeyFrame | Inserts an expression keyframe. |
| ClearAllParameters | Clears all of the parameters of the animation. Inherited from CompositionAnimation. |
| ClearParameter | Clears a parameter from the animation. Inherited from CompositionAnimation. |
| SetColorParameter | Inherited from CompositionAnimation. |
| SetMatrix3x2Parameter | Inherited from CompositionAnimation. |
| SetMatrix4x4Parameter | Inherited from CompositionAnimation. |
| SetQuaternionParameter | Inherited from CompositionAnimation. |
| SetReferenceParameter | Inherited from CompositionAnimation. |
| SetScalarParameter | Inherited from CompositionAnimation. |
| SetVector2Parameter | Inherited from CompositionAnimation. |
| SetVector3Parameter | Inherited from CompositionAnimation. |
| SetVector4Parameter | Inherited from CompositionAnimation. |
| StartAnimation | Connects an animation with the specified property of the object and starts the animation. Inherited from CompositionObject. |
| StartAnimationGroup | Starts 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. |
| StopAnimation | Disconnects an animation from the specified property and stops the animation. Inherited from CompositionObject. |
| StopAnimationGroup | Stops 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
| Name | Description |
|---|---|
| DelayBehavior | The delay behavior of the key frame animation. |
| DelayTime | Delay before the animation starts after Avalonia.Rendering.Composition.CompositionObject.StartAnimation(string,Avalonia.Rendering.Composition.Animations.CompositionAnimation) is called. |
| Direction | 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. |
| Duration | The duration of the animation. Minimum allowed value is 1ms and maximum allowed value is 24 days. |
| IterationBehavior | The iteration behavior for the key frame animation. |
| IterationCount | The number of times to repeat the key frame animation. |
| StopBehavior | Specifies how to set the property value when animation is stopped |
| Target | Inherited from CompositionAnimation. |
| Compositor | The associated Compositor Inherited from CompositionObject. |
| ImplicitAnimations | The collection of implicit animations attached to this object. Inherited from CompositionObject. |
| IsDisposed | Inherited 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; }