using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace MainShell.Resources.CustomControl
{
    public partial class AxisMoveControl : UserControl
    {
        public static readonly DependencyProperty IsAllShowProperty =
          DependencyProperty.Register(nameof(IsAllShow), typeof(bool), typeof(AxisMoveControl), new PropertyMetadata(true));

        public static readonly DependencyProperty IsReadOnlyProperty =
         DependencyProperty.Register(nameof(IsReadOnly), typeof(bool), typeof(AxisMoveControl), new PropertyMetadata(false));

        public static readonly DependencyProperty LableContent1Property =
            DependencyProperty.Register(nameof(LableContent1), typeof(string), typeof(AxisMoveControl), new PropertyMetadata());

        public static readonly DependencyProperty Value1Property =
            DependencyProperty.Register(nameof(Value1), typeof(double), typeof(AxisMoveControl), new PropertyMetadata(0.0));

        public static readonly DependencyProperty Min1Property =
           DependencyProperty.Register(nameof(Min1), typeof(double), typeof(AxisMoveControl), new PropertyMetadata(-1000.0));

        public static readonly DependencyProperty Max1Property =
         DependencyProperty.Register(nameof(Max1), typeof(double), typeof(AxisMoveControl), new PropertyMetadata(1000.0));

        public static readonly DependencyProperty LableContent2Property =
           DependencyProperty.Register(nameof(LableContent2), typeof(string), typeof(AxisMoveControl), new PropertyMetadata());


        public static readonly DependencyProperty Value2Property =
            DependencyProperty.Register(nameof(Value2), typeof(double), typeof(AxisMoveControl), new PropertyMetadata(0.0));

        public static readonly DependencyProperty Min2Property =
         DependencyProperty.Register(nameof(Min2), typeof(double), typeof(AxisMoveControl), new PropertyMetadata(-1000.0));

        public static readonly DependencyProperty Max2Property =
         DependencyProperty.Register(nameof(Max2), typeof(double), typeof(AxisMoveControl), new PropertyMetadata(1000.0));

        public static readonly DependencyProperty LableWidthProperty =
        DependencyProperty.Register(nameof(LableWidth), typeof(int), typeof(AxisMoveControl), new PropertyMetadata(80));

        public static readonly DependencyProperty NumberBoxWidthProperty =
        DependencyProperty.Register(nameof(NumberBoxWidth), typeof(int), typeof(AxisMoveControl), new PropertyMetadata(80));

        public bool IsAllShow { get => (bool)GetValue(IsAllShowProperty); set => SetValue(IsAllShowProperty, value); }
        public bool IsReadOnly { get => (bool)GetValue(IsReadOnlyProperty); set => SetValue(IsReadOnlyProperty, value); }

        public string LableContent1 { get => (string)GetValue(LableContent1Property); set => SetValue(LableContent1Property, value); }

        public int LableWidth { get => (int)GetValue(LableWidthProperty); set => SetValue(LableWidthProperty, value); }
        public int NumberBoxWidth { get => (int)GetValue(NumberBoxWidthProperty); set => SetValue(NumberBoxWidthProperty, value); }

        public double Value1 { get => (double)GetValue(Value1Property); set => SetValue(Value1Property, value); }

        public double Min1 { get => (double)GetValue(Min1Property); set => SetValue(Min1Property, value); }

        public double Max1 { get => (double)GetValue(Max1Property); set => SetValue(Max1Property, value); }

        public string LableContent2 { get => (string)GetValue(LableContent2Property); set => SetValue(LableContent2Property, value); }

        public double Value2 { get => (double)GetValue(Value2Property); set => SetValue(Value2Property, value); }

        public double Min2 { get => (double)GetValue(Min2Property); set => SetValue(Min2Property, value); }

        public double Max2 { get => (double)GetValue(Max2Property); set => SetValue(Max2Property, value); }

        public ICommand MoveCommand
        {
            get => (ICommand)GetValue(MoveCommandProperty);
            set => SetValue(MoveCommandProperty, value);
        }
        public static readonly DependencyProperty MoveCommandProperty =
            DependencyProperty.Register(nameof(MoveCommand), typeof(ICommand), typeof(AxisMoveControl), new PropertyMetadata(null));

        public ICommand ReadCommand
        {
            get => (ICommand)GetValue(ReadCommandProperty);
            set => SetValue(ReadCommandProperty, value);
        }
        public static readonly DependencyProperty ReadCommandProperty =
            DependencyProperty.Register(nameof(ReadCommand), typeof(ICommand), typeof(AxisMoveControl), new PropertyMetadata(null));

    }
}
