|
@@ -1,11 +1,14 @@
|
|
|
using ComPDFKitViewer;
|
|
|
+using ComPDFKitViewer.AnnotEvent;
|
|
|
using ComPDFKitViewer.PdfViewer;
|
|
|
using Microsoft.Office.Interop.Word;
|
|
|
using PDF_Office.CustomControl;
|
|
|
using PDF_Office.Helper;
|
|
|
using PDF_Office.Model;
|
|
|
+using PDF_Office.Model.BOTA;
|
|
|
using PDF_Office.ViewModels.BOTA;
|
|
|
using PDF_Office.Views;
|
|
|
+using PDF_Office.Views.BOTA;
|
|
|
using PDFSettings.Settings;
|
|
|
using Prism.Commands;
|
|
|
using Prism.Mvvm;
|
|
@@ -13,6 +16,7 @@ using Prism.Regions;
|
|
|
using Prism.Services.Dialogs;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Collections.ObjectModel;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
@@ -23,8 +27,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
|
|
|
{
|
|
|
public class ViewModularContentViewModel : BindableBase, INavigationAware
|
|
|
{
|
|
|
-
|
|
|
#region 文案
|
|
|
+
|
|
|
private string T_title;
|
|
|
|
|
|
public string T_Title
|
|
@@ -135,8 +139,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private void InitString()
|
|
|
{
|
|
|
T_Title = App.MainPageLoader.GetString("ViewProperties_Title");
|
|
@@ -151,8 +153,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
|
|
|
T_RotateTitle = App.MainPageLoader.GetString("ViewProperties_RotateTitle");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- #endregion
|
|
|
+ #endregion 文案
|
|
|
|
|
|
private IRegionManager region;
|
|
|
|
|
@@ -344,10 +345,84 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
|
|
|
{
|
|
|
SplitScreenPDFViewer.RotatePage(PageRotate.Rotate90, right, SplitScreenPDFViewer.CurrentIndex);
|
|
|
}
|
|
|
-
|
|
|
+ PDFViewer.UndoManager.CanSave = true;
|
|
|
//后续需要添加,缩略图旋转改变
|
|
|
|
|
|
- PDFViewer.UndoManager.CanSave = true;
|
|
|
+ if (ViewContentViewModel.OpenBOTA == true)
|
|
|
+ {
|
|
|
+ UpdateTabItemAnnotation();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void UpdateTabItemAnnotation()
|
|
|
+ {
|
|
|
+ bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
|
|
|
+
|
|
|
+ if (isTabItemAnnotation == true && bOTAContent.TabItemAnnotation.IsSelected == true)
|
|
|
+ {
|
|
|
+ AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel, out AnnotationContent annotation);
|
|
|
+
|
|
|
+ if (viewModel != null)
|
|
|
+ {
|
|
|
+ if (viewModel.AnnotationListItems.Count > 0)
|
|
|
+ {
|
|
|
+ var list = viewModel.AnnotationListItems.Where(q => q.AnnotHandlerEventArgs is FreehandAnnotArgs).ToList();
|
|
|
+ if (list.Count() > 0)
|
|
|
+ {
|
|
|
+ for (int i = 0; i < list.Count(); i++)
|
|
|
+ {
|
|
|
+ var item = list[i];
|
|
|
+ viewModel.UpdateModifiedAnnot(item.PageIndex, item.AnnotIndex, false);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private AnnotationContentViewModel GetAnnotationContentViewModel(BOTAContentViewModel bOTAContentViewModel, out AnnotationContent annotation)
|
|
|
+ {
|
|
|
+ AnnotationContentViewModel viewModel = null;
|
|
|
+ annotation = null;
|
|
|
+ if (bOTAContentViewModel != null)
|
|
|
+ {
|
|
|
+ if (region.Regions.ContainsRegionWithName(bOTAContentViewModel.BOTAContentRegionName))
|
|
|
+ {
|
|
|
+ var views = region.Regions[bOTAContentViewModel.BOTAContentRegionName].Views;
|
|
|
+ foreach (var item in views)
|
|
|
+ {
|
|
|
+ if (item is AnnotationContent annotation1)
|
|
|
+ {
|
|
|
+ annotation = annotation1;
|
|
|
+ viewModel = annotation1.DataContext as AnnotationContentViewModel;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return viewModel;
|
|
|
+ }
|
|
|
+
|
|
|
+ private bool IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, string tabItemText)
|
|
|
+ {
|
|
|
+ bool isTabItem = false;
|
|
|
+ bOTAContentViewModel = null;
|
|
|
+ bOTAContent = null;
|
|
|
+ if (region.Regions.ContainsRegionWithName(ViewContentViewModel.BOTARegionName))
|
|
|
+ {
|
|
|
+ var views = region.Regions[ViewContentViewModel.BOTARegionName].Views;
|
|
|
+ var model = views.FirstOrDefault(q => q is BOTAContent);
|
|
|
+ if (model is BOTAContent bOTAContent1)
|
|
|
+ {
|
|
|
+ bOTAContent = bOTAContent1;
|
|
|
+ bOTAContentViewModel = bOTAContent.DataContext as BOTAContentViewModel;
|
|
|
+ if (bOTAContentViewModel.CurrentBar == tabItemText)
|
|
|
+ {
|
|
|
+ isTabItem = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return isTabItem;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|