A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

38 lines
1.1 KiB

// -----------------------------------------------------------------------
// <copyright file="RotateTransform.cs" company="Steven Kirk">
// Copyright 2013 MIT Licence. See licence.md for more information.
// </copyright>
// -----------------------------------------------------------------------
namespace Perspex.Media
{
using System;
public class RotateTransform : Transform
{
public static readonly PerspexProperty<double> AngleProperty =
PerspexProperty.Register<RotateTransform, double>("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)); }
}
}
}