From be328d0ff2fdfe67314254b2d24abd675a4376c3 Mon Sep 17 00:00:00 2001 From: wenjy Date: Fri, 13 Dec 2024 10:24:35 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E7=B3=BB=E7=BB=9F=E9=80=80?= =?UTF-8?q?=E5=87=BA=E7=A1=AE=E8=AE=A4=E6=8F=90=E7=A4=BA=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs index 3d45a14..f8133b5 100644 --- a/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs +++ b/SlnMesnac.WPF/ViewModel/MainWindowViewModel.cs @@ -122,8 +122,14 @@ namespace SlnMesnac.WPF.ViewModel { // 关闭当前窗口 case "Exit": - //Environment.Exit(0); - Application.Current.Shutdown(); + //Application.Current.Shutdown(); + MessageBoxResult result = MessageBox.Show("确定要退出程序吗?", "退出确认", MessageBoxButton.YesNo, MessageBoxImage.Question); + + // 根据用户的选择决定是否退出程序 + if (result == MessageBoxResult.Yes) + { + Application.Current.Shutdown(); + } break; case "Generate":