using Prism.Ioc;
using Prism.Regions;
using StartServerWPF.Modules.Main.ViewModels;
using StartServerWPF.ViewModels;
using System.Windows;

namespace StartServerWPF.Views
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {

        public MainWindow()
        {
            InitializeComponent();
            mainModel =DataContext as MainWindowViewModel;
        }
        MainWindowViewModel mainModel;
        private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (MessageBox.Show("是否退出程序？", "warning", MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
            {
                mainModel.Exit();
            }
            else
            {
                e.Cancel = true;
            }
        }

        private void Window_MouseDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            this.DragMove();
        }
    }
}
