using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using Microsoft.Toolkit.Mvvm.Messaging;
using Microsoft.Toolkit.Mvvm.ComponentModel;
using HBLConsole.Model;
using HBLConsole.Service;

namespace HBLConsole.DialogWindow.View
{
    /// <summary>
    /// DeviceManagermentSetView.xaml 的交互逻辑
    /// </summary>
    public partial class DeviceManagermentSetView : Window
    {
        public DeviceManagermentSetView()
        {
            InitializeComponent();
            this.MoveBorder.MouseLeftButtonDown += (o, e) => { this.DragMove(); };
            this.ButMin.Click += (o, e) => { this.WindowState = WindowState.Minimized; };
            this.ButMax.Click += (o, e) => { this.WindowState = this.WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized; };
            this.ButClose.Click += (o, e) => { this.Close(); };
            this.MaxWidth = SystemParameters.WorkArea.Width;
            this.MaxHeight = SystemParameters.WorkArea.Height;

            ActionManage.GetInstance.Register(new Action<object>((s) =>
            {
                //this.Tag = s;
                //this.DialogResult = false;
                ActionManage.GetInstance.CancelRegister("Cancel");
                this.Close();

            }), "Cancel");

            ActionManage.GetInstance.Register(new Action<object>((s) =>
            {
                //this.Tag = s;
                //this.DialogResult = true;
                ActionManage.GetInstance.CancelRegister("Confirm");
                this.Close();

            }), "Confirm");

        }



    }
}
