using HBLConsole.Service;
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.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace HBLConsole.DialogWindow.View
{
    /// <summary>
    /// SimOrderConfitView.xaml 的交互逻辑
    /// </summary>
    public partial class SimOrderConfitView : Window
    {
        public SimOrderConfitView()
        {
            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.DialogResult = false; };
            this.MaxWidth = SystemParameters.WorkArea.Width;
            this.MaxHeight = SystemParameters.WorkArea.Height;

            ActionOperate.GetInstance.Register(new Action(() =>
            {
                this.DialogResult = true;
                this.Close();
                ActionOperate.GetInstance.CancelRegister("SimOrderConfitViewModelExit");
            }), "SimOrderConfitViewModelExit");

        }
    }
}
