KeySpline Class
Definition
Determines how an animation is used based on a cubic bezier curve. X1 and X2 must be between 0.0 and 1.0, inclusive. See https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.animation.keyspline
public class KeySpline
Constructors
| Name | Description |
|---|---|
| KeySpline (2 overloads) | Create a Avalonia.Animation.KeySpline with X1 = Y1 = 0 and X2 = Y2 = 1. |
KeySpline overloads
KeySpline Constructor
Create a Avalonia.Animation.KeySpline with X1 = Y1 = 0 and X2 = Y2 = 1.
public KeySpline()
KeySpline Constructor
Create a Avalonia.Animation.KeySpline with the given parameters
public KeySpline(double x1, double y1, double x2, double y2)
Parameters
x1 double
X coordinate for the first control point
y1 double
Y coordinate for the first control point
x2 double
X coordinate for the second control point
y2 double
Y coordinate for the second control point
Methods
| Name | Description |
|---|---|
| GetSplineProgress | Calculates spline progress from a linear progress. |
| IsValid | Check to see whether the Avalonia.Animation.KeySpline is valid by looking at its X values. |
| Parse | Parse a Avalonia.Animation.KeySpline from a string. The string needs to contain 4 values in it for the 2 control points. |
| Bind (8 overloads) | Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject. |
| CheckAccess | Returns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject. |
| ClearValue (4 overloads) | Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject. |
| CoerceValue | Coerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject. |
| Equals | Compares two objects using reference equality. Inherited from AvaloniaObject. |
| GetBaseValue | Inherited from AvaloniaObject. |
| GetHashCode | Gets the hash code for the object. Inherited from AvaloniaObject. |
| GetValue (3 overloads) | Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| IsAnimating | Checks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject. |
| IsSet | Checks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject. |
| SetCurrentValue (2 overloads) | Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject. |
| SetValue (3 overloads) | Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject. |
| VerifyAccess | Checks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject. |
GetSplineProgress Method
Calculates spline progress from a linear progress.
public double GetSplineProgress(double linearProgress)
Parameters
linearProgress double
the linear progress
Returns
double
the spline progress
IsValid Method
Check to see whether the Avalonia.Animation.KeySpline is valid by looking at its X values.
public bool IsValid()
Returns
bool
true if the X values for this Avalonia.Animation.KeySpline fall in acceptable range; false otherwise.
Parse Method
Parse a Avalonia.Animation.KeySpline from a string. The string needs to contain 4 values in it for the 2 control points.
public Avalonia.Animation.KeySpline Parse(string value, System.Globalization.CultureInfo culture)
Parameters
value string
string with 4 values in it
culture System.Globalization.CultureInfo
culture of the string
Returns
A Avalonia.Animation.KeySpline with the appropriate values set
Exceptions
Properties
| Name | Description |
|---|---|
| ControlPointX1 | X coordinate of the first control point |
| ControlPointX2 | X coordinate of the second control point |
| ControlPointY1 | Y coordinate of the first control point |
| ControlPointY2 | Y coordinate of the second control point |
| Dispatcher | Returns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject. |
| Item | Inherited from AvaloniaObject. |
ControlPointX1 Property
X coordinate of the first control point
public double ControlPointX1 { get; set; }
ControlPointX2 Property
X coordinate of the second control point
public double ControlPointX2 { get; set; }
ControlPointY1 Property
Y coordinate of the first control point
public double ControlPointY1 { get; set; }
ControlPointY2 Property
Y coordinate of the second control point
public double ControlPointY2 { get; set; }
Events
| Name | Description |
|---|---|
| PropertyChanged | Raised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject. |