using System; using Avalonia.Reactive; using Avalonia.VisualTree; namespace Avalonia.Media { /// /// Transforms an according to a . /// public class MatrixTransform : Transform { /// /// Defines the property. /// public static readonly StyledProperty MatrixProperty = AvaloniaProperty.Register(nameof(Matrix), Matrix.Identity); /// /// Initializes a new instance of the class. /// public MatrixTransform() { this.GetObservable(MatrixProperty).Subscribe(_ => RaiseChanged()); } /// /// Initializes a new instance of the class. /// /// The matrix. public MatrixTransform(Matrix matrix) : this() { Matrix = matrix; } /// /// Gets or sets the matrix. /// public Matrix Matrix { get { return GetValue(MatrixProperty); } set { SetValue(MatrixProperty, value); } } /// /// Gets the matrix. /// public override Matrix Value => Matrix; } }