// ----------------------------------------------------------------------- // // Copyright 2013 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex.Media { using System; public class RotateTransform : Transform { public static readonly PerspexProperty AngleProperty = PerspexProperty.Register("Angle"); public RotateTransform() { this.GetObservable(AngleProperty).Subscribe(_ => this.RaiseChanged()); } public RotateTransform(double angle) : this() { this.Angle = angle; } public double Angle { get { return this.GetValue(AngleProperty); } set { this.SetValue(AngleProperty, value); } } public override Matrix Value { get { return Matrix.Rotation(Matrix.ToRadians(this.Angle)); } } } }