Browse Source

注释-链接注释交互

OYXH\oyxh 2 years ago
parent
commit
ea2404fd33

+ 19 - 3
PDF Office/ViewModels/BottomToolContentViewModel.cs

@@ -15,6 +15,10 @@ using System.Windows.Controls;
 using Prism.Services.Dialogs;
 using PDF_Office.CustomControl;
 using PDF_Office.Model;
+using PDF_Office.ViewModels.BOTA;
+using PDF_Office.Views.BOTA;
+using PDF_Office.Views.PropertyPanel.AnnotPanel;
+using PDF_Office.Views.Tools;
 
 namespace PDF_Office.ViewModels
 {
@@ -124,7 +128,7 @@ namespace PDF_Office.ViewModels
                 }
             }
         }
-        
+
         private int pageCount;
 
         public int PageCount
@@ -202,6 +206,20 @@ namespace PDF_Office.ViewModels
                 param.Add(ParameterNames.PDFViewer, PDFViewer);
                 param.Add(ParameterNames.BottomToolContentViewModel, this);
                 region.RequestNavigate(RegionNames.PropertyRegionName, "ViewModularContent", param);
+
+                if (region.Regions.ContainsRegionWithName(ViewContentViewModel.PropertyRegionName))
+                {
+                    var views = region.Regions[ViewContentViewModel.PropertyRegionName].Views;
+                    foreach (var item in views)
+                    {
+                        if (item is LinkAnnotProperty linkAnnotProperty)
+                        {
+                            var contentRegion = region.Regions[ViewContentViewModel.PropertyRegionName];
+                            contentRegion.Remove(item);
+                            break;
+                        }
+                    }
+                }
             }
             else
             {
@@ -210,8 +228,6 @@ namespace PDF_Office.ViewModels
             IsShowViewModular = ViewContentViewModel.IsPropertyOpen;
         }
 
-
-
         private void SelectionChangedEvent(object e)
         {
             var args = e as SelectionChangedEventArgs;

+ 13 - 4
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -612,10 +612,10 @@ namespace PDF_Office.ViewModels.Tools
         {
             if (e != null)
             {
-                if(e.AnnotItemsList.Count == 1 &&e.IsAnnotCreateReset == false)
+                var annot = e.AnnotItemsList[0];
+                if (annot != null)
                 {
-                    var annot = e.AnnotItemsList[0];
-                    if (annot != null)
+                    if (e.AnnotItemsList.Count == 1 && e.IsAnnotCreateReset == false)
                     {
                         switch (annot.EventType)
                         {
@@ -687,8 +687,17 @@ namespace PDF_Office.ViewModels.Tools
 
                         ShowPropertyPanel();
                     }
+                    else if (e.AnnotItemsList.Count == 1 && e.IsAnnotCreateReset == true)
+                    {
+                        switch (annot.EventType)
+                        {
+                            case AnnotArgsType.AnnotLink:
+                                GetLink(annot as LinkAnnotArgs, e);
+                                break;
+                        }
+                        ShowPropertyPanel();
+                    }
                 }
-                
             }
             else
             {