Sfoglia il codice sorgente

综合-注释-右键 属性面板的显示问题、注释列表-添加 时 ,形状、图章、签名,添加后选中

OYXH\oyxh 1 anno fa
parent
commit
0add4c4545

+ 14 - 2
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -1062,11 +1062,23 @@ namespace PDF_Master.ViewModels.BOTA
                         CurrentAnnotationLists.Add(args);
 
                         await Task.Delay(5);//不加延时 每页的第一个注释不会展开
-                        listBox.SelectedItem = args;
+                        //添加 时 ,形状、图章、签名,添加后选中
+                        if (args.EventType == AnnotArgsType.AnnotSquare ||
+                            args.EventType == AnnotArgsType.AnnotCircle ||
+                            args.EventType == AnnotArgsType.AnnotLine ||
+                            args.EventType == AnnotArgsType.AnnotStamp
+                            /*  ||args.EventType == AnnotArgsType.AnnotLink*/)
+                        {
+                            listBox.SelectedItem = args;
+                        }
+
                         ExpandGroupHeader(args, listBox);
 
                         await Task.Delay(5);//不加延时 会有不滚动的现象
-                        listBox.ScrollIntoView(item);
+
+                        //events.GetEvent<ScrollIntoAnnotViewEvent>().Publish(new ScrollIntoAnnotViewArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, Annotation = item });
+                        listBox.ScrollIntoView(args);
+
                         //if (!listBox.SelectedItems.Contains(args))
                         //{
                         //    listBox.SelectedItem = args;

+ 9 - 7
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -507,7 +507,9 @@ namespace PDF_Master.ViewModels.Tools
                             {
                                 PropertyPanel.IsFreeHandSelected = true;
                             }
-                            GetSelectedAnnots(e);
+                            if (viewContentViewModel.IsPropertyOpen)
+                                GetSelectedAnnots(e);
+
                             SelectedSignature(e.AnnotItemsList);
 
                             if (Settings.Default.AppProperties.InitialVIew.AutoExpandProperty
@@ -515,12 +517,12 @@ namespace PDF_Master.ViewModels.Tools
                                 && annot.EventType != AnnotArgsType.AnnotLink)
                             {
                                 var signAnnot = viewContentViewModel.AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
-                                if (signAnnot == null)
+                                if (signAnnot == null && viewContentViewModel.IsPropertyOpen)
                                 {
                                     ShowPropertyPanel(true);
                                 }
                             }
-                            if (StrAnnotToolChecked == "Signature")
+                            else if (StrAnnotToolChecked == "Signature")
                             {
                                 GetSignature();
                             }
@@ -540,7 +542,6 @@ namespace PDF_Master.ViewModels.Tools
                                 if (IsNoSelectMenu)
                                 {
                                     return;
-                                   
                                 }
                                 PropertyPanel.annot = null;
                                 PropertyPanel.AnnotEvents = null;
@@ -1120,9 +1121,10 @@ namespace PDF_Master.ViewModels.Tools
                                 }
                                 else
                                 {
-                                    if (annot.EventType == AnnotArgsType.AnnotSquare || annot.EventType == AnnotArgsType.AnnotCircle ||
-                                annot.EventType == AnnotArgsType.AnnotLine || annot.EventType == AnnotArgsType.AnnotStamp ||
-                                annot.EventType==AnnotArgsType.AnnotLink
+                                    if (
+                                        annot.EventType == AnnotArgsType.AnnotSquare || annot.EventType == AnnotArgsType.AnnotCircle ||
+                                        annot.EventType == AnnotArgsType.AnnotLine || annot.EventType == AnnotArgsType.AnnotStamp ||
+                                        annot.EventType == AnnotArgsType.AnnotLink
                                 /*|| annot.EventType == AnnotArgsType.AnnotSticky ||annot.EventType == AnnotArgsType.AnnotFreeText || annot.EventType == AnnotArgsType.AnnotFreehand*/)
                                     {
                                         if (selectAnnotDicts.ContainsKey(editEvent.PageIndex) == false)

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

@@ -321,9 +321,11 @@ namespace PDF_Master.Views.BOTA
             var a1 = (sender as ListBox).SelectedItems.Count;
             var a2 = (e.OriginalSource as ListBox).SelectedItems.Count;
             var a3 = (e.Source as ListBox).SelectedItems.Count;
-            Trace.WriteLine("a:" + a + "   a1:" + a1 + "  a2:" + a2 + "  a3:" + a3);
+            Trace.WriteLine("a:" + a + "   a1:" + a1 + "  a2:" + a2 + "  a3:" + a3);
+            //AnnotationList.ScrollIntoView(AnnotationList.Items[0]);
             if (a1 == 1)
             {
+               
                 viewModel.ListBoxItemPreviewMouseLeftButtonDown.Execute((sender as ListBox).SelectedItems[0]);
             }
             else if (a1 > 1)

+ 5 - 5
PDF Office/Views/ViewContent.xaml

@@ -364,7 +364,7 @@
                     BorderThickness="0"
                     Command="{Binding OpenPropertyCommand}"
                     CommandParameter="{Binding ElementName=TbtnProperty, Path=IsChecked}"
-                    IsChecked="{Binding IsPropertyOpen, Mode=OneWay}"
+                    IsChecked="{Binding IsPropertyOpen, Mode=TwoWay}"
                     IsEnabled="{Binding isInPageEdit, Converter={StaticResource UnBoolConvert}}"
                     Style="{StaticResource SubToolbarTgb}"
                     ToolTip="{Binding T_Properties}">
@@ -457,10 +457,10 @@
             Visibility="{Binding ToolsBarContentVisible}" />
 
         <!--<ContentControl
-            Name="ContentConverterBar"
-            Grid.Row="{Binding GridToolRow}"
-            prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
-            Visibility="{Binding ConverterBarContentVisible}" />-->
+        Name="ContentConverterBar"
+        Grid.Row="{Binding GridToolRow}"
+        prism:RegionManager.RegionName="{Binding ToolsBarContentRegionName}"
+        Visibility="{Binding ConverterBarContentVisible}" />-->
 
         <ContentControl
             Name="TextEditContentBar"