Ver código fonte

偏好设置-修复保存时不显示询问弹窗,直接保存失效问题

ZhouJieSheng 1 ano atrás
pai
commit
70916cacdb
1 arquivos alterados com 6 adições e 6 exclusões
  1. 6 6
      PDF Office/ViewModels/MainWindowViewModel.cs

+ 6 - 6
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -548,14 +548,14 @@ namespace PDF_Master.ViewModels
         /// <returns></returns>
         private ContentResult ShowSaveDialog(ViewContentViewModel viewContentViewModel)
         {
-            if(Settings.Default.AppProperties.Description.NotShowSaveWhenClose)
+            ContentResult result = ContentResult.Ok;
+            if (!Settings.Default.AppProperties.Description.NotShowSaveWhenClose)
             {
-                //偏好设置里选择自动保存时
-                return ContentResult.Ok;
+                //偏好设置里未设置直接保存时,需要弹窗提示
+                AlertsMessage alertsMessage = new AlertsMessage();
+                alertsMessage.ShowDialog("关闭提示", "当前文档有为保存的操作,是否需要保存?", "Cancel", "No", "Ok");
+                result = alertsMessage.result;
             }
-            AlertsMessage alertsMessage = new AlertsMessage();
-            alertsMessage.ShowDialog("关闭提示", "当前文档有为保存的操作,是否需要保存?", "Cancel", "No", "Ok");
-            var result = alertsMessage.result;
 
             if (result == ContentResult.Ok)
             {