You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
C#
34 lines
1.0 KiB
C#
using Aucma.Core.BoxFoam.ViewModels;
|
|
using System;
|
|
using System.Windows;
|
|
|
|
namespace Aucma.Core.BoxFoam.Views
|
|
{
|
|
/// <summary>
|
|
/// Interaction logic for MainWindow.xaml
|
|
/// </summary>
|
|
public partial class MainWindow : Window
|
|
{
|
|
private static readonly Lazy<MainWindow> _instance = new Lazy<MainWindow>(() => new MainWindow());
|
|
|
|
public static MainWindow Instance => _instance.Value;
|
|
|
|
public MainWindow()
|
|
{
|
|
InitializeComponent();
|
|
this.DataContext = new MainWindowViewModel();
|
|
Closing += PageView_Closing; // 订阅窗口关闭事件s
|
|
}
|
|
|
|
private void PageView_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
|
{
|
|
if (MessageBox.Show("确定要退出吗?", "提示", MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
|
System.Environment.Exit(0);
|
|
//this.Hide();
|
|
////跳转到登录页
|
|
//LoginPageView login = LoginPageView.Instance;
|
|
//login.Show();
|
|
}
|
|
}
|
|
}
|