Browse Source

其他-修复新建空白文档,关闭时出现错误的问题

ZhouJieSheng 1 year ago
parent
commit
7f11b53375

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

@@ -612,7 +612,7 @@ namespace PDF_Master.ViewModels
             {
                 //偏好设置里未设置直接保存时,需要弹窗提示
                 AlertsMessage alertsMessage = new AlertsMessage();
-                alertsMessage.ShowDialog("",string.Format(App.MainPageLoader.GetString("Main_ModifiedFileWarning"),System.IO.Path.GetFileName(pdfViewer.Document.FilePath)), App.ServiceLoader.GetString("Text_cancel"), App.ServiceLoader.GetString("Text_no"), App.ServiceLoader.GetString("Text_ok"));
+                alertsMessage.ShowDialog("",string.Format(App.MainPageLoader.GetString("Main_ModifiedFileWarning"),System.IO.Path.GetFileName(CurrentPDFViewer.Document.FilePath)), App.ServiceLoader.GetString("Text_cancel"), App.ServiceLoader.GetString("Text_no"), App.ServiceLoader.GetString("Text_ok"));
                 result = alertsMessage.result;
             }
 

+ 5 - 0
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -2206,6 +2206,11 @@ namespace PDF_Master.ViewModels
             }
             region.AddToRegion(ViwerRegionName, PDFViewer);
 
+            if (App.mainWindowViewModel != null)
+            {
+                //更新CurrentPDFViewer对象
+                App.mainWindowViewModel.CurrentPDFViewer = PDFViewer;
+            }
             if (!App.OpenedFileList.Contains(PDFViewer.Document.FilePath))
             {
                 App.OpenedFileList.Add(PDFViewer.Document.FilePath);

+ 2 - 2
PDF Office/Views/HomeContent.xaml

@@ -188,9 +188,9 @@
             Grid.RowSpan="2"
             Grid.Column="1"
             prism:RegionManager.RegionName="{Binding ToolRegionName}" />
-        <!--<cus:LoadingControl
+        <cus:LoadingControl
             Grid.RowSpan="2"
             Grid.ColumnSpan="2"
-            Visibility="{Binding IsLoading}" />-->
+            Visibility="{Binding IsLoading}" />
     </Grid>
 </UserControl>