using Noesis; namespace StellarConquest.Presentation.Unity.UI { public sealed class JumpGateControl : ContentControl { public static readonly DependencyProperty TextProperty = DependencyProperty.Register("Text", typeof(string), typeof(JumpGateControl), new PropertyMetadata(default(string))); public static readonly DependencyProperty AngleProperty = DependencyProperty.Register("Angle", typeof(float), typeof(JumpGateControl), new PropertyMetadata(default(float))); public static readonly DependencyProperty XProperty = DependencyProperty.Register("X", typeof(float), typeof(JumpGateControl), new PropertyMetadata(default(float))); public static readonly DependencyProperty YProperty = DependencyProperty.Register("Y", typeof(float), typeof(JumpGateControl), new PropertyMetadata(default(float))); public static readonly DependencyProperty IsPressedProperty = DependencyProperty.Register("IsPressed", typeof(bool), typeof(JumpGateControl), new PropertyMetadata(default(bool))); public JumpGateControl() { MouseLeftButtonDown += (sender, e) => IsPressed = true; MouseLeftButtonUp += (sender, e) => IsPressed = false; MouseLeave += (sender, e) => IsPressed = false; } public string Text { get { return (string)GetValue(TextProperty); } set { SetValue(TextProperty, value); } } public float Angle { get { return (float)GetValue(AngleProperty); } set { SetValue(AngleProperty, value); } } public float X { get { return (float)GetValue(XProperty); } set { SetValue(XProperty, value); } } public float Y { get { return (float)GetValue(YProperty); } set { SetValue(YProperty, value); } } public bool IsPressed { get { return (bool)GetValue(IsPressedProperty); } set { SetValue(IsPressedProperty, value); } } } }