using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using HBLConsole.Model;
using HBLConsole.Service;
using HBLConsole.ViewModel;
using Microsoft.Toolkit.Mvvm.Input;

namespace HBLConsole.DialogWindow.ViewModel
{
    public class SimOrderConfitViewModel : ViewModelBase
    {
        public SimOrderConfitViewModel()
        {
            ConfirmCommand = new RelayCommand(() =>
            {
                Json<KeepDataBase>.Data.simOrderConfig.Add(new SimOrderVisibleData()
                {
                    ClientDeviceType = GVL.GeneralConfig.DeviceType.ToString(),
                    IsEnable = true,
                    IsSelected = true,
                    Text = Name,
                    Loc = Min,
                    MaxValue = Max,
                    MinValue = Min,
                });
                ActionOperate.GetInstance.Send("SimOrderConfitViewModelExit");
            });
            CancelCommand = new RelayCommand(() => { ActionOperate.GetInstance.Send("SimOrderConfitViewModelExit"); });
        }


        public RelayCommand ConfirmCommand { get; set; }

        public RelayCommand CancelCommand { get; set; }

        public string Name { get { return _mName; } set { _mName = value; OnPropertyChanged(); } }
        private string _mName;

        public ushort Min { get { return _mMin; } set { _mMin = value; OnPropertyChanged(); } }
        private ushort _mMin;

        public ushort Max { get { return _mMax; } set { _mMax = value; OnPropertyChanged(); } }
        private ushort _mMax;


    }
}
