OYXH\oyxh před 1 rokem
rodič
revize
3044687bd4

+ 16 - 12
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -1020,22 +1020,26 @@ namespace PDF_Master.ViewModels.BOTA
             //var list = PdfViewer.GetAnnotCommentList(pageindex, PdfViewer.Document);
             for (int i = 0; i < AnnotationList.Items.Count; i++)
             {
-                if ((AnnotationList.Items[i] as AnnotationHandlerEventArgs).AnnotIndex == annotindex && (AnnotationList.Items[i] as AnnotationHandlerEventArgs).PageIndex == pageindex)
-                {
-                    var item = AnnotationList.Items[i] as AnnotationHandlerEventArgs;
-                    if (item.EventType != AnnotArgsType.AnnotLink)
+                if(AnnotationList.Items[i] is AnnotationHandlerEventArgs item)
+                {
+                    if (item.AnnotIndex == annotindex && item.PageIndex == pageindex)
                     {
-                        //需要手动搜寻在哪一个分组 展开分组头
-                        ExpandGroupHeader(item, AnnotationList);
-                        if (AnnotationList.SelectedItems.IndexOf(item) == -1)
+                        //var item = AnnotationList.Items[i] as AnnotationHandlerEventArgs;
+                        if (item.EventType != AnnotArgsType.AnnotLink)
                         {
-                            AnnotationList.SelectedItem = item;
-                        }
+                            //需要手动搜寻在哪一个分组 展开分组头
+                            ExpandGroupHeader(item, AnnotationList);
+                            if (AnnotationList.SelectedItems.IndexOf(item) == -1)
+                            {
+                                AnnotationList.SelectedItem = item;
+                            }
 
-                        await Task.Delay(1);
-                        AnnotationList.ScrollIntoView(item);
+                            await Task.Delay(1);
+                            AnnotationList.ScrollIntoView(item);
+                        }
                     }
-                }
+                }
+                
             }
         }
 

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -868,7 +868,7 @@ namespace PDF_Master.ViewModels.PropertyPanel.AnnotPanel
 
                         if (LinkAnnotArgs.PageIndex == -1)
                         {
-                            LinkAnnotArgs.PageIndex = historyPageIndex;
+                            LinkAnnotArgs.PageIndex = historyPageIndex-1;
                         }
                         historyPageIndex = LinkAnnotArgs.PageIndex;