Class KeySpline
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
[TypeConverter(typeof(KeySplineTypeConverter))]
public sealed class KeySpline : AvaloniaObject, INotifyPropertyChanged
- Inheritance
-
KeySpline
- Implements
- Inherited Members
- Extension Methods
Constructors
KeySpline()
Create a KeySpline with X1 = Y1 = 0 and X2 = Y2 = 1.
public KeySpline()
KeySpline(double, double, double, double)
Create a KeySpline with the given parameters
public KeySpline(double x1, double y1, double x2, double y2)
Parameters
x1
doubleX coordinate for the first control point
y1
doubleY coordinate for the first control point
x2
doubleX coordinate for the second control point
y2
doubleY coordinate for the second control point
Properties
ControlPointX1
X coordinate of the first control point
public double ControlPointX1 { get; set; }
Property Value
ControlPointX2
X coordinate of the second control point
public double ControlPointX2 { get; set; }
Property Value
ControlPointY1
Y coordinate of the first control point
public double ControlPointY1 { get; set; }
Property Value
ControlPointY2
Y coordinate of the second control point
public double ControlPointY2 { get; set; }
Property Value
Methods
GetSplineProgress(double)
Calculates spline progress from a linear progress.
public double GetSplineProgress(double linearProgress)
Parameters
linearProgress
doublethe linear progress
Returns
- double
the spline progress
IsValid()
Check to see whether the KeySpline is valid by looking at its X values.
public bool IsValid()
Returns
Parse(string, CultureInfo?)
Parse a KeySpline from a string. The string needs to contain 4 values in it for the 2 control points.
public static KeySpline Parse(string value, CultureInfo? culture)
Parameters
value
stringstring with 4 values in it
culture
CultureInfoculture of the string
Returns
Exceptions
- FormatException
Thrown if the string does not have 4 values