Class ExpressionAnimation
- Namespace
- Avalonia.Rendering.Composition.Animations
- Assembly
- Avalonia.Base.dll
A Composition Animation that uses a mathematical equation to calculate the value for an animating property every frame.
public sealed class ExpressionAnimation : CompositionAnimation, ICompositionAnimationBase
- Inheritance
-
ExpressionAnimation
- Implements
- Inherited Members
Remarks
The core of ExpressionAnimations allows a developer to define a mathematical equation that can be used to calculate the value of a targeted animating property each frame. This contrasts KeyFrameAnimations, which use an interpolator to define how the animating property changes over time. The mathematical equation can be defined using references to properties of Composition objects, mathematical functions and operators and Input. Use the StartAnimation(string, CompositionAnimation) method to start the animation.
Properties
Expression
The mathematical equation specifying how the animated value is calculated each frame. The Expression is the core of an ExpressionAnimation and represents the equation the system will use to calculate the value of the animation property each frame. The equation is set on this property in the form of a string. Although expressions can be defined by simple mathematical equations such as "2+2", the real power lies in creating mathematical relationships where the input values can change frame over frame.
public string? Expression { get; set; }