Browse Source

注释列表-数据展开

OYXH\oyxh 1 year ago
parent
commit
2da48d1011

+ 11 - 10
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -683,7 +683,7 @@ namespace PDF_Master.ViewModels.BOTA
             if (AnnotationListItems.Count > 0)
             {
                 IsEmptyPanelVisibility = Visibility.Collapsed;
-                await Task.Delay(5);
+                await Task.Delay(2);
                 ////展开数据
                 //ExpandGroupHeader(AnnotationListItems, listBox);
 
@@ -1156,20 +1156,21 @@ namespace PDF_Master.ViewModels.BOTA
                 for (int k = 0; k < AnnotationListItems.Count; k++)
                 {
                     if (AnnotationListItems[k].PageIndex == pageIndex && AnnotationListItems[k].AnnotIndex == annotIndex)
-                    {
-                        //AnnotationListItems.RemoveAt(k);
-                        //AnnotationHandlerEventArgs annotation1 = CurrentAnnotationLists.FirstOrDefault(x => x.PageIndex == AnnotationListItems[k].PageIndex && x.AnnotIndex == AnnotationListItems[k].AnnotIndex);
-                        //CurrentAnnotationLists.Remove(annotation1);
-                        //UpdateAnnotListAfterDelete(pageIndex, annotIndex);
-
-                        //删除之后要拿到最新的数据源
+                    {
+                        //AnnotationListItems.RemoveAt(k);
+                        //AnnotationHandlerEventArgs annotation1 = CurrentAnnotationLists.FirstOrDefault(x => x.PageIndex == AnnotationListItems[k].PageIndex && x.AnnotIndex == AnnotationListItems[k].AnnotIndex);
+                        //CurrentAnnotationLists.Remove(annotation1);
+                        //UpdateAnnotListAfterDelete(pageIndex, annotIndex);
+                        //AnnotationHandlerEventArgs args = AnnotationListItems.FindFirst(a => a.PageIndex == pageIndex);
+                        //listBox.ScrollIntoView(args);
+
+                        //删除之后要拿到最新的数据源
                         CurrentAnnotationLists = GetDocumentAnnotionList(out HideAnnots);
                         AnnotationListItems = new ObservableCollection<AnnotationHandlerEventArgs>();
                         AnnotationListItems.AddRange(CurrentAnnotationLists);
                         AnnotationListItems.CollectionChanged += AnnotationListItems_CollectionChanged;
                         RefreshAnnotationListItems();
-                        //AnnotationHandlerEventArgs args = AnnotationListItems.FindFirst(a => a.PageIndex == pageIndex);
-                        //listBox.ScrollIntoView(args);
+                       
                         return;
                     }
                 }

+ 4 - 1
PDF Office/Views/BOTA/AnnotationContent.xaml

@@ -121,7 +121,10 @@
                                                         TextAlignment="Right" />-->
                                                     </Grid>
                                                 </Expander.Header>
-                                                <ItemsPresenter />
+                                                <Expander.Content>
+                                                    <ItemsPresenter  SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                                                </Expander.Content>
+                                                <!--<ItemsPresenter />-->
                                             </Expander>
                                         </ControlTemplate>
                                     </Setter.Value>

+ 14 - 2
PDF Office/Views/BOTA/AnnotationContent.xaml.cs

@@ -82,9 +82,13 @@ namespace PDF_Master.Views.BOTA
                                 var g = CommonHelper.FindVisualChild<Expander>(groupItem);
                                 if (g != null)
                                 {
-                                    await Task.Delay(5);
+                                    await Task.Delay(1);
                                     g.IsExpanded = true;
                                 }
+                                else
+                                {
+
+                                }
                             }
                         }
                     }
@@ -112,9 +116,17 @@ namespace PDF_Master.Views.BOTA
                                     var g = CommonHelper.FindVisualChild<Expander>(groupItem);
                                     if (g != null)
                                     {
-                                        await Task.Delay(5);
+                                        await Task.Delay(1);
                                         g.IsExpanded = true;
                                     }
+                                    else
+                                    {
+
+                                    }
+                                }
+                                else
+                                {
+
                                 }
                             }
                         }