|
@@ -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);
|
|
|
+ }
|
|
|
}
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|