// -----------------------------------------------------------------------
//
// Copyright 2015 MIT Licence. See licence.md for more information.
//
// -----------------------------------------------------------------------
namespace Perspex.Media
{
using System;
///
/// Transforms an according to a .
///
public class MatrixTransform : Transform
{
///
/// Defines the property.
///
public static readonly PerspexProperty MatrixProperty =
PerspexProperty.Register("Matrix", Matrix.Identity);
///
/// Initializes a new instance of the class.
///
public MatrixTransform()
{
this.GetObservable(MatrixProperty).Subscribe(_ => this.RaiseChanged());
}
///
/// Initializes a new instance of the class.
///
/// The matrix.
public MatrixTransform(Matrix matrix)
: this()
{
this.Matrix = matrix;
}
///
/// Gets or sets the matrix.
///
public Matrix Matrix
{
get { return this.GetValue(MatrixProperty); }
set { this.SetValue(MatrixProperty, value); }
}
///
/// Gets the matrix.
///
public override Matrix Value
{
get { return this.Matrix; }
}
}
}