Browse Source

注释列表-优化

OYXH\oyxh 1 year ago
parent
commit
6de354f4fd

+ 13 - 3
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -309,19 +309,29 @@ namespace PDF_Master.ViewModels.BOTA
         public void HiddenAnnot()
         {
             isHiddenAnnot = true;
+            colors.Clear();
+            authors.Clear();
+            annotArgsTypes.Clear();
             AnnotationListItems.Clear();
+            
             CurrentAnnotationLists = GetDocumentAnnotionList(out HideAnnots);
             AnnotationListItems.AddRange(CurrentAnnotationLists);
+            Screen = Visibility.Collapsed;
         }
 
         public void DisplayAnnot()
         {
             isHiddenAnnot = false;
-            AnnotationListItems.Clear();
+            colors.Clear();
+            authors.Clear();
+            annotArgsTypes.Clear();
+            AnnotationListItems.Clear();
+           
             //AnnotationListItems = GetDocumentAnnotionList(out ObservableCollection<AnnotationHandlerEventArgs> HideAnnots);
             CurrentAnnotationLists = GetDocumentAnnotionList(out HideAnnots);
             AnnotationListItems.AddRange(CurrentAnnotationLists);
-            RefreshAnnotationListItems();
+            RefreshAnnotationListItems();
+            Screen = Visibility.Collapsed;
         }
 
         /// <summary>
@@ -651,7 +661,7 @@ namespace PDF_Master.ViewModels.BOTA
             if (AnnotationListItems.Count > 0)
             {
                 IsEmptyPanelVisibility = Visibility.Collapsed;
-                await Task.Delay(2);
+                await Task.Delay(5);
                 //展开数据
                 ExpandGroupHeader(AnnotationListItems, listBox);
             }

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

@@ -238,7 +238,7 @@
                             HorizontalAlignment="Right"
                             VerticalAlignment="Top"
                             Fill="#1770F4"
-                            Visibility="{Binding Screen}" />
+                            Visibility="{Binding Screen,Mode=TwoWay}" />
                     </Grid>
                     <Button
                         Name="BtnMore"

+ 3 - 2
PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

@@ -74,6 +74,7 @@ namespace PDF_Master.Views.BOTA
                             {
                                 BtnHighlight.Visibility = Visibility.Visible;
                                 PathHighlight.Background = new SolidColorBrush(textHighlightAnnotArgs.Color);
+                                //PathHighlight.Opacity = textHighlightAnnotArgs.Transparency;
                                 //BOTA - 注释,MVP不处理高亮 / 下划线 / 删除线的样式,只显示文字
                                 //文本注释、便签、链接、表格不支持添加附注
 
@@ -93,14 +94,14 @@ namespace PDF_Master.Views.BOTA
                                 TxbContent.Visibility = Visibility.Collapsed;
 
                                 SetImageContext(args, freehandAnnotArgs);
-                                
+
                                 //var encoder = new PngBitmapEncoder();
                                 //encoder.Frames.Add(BitmapFrame.Create((BitmapSource)ImageContext.Source));
                                 //FileStream file = new FileStream(String.Format($@"C:\Users\oyxh\Desktop\images\PDFText\{data.AnnotIndex}.png"), FileMode.Create);
                                 //encoder.Save(file);
                                 //file.Close();
                             }
-                            if (string.IsNullOrEmpty(data.Content)==false)
+                            if (string.IsNullOrEmpty(data.Content) == false)
                             {
                                 TxbMarkupContent.Text = Regex.Replace(data.Content, "[\r\n]", " ");
                             }