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":