Przeglądaj źródła

Merge branch 'dev' of http://git.kdan.cc:8865/Windows/PDFOffice_Windows_exe into dev

ZhouJieSheng 2 lat temu
rodzic
commit
d0751532a2
47 zmienionych plików z 1286 dodań i 988 usunięć
  1. BIN
      PDF Office/ComPDFKit.Viewer.dll
  2. 34 5
      PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs
  3. 2 2
      PDF Office/EventAggregators/EditToolsEvent.cs
  4. 1 0
      PDF Office/PDF Office.csproj
  5. 16 13
      PDF Office/Styles/ContextMenuStyle.xaml
  6. 1 1
      PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs
  7. 1 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  8. 1 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  9. 1 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs
  10. 1 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs
  11. 1 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs
  12. 1 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs
  13. 1 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs
  14. 1 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateTextContentViewModel.cs
  15. 0 1
      PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogViewModel.cs
  16. 1 1
      PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs
  17. 3 2
      PDF Office/ViewModels/EditTools/Background/BackgroundDocumentContentViewModel.cs
  18. 1 0
      PDF Office/ViewModels/EditTools/Bates/BatesDocumentContentViewModel.cs
  19. 1 0
      PDF Office/ViewModels/EditTools/HeaderFooter/HeaderFooterDocumentContentViewModel.cs
  20. 1 1
      PDF Office/ViewModels/EditTools/Watermark/WatermarkContentViewModel.cs
  21. 1 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs
  22. 11 8
      PDF Office/ViewModels/EditTools/Watermark/WatermarkDocumentContentViewModel.cs
  23. 9 0
      PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs
  24. 23 13
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/StampAnnotPropertyViewModel.cs
  25. 3 3
      PDF Office/ViewModels/PropertyPanel/FontSetModeVM.cs
  26. 1 1
      PDF Office/ViewModels/PropertyPanel/PDFEdit/ImageEditPropertyViewModel.cs
  27. 32 7
      PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs
  28. 10 2
      PDF Office/ViewModels/Scan/ScanViwerViewModel.cs
  29. 580 0
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  30. 334 17
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  31. 20 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  32. 151 883
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  33. 1 1
      PDF Office/Views/BOTA/AnnotationListItem.xaml
  34. 13 0
      PDF Office/Views/BOTA/AnnotationListItem.xaml.cs
  35. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateColorContent.xaml
  36. 1 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateFileContent.xaml
  37. 2 2
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateFileContent.xaml
  38. 2 2
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateTextContent.xaml
  39. 1 1
      PDF Office/Views/EditTools/Background/BackgroundCreateColorContent.xaml
  40. 1 1
      PDF Office/Views/EditTools/Background/BackgroundCreateFileContent.xaml
  41. 2 2
      PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml
  42. 2 2
      PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml
  43. 1 0
      PDF Office/Views/HomePanel/PDFTools/PDFToolsContent.xaml.cs
  44. 1 1
      PDF Office/Views/PropertyPanel/AnnotPanel/StampAnnotProperty.xaml
  45. 10 0
      PDF Office/Views/PropertyPanel/AnnotPanel/StampAnnotProperty.xaml.cs
  46. 4 0
      PDF Office/Views/PropertyPanel/PDFEdit/TextEditProperty.xaml
  47. BIN
      PDF Office/x64/models/DA_image_enhance_magic_color_1.0.0.model

BIN
PDF Office/ComPDFKit.Viewer.dll


+ 34 - 5
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs

@@ -164,6 +164,17 @@ namespace PDF_Office.CustomControl.CompositeControl
             set { SetValue(SelectedItemsProperty, value); }
         }
 
+        //外部需要下拉框都不选中时,true为不选中,false为正常选中
+        public bool IsSelectedEmpty
+        {
+            get { return (bool)GetValue(IsSelectedEmptyProperty); }
+            set { SetValue(IsSelectedEmptyProperty, value); }
+        }
+
+        public static readonly DependencyProperty IsSelectedEmptyProperty =
+    DependencyProperty.Register("IsSelectedEmpty", typeof(bool), typeof(CustomComboControl), new PropertyMetadata(false, IsSelectedEmptyPropertyChanged));
+
+
         public static readonly DependencyProperty SelectedItemsProperty =
          DependencyProperty.Register("SelectedItems", typeof(ComboDataItem), typeof(CustomComboControl), new PropertyMetadata(null, SelectedItemsPropertyChanged));
 
@@ -184,11 +195,28 @@ namespace PDF_Office.CustomControl.CompositeControl
           DependencyProperty.Register("IsValueContent", typeof(bool), typeof(CustomComboControl), new PropertyMetadata(false));
 
         //集合绑定下拉框 SelectedItems触发属性
+        private static void IsSelectedEmptyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as CustomComboControl;
+            var isSelectedEmpty = (bool)e.NewValue;
+            if(control != null)
+            {
+                if(isSelectedEmpty)
+                {
+                    control.comBox.SelectedItem = null;
+                    control.SelectedIndex = -1;
+                    control.SelectedItems = null;
+                    control.title.Text = "";
+                }
+            }
+        }
+        
+
         private static void SelectedItemsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
         {
             var control = d as CustomComboControl;
             var selectedItems = (ComboDataItem)e.NewValue;
-            if (control != null & selectedItems != null)
+            if (control != null & selectedItems != null && control.IsSelectedEmpty == false)
             {
                 if(control.comBox.Items != null && control.comBox.Items.Count > 0)
                 {
@@ -237,7 +265,7 @@ namespace PDF_Office.CustomControl.CompositeControl
         {
             var control = d as CustomComboControl;
             var itemsource = (List<ComboDataItem>)e.NewValue;
-            if (control != null)
+            if (control != null && control.IsSelectedEmpty == false)
             {
                 control.SelectedIndex = -1;
                 control.comBox.ItemsSource = itemsource;
@@ -251,12 +279,12 @@ namespace PDF_Office.CustomControl.CompositeControl
         {
             var control = d as CustomComboControl;
             var selectedIndex = (int)e.NewValue;
-            if (control != null)
+            if (control != null && control.IsSelectedEmpty == false)
             {
                 if(control.comBox.Items != null && control.comBox.Items.Count > 0 && selectedIndex != -1)
                 {
                     control.comBox.SelectedIndex = selectedIndex;
-                    if (control.comBox.SelectedItem != null)
+                    if (control.comBox.SelectedItem != null )
                         control.SelectedItems = (ComboDataItem)control.comBox.SelectedItem;
                     else
                         control.SelectedItems = null;
@@ -273,7 +301,8 @@ namespace PDF_Office.CustomControl.CompositeControl
             }
             else
             {
-                title.Text = Items[SelectedIndex].Content;
+                if (IsSelectedEmpty == false)
+                    title.Text = Items[SelectedIndex].Content;
             }
         }
     }

+ 2 - 2
PDF Office/EventAggregators/EditToolsEvent.cs

@@ -156,11 +156,11 @@ namespace PDF_Office.EventAggregators
     }
 
 
-    public class ConfirmEditToolsBackgroundEvent : PubSubEvent
+    public class ConfirmEditToolsBackgroundEvent : PubSubEvent<string>
     {
     }
 
-    public class ConfirmEditToolsWatermarkEvent : PubSubEvent
+    public class ConfirmEditToolsWatermarkEvent : PubSubEvent<string>
     {
     }
     public class ConfirmEditToolsBatesEvent : PubSubEvent<string>

+ 1 - 0
PDF Office/PDF Office.csproj

@@ -509,6 +509,7 @@
     <Compile Include="ViewModels\PropertyPanel\ViewModular\PageContentViewModel.cs" />
     <Compile Include="ViewModels\Scan\ScanViwerViewModel.cs" />
     <Compile Include="ViewModels\TipContent\LinkAnnotTipViewModel.cs" />
+    <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Command.cs" />
     <Compile Include="ViewModels\Tools\ConverterBarContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />

+ 16 - 13
PDF Office/Styles/ContextMenuStyle.xaml

@@ -189,13 +189,16 @@
 
     <!--  阅读页点击空白处菜单  -->
     <ContextMenu x:Key="ViewerContextMenu" FontSize="14">
-        <MenuItem Header="粘贴" InputGestureText="Ctrl+V" />
+        <MenuItem
+            Header="粘贴"
+            InputGestureText="Ctrl+V"
+            Tag="Copy" />
         <Separator
             Height="1"
             BorderBrush="#33000000"
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-        <MenuItem Header="添加注释">
+        <MenuItem Header="添加注释" Tag="AddAnnotation">
             <MenuItem Header="绘制" Tag="AnnotFreehand" />
             <MenuItem Header="文本" Tag="AnnotFreeText" />
             <MenuItem Header="便签" Tag="AnnotSticky" />
@@ -217,16 +220,16 @@
             <MenuItem Header="图章" Tag="AnnotStamp" />
             <MenuItem Header="签名" Tag="AnnotAutograph" />
         </MenuItem>
-        <MenuItem Header="隐藏注释" />
-        <MenuItem Header="显示注释" />
-        <MenuItem Header="添加书签" />
-        <MenuItem Header="删除书签" />
+        <MenuItem Header="隐藏注释" Tag="HiddenAnnot" />
+        <MenuItem Header="显示注释" Tag="DisplayAnnot" />
+        <MenuItem Header="添加书签" Tag="AddBookMark" />
+        <MenuItem Header="删除书签" Tag="DelBookMark" />
         <Separator
             Height="1"
             BorderBrush="#33000000"
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-        <MenuItem Header="工具模式">
+        <MenuItem Header="工具模式" Tag="ToolMode">
             <MenuItem Header="默认工具" Tag="default" />
             <MenuItem Header="滚动工具" Tag="roll" />
             <MenuItem
@@ -239,21 +242,21 @@
                 Tag="zoom"
                 Visibility="Collapsed" />
         </MenuItem>
-        <MenuItem Header="进入阅读模式" />
-        <MenuItem Header="退出阅读模式" />
+        <MenuItem Header="进入阅读模式" Tag="ReadModel" />
+        <MenuItem Header="退出阅读模式" Tag="UnReadModel" />
         <Separator
             Height="1"
             BorderBrush="#33000000"
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-        <MenuItem Header="视图缩放">
+        <MenuItem Header="视图缩放" Tag="ViewZoom">
             <MenuItem Header="适应宽度" Tag="FitWidth" />
             <MenuItem Header="适应页面" Tag="FitHeight" />
             <MenuItem Header="实际大小" Tag="FitSize" />
             <MenuItem Header="放大" Tag="enlarge" />
             <MenuItem Header="缩小" Tag="narrow" />
         </MenuItem>
-        <MenuItem Header="页面显示">
+        <MenuItem Header="页面显示" Tag="PageDisplay">
             <MenuItem Header="单页" Tag="SingleView" />
             <MenuItem Header="单页连续" Tag="SingleContinueView" />
             <MenuItem Header="双页" Tag="DoubleView" />
@@ -265,7 +268,7 @@
             BorderBrush="#33000000"
             BorderThickness="1"
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />
-        <MenuItem Header="查找" />
-        <MenuItem Header="打印" />
+        <MenuItem Header="查找" Tag="Select" />
+        <MenuItem Header="打印" Tag="Print" />
     </ContextMenu>
 </ResourceDictionary>

+ 1 - 1
PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs

@@ -328,7 +328,7 @@ namespace PDF_Office.ViewModels.BOTA
                         }
                         isAddBookMark = false;
                     }
-                    else
+                    if (e.Result == ButtonResult.Cancel)
                     {
                         isAddBookMark = true;
                     }

+ 1 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs

@@ -85,7 +85,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private int languageSelectedIndex = 0;
+        private int languageSelectedIndex = 2;
         public int LanguageSelectedIndex
         {
             get { return languageSelectedIndex; }
@@ -362,7 +362,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 if (currentViewer.Tag != null) { ConverterExcelModel.Pawssword = currentViewer.Tag.ToString(); }
                 ConverterExcelModel.InputPath = pdfViewer.Document.FilePath;
                 FileInfo fileinfo = new FileInfo(ConverterExcelModel.InputPath);
-                LanguageSelectedIndex = 0;
                 ConverterExcelModel.OutputPath = fileinfo.DirectoryName;
             }
         }

+ 1 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs

@@ -59,7 +59,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private int languageSelectedIndex = 0;
+        private int languageSelectedIndex = 2;
         public int LanguageSelectedIndex
         {
             get { return languageSelectedIndex; }
@@ -274,7 +274,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 if (currentViewer.Tag != null) { ConverterHTMLModel.Pawssword = currentViewer.Tag.ToString(); }
                 ConverterHTMLModel.InputPath = pdfViewer.Document.FilePath;
                 FileInfo fileinfo = new FileInfo(ConverterHTMLModel.InputPath);
-                LanguageSelectedIndex = 0;
                 ConverterHTMLModel.OutputPath = fileinfo.DirectoryName;
             }
         }

+ 1 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs

@@ -59,7 +59,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private int languageSelectedIndex = 0;
+        private int languageSelectedIndex = 2;
         public int LanguageSelectedIndex
         {
             get { return languageSelectedIndex; }
@@ -273,7 +273,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 if (currentViewer.Tag != null) { ConverterPPTModel.Pawssword = currentViewer.Tag.ToString(); }
                 ConverterPPTModel.InputPath = pdfViewer.Document.FilePath;
                 FileInfo fileinfo = new FileInfo(ConverterPPTModel.InputPath);
-                LanguageSelectedIndex = 0;
                 ConverterPPTModel.OutputPath = fileinfo.DirectoryName;
             }
         }

+ 1 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs

@@ -59,7 +59,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private int languageSelectedIndex = 0;
+        private int languageSelectedIndex = 2;
         public int LanguageSelectedIndex
         {
             get { return languageSelectedIndex; }
@@ -272,7 +272,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 if (currentViewer.Tag != null) { ConverterRTFModel.Pawssword = currentViewer.Tag.ToString(); }
                 ConverterRTFModel.InputPath = pdfViewer.Document.FilePath;
                 FileInfo fileinfo = new FileInfo(ConverterRTFModel.InputPath);
-                LanguageSelectedIndex = 0;
                 ConverterRTFModel.OutputPath = fileinfo.DirectoryName;
             }
         }

+ 1 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs

@@ -60,7 +60,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private int languageSelectedIndex = 0;
+        private int languageSelectedIndex = 2;
         public int LanguageSelectedIndex
         {
             get { return languageSelectedIndex; }
@@ -271,7 +271,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 MaxPageRange = currentViewer.Document.PageCount;
                 if (currentViewer.Tag != null) { ConverterTextModel.Pawssword = currentViewer.Tag.ToString(); }
                 ConverterTextModel.InputPath = pdfViewer.Document.FilePath;
-                LanguageSelectedIndex = 0;
                 FileInfo fileinfo = new FileInfo(ConverterTextModel.InputPath);
                 ConverterTextModel.OutputPath=fileinfo.DirectoryName;
             }

+ 1 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs

@@ -59,7 +59,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private int languageSelectedIndex = 0;
+        private int languageSelectedIndex = 2;
         public int LanguageSelectedIndex
         {
             get { return languageSelectedIndex; }
@@ -291,7 +291,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 MaxPageRange = currentViewer.Document.PageCount;
                 if (currentViewer.Tag != null) { ConverterWordModel.Pawssword = currentViewer.Tag.ToString(); }
                 ConverterWordModel.InputPath = pdfViewer.Document.FilePath;
-                LanguageSelectedIndex = 0;
                 FileInfo fileinfo = new FileInfo(ConverterWordModel.InputPath);
                 ConverterWordModel.OutputPath = fileinfo.DirectoryName;
             }

+ 1 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs

@@ -197,7 +197,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             }
         }
 
-        private int languageSelectedIndex = 0;
+        private int languageSelectedIndex = 2;
         public int LanguageSelectedIndex
         {
             get { return languageSelectedIndex; }

+ 1 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateTextContentViewModel.cs

@@ -617,6 +617,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             if (Index == 0)
             {
                 WatermarkInfo.IsRelativeScale = true;
+                WatermarkInfo.TextSize = 0.5f;
             }
             else
             {

+ 0 - 1
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogViewModel.cs

@@ -252,7 +252,6 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
 
         public void SetOpenPassword(object e)
         {
-            MessageBoxEx.Show("");
             var chk = e as CheckBox;
             if (chk != null)
             {

+ 1 - 1
PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs

@@ -136,7 +136,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
 
         public void ConfirmEditTool()
         {
-            this.eventAggregator.GetEvent<ConfirmEditToolsBackgroundEvent>().Publish();
+            this.eventAggregator.GetEvent<ConfirmEditToolsBackgroundEvent>().Publish(Unicode);
             this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish(new EnumCloseModeUnicode { Unicode=Unicode,Status= EnumCloseMode.StatusConfirm });
         }
 

+ 3 - 2
PDF Office/ViewModels/EditTools/Background/BackgroundDocumentContentViewModel.cs

@@ -91,7 +91,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
            ShowInputIndexBoxCommand = new DelegateCommand<object>(ShowInputIndexBox);
             GoToPageCommand = new DelegateCommand<object>(GoToPage);
 
-            eventAggregator.GetEvent<ConfirmEditToolsBackgroundEvent>().Subscribe(ConfirmEditToolsBackground);
+            eventAggregator.GetEvent<ConfirmEditToolsBackgroundEvent>().Subscribe(ConfirmEditToolsBackground,e=> e== Unicode);
             eventAggregator.GetEvent<SetBackgroundEvent>().Subscribe(SetBackground, e => e.Unicode == Unicode);
             eventAggregator.GetEvent<DeleteBackgroundEvent>().Subscribe(DeleteBackground, e => e.Unicode == Unicode);
             ViewerRegionName = RegionNames.BackgroundViewerRegionName;
@@ -123,7 +123,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
             }
         }
 
-        public void ConfirmEditToolsBackground()
+        public void ConfirmEditToolsBackground(string unicode)
         {
             if (EnumDelete == EnumDelete.StatusDeleteAll)
             {
@@ -245,6 +245,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
             newPage.RenderPageBitmapWithMatrix(1/(float)zoom, renderRect, 0x00FFFFFF, imageArray, 1, true);
             WriteableBitmap WirteBitmap = new WriteableBitmap((int)renderRect.Width, (int)renderRect.Height, 96, 96, PixelFormats.Bgra32, null);
             WirteBitmap.WritePixels(new Int32Rect(0, 0, (int)renderRect.Width, (int)renderRect.Height), imageArray, WirteBitmap.BackBufferStride, 0);
+            newDoc.Release();
             return WirteBitmap;
         }
 

+ 1 - 0
PDF Office/ViewModels/EditTools/Bates/BatesDocumentContentViewModel.cs

@@ -228,6 +228,7 @@ namespace PDF_Office.ViewModels.EditTools.Bates
             newPage.RenderPageBitmapWithMatrix(1 / (float)zoom, renderRect, 0x00FFFFFF, imageArray, 1, true);
             WriteableBitmap WirteBitmap = new WriteableBitmap((int)renderRect.Width, (int)renderRect.Height, 96, 96, PixelFormats.Bgra32, null);
             WirteBitmap.WritePixels(new Int32Rect(0, 0, (int)renderRect.Width, (int)renderRect.Height), imageArray, WirteBitmap.BackBufferStride, 0);
+            newDoc.Release();
             return WirteBitmap;
         }
 

+ 1 - 0
PDF Office/ViewModels/EditTools/HeaderFooter/HeaderFooterDocumentContentViewModel.cs

@@ -241,6 +241,7 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
             newPage.RenderPageBitmapWithMatrix(1 / (float)zoom, renderRect, 0x00FFFFFF, imageArray, 1, true);
             WriteableBitmap WirteBitmap = new WriteableBitmap((int)renderRect.Width, (int)renderRect.Height, 96, 96, PixelFormats.Bgra32, null);
             WirteBitmap.WritePixels(new Int32Rect(0, 0, (int)renderRect.Width, (int)renderRect.Height), imageArray, WirteBitmap.BackBufferStride, 0);
+            newDoc.Release();
             return WirteBitmap;
         }
 

+ 1 - 1
PDF Office/ViewModels/EditTools/Watermark/WatermarkContentViewModel.cs

@@ -137,7 +137,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
 
         public void ConfirmEditTool()
         {
-            this.eventAggregator.GetEvent<ConfirmEditToolsWatermarkEvent>().Publish();
+            this.eventAggregator.GetEvent<ConfirmEditToolsWatermarkEvent>().Publish(Unicode);
             this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish(new EnumCloseModeUnicode { Unicode = Unicode, Status = EnumCloseMode.StatusConfirm });
         }
 

+ 1 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs

@@ -699,6 +699,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             {
                 
                 WatermarkInfo.IsRelativeScale=true;
+                WatermarkInfo.TextSize = 0.5f;
             }
             else
             {

+ 11 - 8
PDF Office/ViewModels/EditTools/Watermark/WatermarkDocumentContentViewModel.cs

@@ -30,6 +30,7 @@ using static System.Windows.Forms.VisualStyles.VisualStyleElement;
 using System.Text.RegularExpressions;
 using TextBox = System.Windows.Controls.TextBox;
 using PDFSettings;
+using DryIoc;
 
 namespace PDF_Office.ViewModels.EditTools.Watermark
 {
@@ -95,7 +96,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             Unicode = App.mainWindowViewModel.SelectedItem.Unicode;
             eventAggregator.GetEvent<SetWatermarkEvent>().Subscribe(SetWatermark, e => e.Unicode == Unicode);
             ViewerRegionName = RegionNames.WatermarkViwerRegionName;
-            eventAggregator.GetEvent<ConfirmEditToolsWatermarkEvent>().Subscribe(ConfirmEditToolsWatermark);
+            eventAggregator.GetEvent<ConfirmEditToolsWatermarkEvent>().Subscribe(ConfirmEditToolsWatermark,e=>e==Unicode);
             eventAggregator.GetEvent<DeleteWatermarkEvent>().Subscribe(DeleteWatermark, e => e.Unicode == Unicode);
         }
 
@@ -125,7 +126,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             }
         }
 
-        public void ConfirmEditToolsWatermark()
+        public void ConfirmEditToolsWatermark(string unicode)
         {
             if (EnumDelete == EnumDelete.StatusDeleteAll)
             {
@@ -221,6 +222,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
 
                     watermark.SetPages(watermarkInfo.PageRange);
                 }
+
                 Trace.WriteLine("IsCreateWatermark: " + watermark.CreateWatermark());
                 Trace.WriteLine("IsUpdateWatermark: " + watermark.UpdateWatermark());
             }
@@ -244,13 +246,13 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                         char[] rangeSeparator = new char[] { '-' };
                         if (CommonHelper.GetPagesInRange(ref PageIndexLists, watermarkInfo.PageRange, Document.PageCount, enumerationSeparator, rangeSeparator, true))
                         { //TODO
-                            Trace.WriteLine(CommonHelper.GetPagesInRange(ref PageIndexLists, watermarkInfo.PageRange, Document.PageCount, enumerationSeparator, rangeSeparator, true));
-                            Trace.WriteLine(drawPageData.PageIndex);
-                            foreach (var abbb in PageIndexLists)
-                            {
+                            //Trace.WriteLine(CommonHelper.GetPagesInRange(ref PageIndexLists, watermarkInfo.PageRange, Document.PageCount, enumerationSeparator, rangeSeparator, true));
+                            //Trace.WriteLine(drawPageData.PageIndex);
+                            //foreach (var abbb in PageIndexLists)
+                            //{
 
-                                Trace.WriteLine("smgui _______" + abbb);
-                            }
+                            //    Trace.WriteLine("smgui _______" + abbb);
+                            //}
                             if (PageIndexLists.Contains(drawPageData.PageIndex - 1))
                             {
                                 if (watermarkInfo.WatermarkType == C_Watermark_Type.WATERMARK_TYPE_TEXT && watermarkInfo.Text != "")
@@ -285,6 +287,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             newPage.RenderPageBitmapWithMatrix(1 / (float)zoom, renderRect, 0x00FFFFFF, imageArray, 1, true);
             WriteableBitmap WirteBitmap = new WriteableBitmap((int)renderRect.Width, (int)renderRect.Height, 96, 96, PixelFormats.Bgra32, null);
             WirteBitmap.WritePixels(new Int32Rect(0, 0, (int)renderRect.Width, (int)renderRect.Height), imageArray, WirteBitmap.BackBufferStride, 0);
+            newDoc.Release();
             return WirteBitmap;
         }
 

+ 9 - 0
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs

@@ -3,6 +3,7 @@ using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using PDF_Office.Model.PDFTool;
+using PDF_Office.Views;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -162,6 +163,14 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
                         printvalue.Add(ParameterNames.PDFViewer, viewer);
                         printvalue.Add(ParameterNames.FilePath, dlg.FileName);
                         dialogs.ShowDialog(DialogNames.HomePagePrinterDialog, printvalue, e => { });
+                        try
+                        {
+                            dialogs.ShowDialog("MainWindow");
+                        }
+                        catch
+                        {
+
+                        }
                         break;
 
                     case PDFFnType.Security:

+ 23 - 13
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StampAnnotPropertyViewModel.cs

@@ -128,7 +128,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-        private int cusListboxIndex=-1;
+        private int cusListboxIndex = -1;
 
         public int CusListboxIndex
         {
@@ -140,7 +140,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         }
 
 
-        
+
         private bool unStandard;
         /// <summary>
         /// 判断当前是否为非标准图章,控制UI展示
@@ -244,6 +244,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        public void SetDynamicStamp(Stamp stamp)
+        {
+            int index = DynamicStampList.IndexOf(stamp);
+            UpDataDynamicStampList();
+            SetStamp(DynamicStampList[index]);
+        }
+
         /// <summary>
         /// 在PDFView上创建图章的统一方法
         /// </summary>
@@ -293,19 +300,15 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         /// </summary>
         public void UpDataDynamicStampList()
         {
-            CPDFDocument doc = CPDFDocument.CreateDocument();
-            bool tt = doc.InsertPage(0, 300, 500, null);
-            CPDFPage docPage = doc.PageAtIndex(0);
-            CPDFStampAnnotation stampCore = docPage.CreateAnnot(C_ANNOTATION_TYPE.C_ANNOTATION_STAMP) as CPDFStampAnnotation;
-            var x = stampCore.GetTextAttribute();
-            DynamicStampList.Clear();
+
+            string time = System.DateTime.Now.ToString(dateType);
             for (int i = 0; i < DynamicStampText.Count; i++)
             {
                 string date = "";
                 //区分机密(CONFIDENTIAL)和其他动态图章的区别
                 if (i < DynamicStampText.Count - 1)
                 {
-                    date = System.DateTime.Now.ToString(dateType);
+                    date = time;
                 }
 
                 Stamp standardStamp = new Stamp();
@@ -361,7 +364,14 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     default:
                         break;
                 }
-                DynamicStampList.Add(standardStamp);
+                if (DynamicStampList.Count== DynamicStampText.Count)
+                {
+                    DynamicStampList[i] = standardStamp;
+                }
+                else
+                {
+                    DynamicStampList.Add(standardStamp);
+                }
             }
         }
 
@@ -539,7 +549,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             stamp.TextSharp = (TextStampSharp)(int)viewModel.Shape;
             stamp.IsCheckedDate = viewModel.IsCheckedDate;
             stamp.IsCheckedTime = viewModel.IsCheckedTime;
-            int index= CustomStampList.IndexOf(oldstamp);
+            int index = CustomStampList.IndexOf(oldstamp);
             CustomStampList[index] = stamp;
 
             PDFSettings.CustomStampList stamps = Settings.Default.CustomStampList;
@@ -585,7 +595,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
                 stamp.SourcePath = viewModel.SaveToPath;
             }
-         
+
             stamp.StampText = viewModel.StampText;
             stamp.MaxWidth = (int)DpiHelpers.GetDpiUnrelatedNum(viewModel.StampWidth / 72D * DpiHelpers.Dpi);
             stamp.MaxHeight = (int)DpiHelpers.GetDpiUnrelatedNum(viewModel.StampHeight / 72D * DpiHelpers.Dpi);
@@ -619,7 +629,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             Settings.Default.Save();
 
             SetStamp(stamp);
-            CusListboxIndex = CustomStampList.Count-1;
+            CusListboxIndex = CustomStampList.Count - 1;
         }
     }
 }

+ 3 - 3
PDF Office/ViewModels/PropertyPanel/FontSetModeVM.cs

@@ -116,7 +116,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
             {
                 bool isChange = IsEqualComboData(_fontSizeData, value);
 
-                if(value.Value > 0)
+                if(isChange && value.Value > 0)
                 SetProperty(ref _fontSizeData, value);
 
                 if (isChange && value.Value > 0)
@@ -151,7 +151,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
             get { return _fontWeightStyleItem; }
             set
             {
-                bool isChange = IsEqualStrComboData(_presetTextData, value);
+                bool isChange = IsEqualStrComboData(_fontWeightStyleItem, value);
                 SetProperty(ref _fontWeightStyleItem, value);
                 if (isChange)
                 {
@@ -234,7 +234,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
         }
         private bool IsEqualStrComboData(ComboDataItem oldValue, ComboDataItem newValue)
         {
-            if (newValue == null && string.IsNullOrEmpty(newValue.ValueStr) == true || IsCanSave == false)
+            if (newValue == null || string.IsNullOrEmpty(newValue.ValueStr) == true || IsCanSave == false)
                 return false;
 
             if (oldValue != null && newValue != null)

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/PDFEdit/ImageEditPropertyViewModel.cs

@@ -358,7 +358,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
             var tranUI = (TextEditEvent.Transparent / 255.0)*100;
             var temp = Math.Round((double)tranUI, 0);
             Transpent = temp;
-
+            OpacityUI = temp/100.0;
 
         }
         //点击空白处时

+ 32 - 7
PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs

@@ -24,7 +24,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
     public class TextEditPropertyViewModel : PDFEditVM, INavigationAware
     {
         #region
-         
+        private bool isSelectedEmpty;
+        public bool IsSelectedEmpty
+        {
+            get { return isSelectedEmpty; }
+            set { SetProperty(ref isSelectedEmpty, value); }
+        }
         private ComPDFKit.PDFPage.Edit.TextAlignType _textAlign;
         public ComPDFKit.PDFPage.Edit.TextAlignType TextAlign
         {
@@ -420,6 +425,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
                 {
                     TextEditEvent = TextEditEventList[0];
                     GetPDFEdit();
+                    if (TextEditEventList.Count > 1)
+                        IsSelectedEmpty = true;
+                    else
+                        IsSelectedEmpty = false;
 
                     if (TextEditEventList.Count == 2)
                     {
@@ -458,11 +467,26 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
                             var item = FontStyleList.FirstOrDefault(temp => temp.mTag == (string)sender);
                             if (item != null && TextEditEvent != null)
                             {
-                                TextEditEvent.FontFamily = item.mFontFamily;
-                                TextEditEvent.FontSize = item.mFontSize;
-                                TextEditEvent.FontWeight = item.mFontWeight;
-                                TextEditEvent.FontStyle = item.mFontStyle;
-                                TextEditEvent.UpdatePDFEditByEventArgs();
+                                if(TextEditEventList.Count == 1 && IsSelectedEmpty == false)
+                                {
+                                    TextEditEvent.FontFamily = item.mFontFamily;
+                                    TextEditEvent.FontSize = item.mFontSize;
+                                    TextEditEvent.FontWeight = item.mFontWeight;
+                                    TextEditEvent.FontStyle = item.mFontStyle;
+                                    TextEditEvent.UpdatePDFEditByEventArgs();
+                                }
+                                else
+                                {
+                                    foreach (var itemlist in TextEditEventList)
+                                    {
+                                        itemlist.FontFamily = item.mFontFamily;
+                                        itemlist.FontSize = item.mFontSize;
+                                        itemlist.FontWeight = item.mFontWeight;
+                                        itemlist.FontStyle = item.mFontStyle;
+                                        itemlist.UpdatePDFEditByEventArgs();
+                                    }
+                                }
+                                
                             }
                         }
                         break;
@@ -512,7 +536,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
 
         private void  GetPDFEdit()
         {
-            if (TextEditEvent != null)
+            if (TextEditEvent != null && TextEditEventList.Count == 1)
             {
                 SelectColor = new SolidColorBrush(TextEditEvent.FontColor);
                 FontSizeData = new ComboDataItem(TextEditEvent.FontSize);
@@ -533,6 +557,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
         {
             IsCanSave = false;
             TextEditEvent = null;
+            IsSelectedEmpty = false;
             ClearCheckedAglin?.Invoke(null, null);
             PDFViewer.PDFEditCommandHandler -= PDFViewer_PDFEditCommandHandler;
             ChangedValue -= FontMode_ChangedValue;

+ 10 - 2
PDF Office/ViewModels/Scan/ScanViwerViewModel.cs

@@ -423,6 +423,10 @@ namespace PDF_Office.ViewModels.Scan
             {
                 CIMEngine imEngine = new CIMEngine(App.modelFolderPath);
                 CErrorCode error = imEngine.SetModel();
+                if (error!= CErrorCode.E_DA_SUCCESS)
+                {
+                    return;
+                }
 
                 //显示进度条
                 App.mainWindowViewModel.IsProcessVisible = Visibility.Visible;
@@ -502,7 +506,10 @@ namespace PDF_Office.ViewModels.Scan
                 CPDFDocument CurrentDoc = PDFViewer.Document;
 
                 CErrorCode error = imEngine.SetModel((COCRLanguage)args.ScanLanguage);
-
+                if (error != CErrorCode.E_DA_SUCCESS)
+                {
+                    return;
+                }
                 cacahe.Clear();
 
                 //显示进度条
@@ -642,7 +649,8 @@ namespace PDF_Office.ViewModels.Scan
                 {
                     CPDFPage pdfPage = PDFViewer.Document.PageAtIndex(i);
                     CPDFEditPage editPage = pdfPage.GetEditPage();
-                    editPage.BeginEdit(CPDFEditType.EditText);
+                    //2023.2.17版本的SDK不能使用EditText枚举,会有内存问题
+                    editPage.BeginEdit(CPDFEditType.EditImage);
                     for (int y = textRectList.Count - 1; y >= 0; y--)
                     {
                         KeyValuePair<Rect, string> textBlock = textRectList[y];

+ 580 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -0,0 +1,580 @@
+using ComPDFKit.PDFAnnotation;
+using ComPDFKitViewer;
+using ComPDFKitViewer.AnnotEvent;
+using ComPDFKitViewer.PdfViewer;
+using PDF_Office.CustomControl;
+using PDF_Office.EventAggregators;
+using PDF_Office.Helper;
+using PDF_Office.Properties;
+using PDF_Office.ViewModels.BOTA;
+using PDF_Office.Views.BOTA;
+using PDFSettings;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
+using System.Windows.Media;
+
+namespace PDF_Office.ViewModels.Tools
+{
+    public sealed partial class AnnotToolContentViewModel : BindableBase, INavigationAware
+    {
+        #region 事件绑定和解绑
+        private void BindingEvent()
+        {
+            //属性面板与注释工具栏绑定:属性面板的属性变化,会同步注释工具栏的属性值
+            //比如在属性面板里更改注释颜色,会同时更新工具栏对应的工具颜色
+            propertyPanel.DataChanged -= AnnotPropertyPanel_DataChanged;
+            propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
+            propertyPanel.DefaultStored -= AnnotProperty_DefaultStored;
+            propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
+            propertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
+            propertyPanel.AnnotTypeChanged += AnnotPropertyPanel_AnnotTypeChanged;
+        }
+
+        private void UnBindingEvent()
+        {
+            propertyPanel.DataChanged -= AnnotPropertyPanel_DataChanged;
+            propertyPanel.DefaultStored -= AnnotProperty_DefaultStored;
+            propertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
+        }
+
+        private void BindingPDFViewerHandler()
+        {
+            //来自PDFViewer的响应事件
+            if (PDFViewer != null)
+            {
+                PDFViewer.AnnotEditHandler -= PDFViewer_AnnotEditHandler;
+                PDFViewer.AnnotEditHandler += PDFViewer_AnnotEditHandler;
+
+                PDFViewer.AnnotActiveHandler -= PDFViewer_AnnotActiveHandler;
+                PDFViewer.AnnotActiveHandler += PDFViewer_AnnotActiveHandler;
+
+                PDFViewer.AnnotCommandHandler -= PDFViewer_AnnotCommandHandler;
+                PDFViewer.AnnotCommandHandler += PDFViewer_AnnotCommandHandler;
+
+                PDFViewer.WidgetClickHander -= PDFViewer_WidgetClickHander;
+                PDFViewer.WidgetClickHander += PDFViewer_WidgetClickHander;
+
+                PDFViewer.SnapshotCommandHandler -= PDFViewer_SnapshotCommandHandler;
+                PDFViewer.SnapshotCommandHandler += PDFViewer_SnapshotCommandHandler;
+            }
+        }
+        private void UnBindingPDFViewerHandler()
+        {
+            if (PDFViewer != null)
+            {
+                PDFViewer.AnnotEditHandler -= PDFViewer_AnnotEditHandler;
+                PDFViewer.AnnotActiveHandler -= PDFViewer_AnnotActiveHandler;
+                PDFViewer.AnnotCommandHandler -= PDFViewer_AnnotCommandHandler;
+                PDFViewer.WidgetClickHander -= PDFViewer_WidgetClickHander;
+                PDFViewer.SnapshotCommandHandler -= PDFViewer_SnapshotCommandHandler;
+            }
+        }
+        #endregion
+
+        #region PDFViewer事件
+        //选中和非选中注释,右键菜单
+        private void PDFViewer_AnnotActiveHandler(object sender, AnnotAttribEvent e)
+        {
+            if (e != null)
+            {
+                var annot = e.AnnotItemsList[0];
+                if (annot != null)
+                {
+                    //IsAnnotCreateReset:是否为创建注释的状态
+                    if (e.AnnotItemsList.Count == 1 && e.IsAnnotCreateReset == false)
+                    {
+                        switch (annot.EventType)
+                        {
+                            case AnnotArgsType.AnnotHighlight:
+                                e.IsAnnotCreateReset = false;
+                                GetHighLight(annot as TextHighlightAnnotArgs);
+                                break;
+
+                            case AnnotArgsType.AnnotUnderline:
+                                GetUnderLine(annot as TextUnderlineAnnotArgs);
+                                break;
+
+                            case AnnotArgsType.AnnotStrikeout:
+                                GetStrikeout(annot as TextStrikeoutAnnotArgs);
+                                break;
+
+                            case AnnotArgsType.AnnotSquiggly:
+                                GetSquiggly(annot as TextSquigglyAnnotArgs);
+                                break;
+
+                            case AnnotArgsType.AnnotFreehand:
+                                GetFreehand(annot as FreehandAnnotArgs);
+                                break;
+
+                            case AnnotArgsType.AnnotFreeText:
+                                GetFreetext(annot as FreeTextAnnotArgs);
+                                break;
+
+                            case AnnotArgsType.AnnotSquare:
+                                GetRect(annot as SquareAnnotArgs);
+                                break;
+
+                            case AnnotArgsType.AnnotCircle:
+                                GetCircle(annot as CircleAnnotArgs);
+                                break;
+
+                            case AnnotArgsType.AnnotLine:
+                                bool isLine = true;
+                                if (e.Attribs.ContainsKey(AnnotAttrib.LineStart))
+                                {
+                                    if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_NONE)
+                                    {
+                                        isLine = false;
+                                    }
+                                }
+                                if (e.Attribs.ContainsKey(AnnotAttrib.LineEnd))
+                                {
+                                    if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_NONE)
+                                    {
+                                        isLine = false;
+                                    }
+                                }
+
+                                if (isLine)
+                                    GetArrowLine("Line", annot as LineAnnotArgs);
+                                else
+                                    GetArrowLine("Arrow", annot as LineAnnotArgs);
+
+                                break;
+
+                            case AnnotArgsType.AnnotLink:
+                                viewContentViewModel.IsCreateLink = false;
+                                GetLink(annot as LinkAnnotArgs, e);
+
+                                break;
+
+                            case AnnotArgsType.AnnotSticky:
+                                GetStickyNote(annot as StickyAnnotArgs);
+                                break;
+                        }
+                        //记录这次选中的注释,之后创建注释会跟随上次选中注释的属性值
+                        PDFViewer.SetToolParam(annot);
+
+                    }
+                    else if (e.AnnotItemsList.Count == 1 && e.IsAnnotCreateReset == true)
+                    {
+                        switch (annot.EventType)
+                        {
+                            case AnnotArgsType.AnnotLink:
+                                viewContentViewModel.IsCreateLink = false;
+                                GetLink(annot as LinkAnnotArgs, e);
+                                break;
+
+                                //case AnnotArgsType.AnnotStamp://图章
+                                //    GetStamp();
+                                //    break;
+
+                                //case AnnotArgsType.AnnotStamp://签名
+                                //    annotArgs = GetSignature();
+                                //    isTemplateAnnot = true;
+                                //    break;
+                        }
+                        PDFViewer.SetToolParam(annot);
+                        //TODO: 设计已重新调整为:修改注释后,会作用到之后添加的注释中。因此先把此逻辑“创建注释后,会自动回到默认值”注释掉
+                        //if (ToolExpandDict.ContainsValue(e.AnnotItemsList[0].EventType))
+                        //{
+                        //    foreach (var item in ToolExpandDict)
+                        //    {
+                        //        if (item.Value == e.AnnotItemsList[0].EventType)
+                        //        {
+                        //            FindAnnotTypeKey(item.Key, ref annot);
+                        //            break;
+                        //        }
+                        //    }
+                        //}
+                        ShowPropertyPanel();
+                    }
+                }
+            }
+            else
+            {
+                viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+            }
+        }
+
+        //在注释工具的状态下,右键菜单
+        private void PDFViewer_AnnotCommandHandler(object sender, AnnotCommandArgs e)
+        {
+            if (e.AnnotEventArgsList == null || (PDFViewer != null && PDFViewer.MouseMode == MouseModes.FormEditTool))
+                return;
+
+            switch (e.CommandType)
+            {
+                case CommandType.Context:
+                    if (e.AnnotEventArgsList.Count > 0)
+                    {
+                        if (App.mainWindowViewModel.SelectedItem.IsInReadctonMode && e.AnnotEventArgsList[0].EventType == AnnotArgsType.AnnotRedaction)
+                        {
+                            //绑定标记密文处右键菜单
+                            events.GetEvent<RedactionCommandEvent>().Publish(new RedactionCommandEventArgs() { UniCode = App.mainWindowViewModel.SelectedItem.Unicode, Sender = sender, args = e });
+                        }
+                        else
+                        {
+                            e.PopupMenu = SelectAnnotContextMenu(sender);
+                        }
+                        if (e.PopupMenu != null)
+                        {
+                            e.Handle = true;
+                        }
+                    }
+                    else
+                    {
+                        if (e.PressOnSelectedText)
+                        {
+                            e.PopupMenu = NoneSelectAnnotContextMenu(sender, e);
+                            if (e.PopupMenu != null)
+                            {
+                                e.Handle = true;
+                            }
+                        }
+                        else
+                        {
+                            e.PopupMenu = ViewerContextMenu();
+                            if (e.PopupMenu != null)
+                            {
+                                e.Handle = true;
+                            }
+                        }
+                    }
+
+                    break;
+            }
+        }
+        
+        private void PDFViewer_SnapshotCommandHandler(object sender, SnapshotCommandArgs e)
+        {
+            SnapshotEditToolArgs snapToolArgs = (SnapshotEditToolArgs)PDFViewer.ToolManager.CurrentAnnotArgs;
+
+            SnapshotEditMenuViewModel.SnapToolArgs = snapToolArgs;
+            SnapshotEditMenuViewModel.PDFViewer = PDFViewer;
+            SnapshotEditMenuViewModel.SnapToolEvent += SnapshotEditMenuViewModel_SnapToolEvent; ;
+            var popMenu = App.Current.FindResource("SnapshotContextMenu") as ContextMenu;
+
+            if (e.HitSnapshotTool && e.SnapshotRect.Width > 0 && e.SnapshotRect.Height > 0)
+            {
+                e.PopupMenu = popMenu;
+                e.Handle = true;
+
+                if (popMenu != null && popMenu.Items.Count == 5)
+                {
+                    //复制
+                    MenuItem menuItem = popMenu.Items[0] as MenuItem;
+                    menuItem.CommandTarget = PDFViewer;
+                    menuItem.Command = SnapshotEditMenuViewModel.SnapCopyCommand;
+                    //导出
+                    menuItem = popMenu.Items[1] as MenuItem;
+                    menuItem.CommandTarget = PDFViewer;
+                    if (menuItem.Items.Count == 3)
+                    {
+                        MenuItem menuItem1 = menuItem.Items[0] as MenuItem;
+                        menuItem1.CommandTarget = PDFViewer;
+                        menuItem1.Command = SnapshotEditMenuViewModel.ExportPNGCommand;
+
+                        menuItem1 = menuItem.Items[1] as MenuItem;
+                        menuItem1.CommandTarget = PDFViewer;
+                        menuItem1.Command = SnapshotEditMenuViewModel.ExportJPGCommand;
+
+                        menuItem1 = menuItem.Items[2] as MenuItem;
+                        menuItem1.CommandTarget = PDFViewer;
+                        menuItem1.Command = SnapshotEditMenuViewModel.ExportPDFCommand;
+                    }
+
+                    //裁剪
+                    menuItem = popMenu.Items[2] as MenuItem;
+                    menuItem.CommandTarget = PDFViewer;
+                    menuItem.Command = SnapshotEditMenuViewModel.CroppingCommand;
+
+                    //缩放至所选区域
+                    menuItem = popMenu.Items[3] as MenuItem;
+                    menuItem.CommandTarget = PDFViewer;
+                    menuItem.Visibility = Visibility.Collapsed;
+                    //menuItem.Command = snapshotEditMenuViewModel.CroppingCommand;
+
+                    //打印
+                    menuItem = popMenu.Items[4] as MenuItem;
+                    menuItem.CommandTarget = PDFViewer;
+                    menuItem.Command = SnapshotEditMenuViewModel.PrintCommand;
+                }
+            }
+        }
+        private void SnapshotEditMenuViewModel_SnapToolEvent(object sender, KeyValuePair<string, object> e)
+        {
+            switch (e.Key)
+            {
+                case "CloseSnap":
+                    {
+                        #region to do
+
+                        //var item = PDFViewerTab.SelectedItem as TabItem;
+                        //if (item == null)
+                        //{
+                        //    ClearSelectedToolPanel();
+                        //    return;
+                        //}
+                        //Grid grid = item.Content as Grid;
+                        //if (grid == null || grid.Children.Count == 0)
+                        //{
+                        //    ClearSelectedToolPanel();
+                        //    return;
+                        //}
+                        //PDFViewerCtrl pdfViewer = grid.Children[0] as PDFViewerCtrl;
+                        //if (pdfViewer == null)
+                        //{
+                        //    ClearSelectedToolPanel();
+                        //    return;
+                        //}
+
+                        #endregion to do
+
+                        switch (PDFViewer.MouseMode)
+                        {
+                            case MouseModes.SelectTextTool:
+                                break;
+
+                            default:
+                                BtnSelecttoolIsChecked = false;
+                                break;
+                        }
+                    }
+                    break;
+
+                default:
+                    break;
+            }
+        }
+
+
+        private void PDFViewer_AnnotEditHandler(object sender, List<AnnotEditEvent> e)
+        {
+            if (e != null && e.Count > 0)
+            {
+                for (int i = 0; i < e.Count; i++)
+                {
+                    AnnotEditEvent editEvent = e[i];
+                    switch (editEvent.EditAction)
+                    {
+                        case ActionType.Add:
+                            BOTAContentViewModel bOTAContentViewModel = null;
+                            BOTAContent bOTAContent = null;
+                            bool isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
+
+                            if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true)
+                            {
+                                AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel);
+
+                                if (viewModel != null)
+                                {
+                                    int pageindex = editEvent.PageIndex;
+                                    int annotindex = editEvent.AnnotIndex;
+                                    viewModel.UpdateAddedAnnot(pageindex, annotindex);
+                                }
+                            }
+                            break;
+
+                        case ActionType.Del:
+                            isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
+                            if (isTabItemAnnotation)
+                            {
+                                AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel);
+
+                                if (viewModel != null)
+                                {
+                                    int pageindex = editEvent.PageIndex;
+                                    int annotindex = editEvent.AnnotIndex;
+                                    viewModel.UpdateModifiedAnnot(pageindex, annotindex, true);
+                                }
+                            }
+                            break;
+
+                        case ActionType.Modify:
+                            isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
+                            if (isTabItemAnnotation)
+                            {
+                                AnnotationContentViewModel viewModel = GetAnnotationContentViewModel(bOTAContentViewModel);
+
+                                if (viewModel != null)
+                                {
+                                    int pageindex = editEvent.PageIndex;
+                                    int annotindex = editEvent.AnnotIndex;
+                                    viewModel.UpdateModifiedAnnot(pageindex, annotindex, false);
+                                }
+                            }
+                            break;
+
+                        case ActionType.TextEdit:
+                            break;
+
+                        default:
+                            break;
+                    }
+                }
+            }
+        }
+
+        private void PDFViewer_WidgetClickHander(object sender, WidgetArgs e)
+        {
+        }
+        #endregion
+
+        #region BindingEvent事件
+        private void AnnotProperty_DefaultStored(object sender, object e)
+        {
+
+        }
+
+        private void AnnotPropertyPanel_AnnotTypeChanged(object sender, Dictionary<AnnotArgsType, object> e)
+        {
+            if (e != null)
+            {
+                AnnotHandlerEventArgs annotArgs = null;
+                foreach (AnnotArgsType argsType in e.Keys)
+                {
+                    switch (argsType)
+                    {
+                        case AnnotArgsType.AnnotSquare:
+                            annotArgs = GetRect();
+                            break;
+
+                        case AnnotArgsType.AnnotCircle:
+                            annotArgs = GetCircle();
+                            break;
+
+                        case AnnotArgsType.AnnotLine:
+                            var LineTag = e[argsType] as string;
+                            annotArgs = GetArrowLine(LineTag);
+                            break;
+                    }
+                    if (annotArgs != null)
+                    {
+                        annotArgs.Author = Settings.Default.AppProperties.Description.Author;
+                        PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                        PDFViewer.SetToolParam(annotArgs);
+                    }
+                    ShowPropertyPanel();
+                }
+            }
+        }
+
+        private void AnnotPropertyPanel_DataChanged(object sender, Dictionary<AnnotArgsType, object> e)
+        {
+            if (e != null)
+            {
+                foreach (AnnotArgsType argsType in e.Keys)
+                {
+                    switch (argsType)
+                    {
+                        case AnnotArgsType.AnnotHighlight:
+                            if (e[argsType] is Color)
+                            {
+                                HighLightColor = new SolidColorBrush((Color)e[argsType]);
+                            }
+                            if (e[argsType] is double)
+                            {
+                                HighLightOpacity = (double)e[argsType];
+                            }
+                            break;
+
+                        case AnnotArgsType.AnnotUnderline:
+                            if (e[argsType] is Color)
+                            {
+                                UnderLineColor = new SolidColorBrush((Color)e[argsType]);
+                            }
+                            if (e[argsType] is double)
+                            {
+                                underLineOpacity = (double)e[argsType];
+                            }
+                            break;
+
+                        case AnnotArgsType.AnnotSquiggly:
+                            if (e[argsType] is Color)
+                            {
+                                SquigglyColor = new SolidColorBrush((Color)e[argsType]);
+                            }
+                            if (e[argsType] is double)
+                            {
+                                SquigglyOpacity = (double)e[argsType];
+                            }
+                            break;
+
+                        case AnnotArgsType.AnnotStrikeout:
+                            if (e[argsType] is Color)
+                            {
+                                StrikeoutColor = new SolidColorBrush((Color)e[argsType]);
+                            }
+                            if (e[argsType] is double)
+                            {
+                                StrikeoutOpacity = (double)e[argsType];
+                            }
+                            break;
+
+                        case AnnotArgsType.AnnotFreehand:
+                            if (e[argsType] is Color)
+                            {
+                                // FreehandPath.Fill = new SolidColorBrush((Color)e[argsType]);
+                            }
+                            if (e[argsType] is double)
+                            {
+                                //  FreehandPath.Opacity = (double)e[argsType];
+                            }
+                            break;
+
+                        case AnnotArgsType.AnnotErase:
+                            if (e[argsType] is ToggleButton)
+                            {
+                                ToggleButton clickBtn = e[argsType] as ToggleButton;
+
+                                if (clickBtn.IsChecked == true)
+                                {
+                                    if (clickBtn.Tag.ToString() == "PenBtn")
+                                    {
+                                        CustomIconToggleBtn btn = new CustomIconToggleBtn();
+                                        btn.Tag = "Freehand"; btn.IsChecked = true;
+                                        BtnMyTools_Click(btn);
+                                        break;
+                                    }
+                                    EraseArgs eraseArgs = new EraseArgs();
+                                    eraseArgs.UIBorderColor = Color.FromArgb(0x1A, 0x00, 0x00, 0x00);
+                                    eraseArgs.UIFillColor = Color.FromArgb(0x1A, 0x00, 0x00, 0x00);
+                                    eraseArgs.Thickness = 10;
+                                    DefaultAnnotProperty annotProperty = SettingHelper.GetAnnotDefaultProperty(AnnotArgsType.AnnotErase);
+                                    if (annotProperty != null)
+                                    {
+                                        eraseArgs.Thickness = annotProperty.Thickness;
+                                    }
+
+                                    PDFViewer.ClearSelectAnnots(false);
+                                    PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                                    PDFViewer.SetToolParam(eraseArgs);
+
+                                    Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
+                                    annotAttribsList[AnnotAttrib.Color] = eraseArgs.UIBorderColor;
+                                    annotAttribsList[AnnotAttrib.FillColor] = eraseArgs.UIFillColor;
+                                    annotAttribsList[AnnotAttrib.Thickness] = eraseArgs.Thickness;
+                                    AddToPropertyPanel("FreehandAnnotProperty", "Freehand", eraseArgs, annotAttribsList);
+
+                                }
+                            }
+                            break;
+                    }
+                }
+            }
+        }
+
+        #endregion
+
+    }
+
+}

+ 334 - 17
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -1,4 +1,5 @@
 using ComPDFKit.PDFAnnotation;
+using ComPDFKit.PDFDocument;
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
@@ -18,6 +19,7 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
+using System.Windows.Input;
 using System.Windows.Media;
 
 namespace PDF_Office.ViewModels.Tools
@@ -26,13 +28,8 @@ namespace PDF_Office.ViewModels.Tools
     {
         #region 初始化
 
-        private void BindingEvent()
-        {
-            propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
-            propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
-            propertyPanel.AnnotTypeChanged += AnnotPropertyPanel_AnnotTypeChanged;
-        }
-
+        #region 初始化数据
+        //初始化注释的属性值,并存在本地缓存数据集里
         private void InitDefaultValue()
         {
             InitAnnotHighlight();
@@ -117,9 +114,97 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        #endregion 初始化
+        //用来记录选中和创建注释的标识
+        private void InitToolDict()
+        {
+            ToolExpandDict.Add("SnapshotEdit", AnnotArgsType.SnapshotWithEditTool);
+            ToolExpandDict.Add("HighLight", AnnotArgsType.AnnotHighlight);
+            ToolExpandDict.Add("UnderLine", AnnotArgsType.AnnotUnderline);
+            ToolExpandDict.Add("Squiggly", AnnotArgsType.AnnotSquiggly);
+            ToolExpandDict.Add("Strikeout", AnnotArgsType.AnnotStrikeout);
+            ToolExpandDict.Add("Freehand", AnnotArgsType.AnnotFreehand);
+            ToolExpandDict.Add("Freetext", AnnotArgsType.AnnotFreeText);
+            ToolExpandDict.Add("StickyNote", AnnotArgsType.AnnotSticky);
+            ToolExpandDict.Add("Rect", AnnotArgsType.AnnotSquare);
+            ToolExpandDict.Add("Circle", AnnotArgsType.AnnotCircle);
+            ToolExpandDict.Add("Arrow", AnnotArgsType.AnnotLine);
+            ToolExpandDict.Add("Line", AnnotArgsType.AnnotLine);
+            ToolExpandDict.Add("Link", AnnotArgsType.AnnotLink);
+        }
+        #endregion
+
+        #endregion
 
         #region 注释工具
+        //注释工具
+        private void FindAnnotTypeKey(string tag, ref AnnotHandlerEventArgs annotArgs)
+        {
+            switch (tag)
+            {
+                case "SnapshotEdit"://内容选择
+                    annotArgs = GetSnapshotEdit();
+                    break;
+
+                case "HighLight"://字体高亮
+                    annotArgs = GetHighLight();
+                    break;
+
+                case "UnderLine"://下划线
+                    annotArgs = GetUnderLine();
+                    break;
+
+                case "Squiggly"://波浪线
+                    annotArgs = GetSquiggly();
+                    break;
+
+                case "Strikeout"://删除线
+                    annotArgs = GetStrikeout();
+                    break;
+
+                case "Freehand"://手绘
+                    annotArgs = GetFreehand();
+                    break;
+
+                case "Freetext"://文本
+                    annotArgs = GetFreetext();
+                    break;
+
+                case "StickyNote"://便签
+                    annotArgs = GetStickyNote();
+                    break;
+
+                case "Rect"://矩形
+                    annotArgs = GetRect();
+                    break;
+
+                case "Circle"://圆
+                    annotArgs = GetCircle();
+                    break;
+
+                case "Arrow"://箭头
+                case "Line"://线
+                    annotArgs = GetArrowLine(tag);
+                    break;
+
+                case "Stamp"://图章
+                    annotArgs = GetStamp();
+                    break;
+
+                case "Image":
+                    annotArgs = GetImage();
+                    break;
+
+                case "Signature"://签名
+                    annotArgs = GetSignature();
+                    PDFViewer.SetMouseMode(MouseModes.PanTool);//清空其他注释
+                    break;
+
+                case "Link"://链接
+                    viewContentViewModel.IsCreateLink = false;
+                    annotArgs = GetLink();
+                    break;
+            }
+        }
 
         /// <summary>
         /// 高亮注释
@@ -663,10 +748,9 @@ namespace PDF_Office.ViewModels.Tools
             return null;
         }
 
-        private AnnotHandlerEventArgs GetImage(CustomIconToggleBtn annotBtn)
+        private AnnotHandlerEventArgs GetImage()
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
-            annotBtn.IsChecked = false;
             StampAnnotArgs stampArgs = new StampAnnotArgs();
             stampArgs.Opacity = 1;
             stampArgs.Type = StampType.IMAGE_STAMP;
@@ -723,13 +807,13 @@ namespace PDF_Office.ViewModels.Tools
         /// <param name="annotAttribsList">更改注释属性的键值对,更改值后会自动记录undoRedo容器里</param>
         private void AddToPropertyPanel(string viewContent, string toolTag = null, AnnotHandlerEventArgs annot = null, Dictionary<AnnotAttrib, object> annotAttribsList = null, AnnotAttribEvent annotAttribEvent = null)
         {
-            if (string.IsNullOrEmpty(toolTag) == false)
-            {
-                if (!ToolExpandDict.ContainsKey(toolTag))
-                {
-                    ToolExpandDict[toolTag] = true;
-                }
-            }
+            //if (string.IsNullOrEmpty(toolTag) == false)
+            //{
+            //    if (!ToolExpandDict.ContainsKey(toolTag))
+            //    {
+            //        ToolExpandDict[toolTag] = true;
+            //    }
+            //}
 
             if (annot != null)
                 propertyPanel.annot = annot;
@@ -750,5 +834,238 @@ namespace PDF_Office.ViewModels.Tools
         }
 
         #endregion 注释工具
+
+
+        #region 属性面板
+
+        /// <summary>
+        /// 展开显示属性面板
+        /// </summary>
+        private void ShowPropertyPanel(bool show = true)
+        {
+            viewContentViewModel.IsPropertyOpen = show;
+        }
+
+        #endregion
+
+        #region 菜单
+
+        private ContextMenu ViewerContextMenu()
+        {
+            ContextMenu contextMenu = App.Current.FindResource("ViewerContextMenu") as ContextMenu;
+            //contextMenu.Loaded += ContextMenu_Loaded;
+            ContextMenu_Loaded(contextMenu, null);
+            return contextMenu;
+        }
+
+        private void ContextMenu_Loaded(object sender, RoutedEventArgs e)
+        {
+            ContextMenu contextMenu = sender as ContextMenu;
+            if (contextMenu.Items.Count > 0)
+            {
+                int index = PDFViewer.CurrentIndex;
+                //检测是否已存在相同数据
+                CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
+                if (list != null)
+                {
+                    isAddBookMark = false;
+                }
+                else
+                {
+                    isAddBookMark = true;
+                }
+
+                foreach (var item in contextMenu.Items)
+                {
+                    if (item is MenuItem menuItem1)
+                    {
+                        //if (menuItem1.Tag.ToString() == "DisplayAnnot" || menuItem1.Tag.ToString() == "HiddenAnnot")
+                        //{
+                        //    SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", isHiddenAnnot);
+                        //}
+
+                        switch (menuItem1.Tag.ToString())
+                        {
+                            case "Copy":
+                                //粘贴
+                                if (!ApplicationCommands.Paste.CanExecute(null, (UIElement)sender))
+                                {
+                                    menuItem1.IsEnabled = false;
+                                    menuItem1.Opacity = 0.5;
+                                }
+                                else
+                                {
+                                    menuItem1.IsEnabled = true;
+                                    menuItem1.Opacity = 1;
+                                }
+                                menuItem1.CommandTarget = (UIElement)sender;
+                                menuItem1.Command = ApplicationCommands.Copy;
+                                break;
+
+                            case "AddAnnotation":
+                                if (menuItem1.Items.Count > 0)
+                                {
+                                    SetAddAnnotation(menuItem1.Items);
+                                }
+                                break;
+
+                            case "HiddenAnnot":
+                                menuItem1.Click -= HiddenAnnot_Click;
+
+                                menuItem1.Click += HiddenAnnot_Click;
+                                SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", isHiddenAnnot);
+
+                                break;
+
+                            case "DisplayAnnot":
+
+                                menuItem1.Click -= DisplayAnnot_Click;
+                                menuItem1.Click += DisplayAnnot_Click;
+                                SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", isHiddenAnnot);
+                                break;
+
+                            case "AddBookMark":
+                                //if (isAddBookMark)
+                                //{
+                                //    menuItem1.Visibility = Visibility.Visible;
+                                //}
+                                menuItem1.Click -= AddBookMark_Click;
+                                menuItem1.Click += AddBookMark_Click;
+                                SetMenuItemVisibility(menuItem1, "DelBookMark", "AddBookMark", isAddBookMark);
+                                break;
+
+                            case "DelBookMark":
+                                //if (isAddBookMark == false)
+                                //{
+                                //    menuItem1.Visibility = Visibility.Visible;
+                                //}
+                                menuItem1.Click -= DelBookMark_Click;
+                                menuItem1.Click += DelBookMark_Click;
+                                SetMenuItemVisibility(menuItem1, "DelBookMark", "AddBookMark", isAddBookMark);
+                                break;
+
+                            case "ToolMode":
+                                if (menuItem1.Items.Count > 0)
+                                {
+                                    SetToolMode(menuItem1.Items);
+                                }
+                                break;
+
+                            case "ReadModel":
+                                SetMenuItemVisibility(menuItem1, "ReadModel", "UnReadModel", App.IsBookMode);
+                                menuItem1.Click -= ReadModel_Click;
+                                menuItem1.Click += ReadModel_Click;
+                                break;
+
+                            case "UnReadModel":
+                                SetMenuItemVisibility(menuItem1, "ReadModel", "UnReadModel", App.IsBookMode);
+                                menuItem1.Click -= UnReadModel_Click;
+                                menuItem1.Click += UnReadModel_Click;
+                                break;
+
+                            case "ViewZoom":
+                                if (menuItem1.Items.Count > 0)
+                                {
+                                    ViewZoom(menuItem1.Items);
+                                }
+                                break;
+
+                            case "PageDisplay":
+                                if (menuItem1.Items.Count > 0)
+                                {
+                                    PageDisplay(menuItem1.Items);
+                                }
+                                break;
+
+                            case "Select":
+                                menuItem1.Click -= Select_Click;
+
+                                menuItem1.Click += Select_Click;
+                                break;
+
+                            case "Print":
+                                menuItem1.Command = viewContentViewModel.PrintCommand;
+                                break;
+                        }
+                    }
+                }
+
+
+            }
+        }
+
+        private void SetMenuItemVisibility(MenuItem menuItem1, string v2, string v3, bool flag)
+        {
+            if (menuItem1.Tag.ToString() == v2 && flag)
+            {
+                menuItem1.Visibility = Visibility.Collapsed;
+            }
+            if (menuItem1.Tag.ToString() == v2 && flag == false)
+            {
+                menuItem1.Visibility = Visibility.Visible;
+            }
+            if (menuItem1.Tag.ToString() == v3 && flag == false)
+            {
+                menuItem1.Visibility = Visibility.Collapsed;
+            }
+            if (menuItem1.Tag.ToString() == v3 && flag)
+            {
+                menuItem1.Visibility = Visibility.Visible;
+            }
+        }
+
+        private ContextMenu SelectAnnotContextMenu(object sender)
+        {
+            var popMenu = App.Current.FindResource("SelectAnnotContextMenu") as ContextMenu;
+            if (popMenu != null && popMenu.Items.Count == 4)
+            {
+                //剪切
+                MenuItem menuItem = popMenu.Items[0] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Cut;
+                //复制
+                menuItem = popMenu.Items[1] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Copy;
+                //删除
+                menuItem = popMenu.Items[2] as MenuItem;
+                menuItem.CommandTarget = (UIElement)sender;
+                menuItem.Command = ApplicationCommands.Delete;
+
+                //笔记
+                //menuItem = popMenu.Items[2] as MenuItem;
+                //menuItem.CommandTarget = (UIElement)sender;
+                //menuItem.Command = ApplicationCommands.no;
+            }
+            return popMenu;
+        }
+
+        private ContextMenu NoneSelectAnnotContextMenu(object sender, AnnotCommandArgs annotCommand)
+        {
+            ContextMenu popMenu = new ContextMenu();
+            popMenu.FontSize = 14;
+
+            MenuItem menuItem = new MenuItem();
+            menuItem = new MenuItem();
+            menuItem.CommandTarget = (UIElement)sender;
+            menuItem.Command = ApplicationCommands.Copy;
+            popMenu.Items.Add(menuItem);
+
+            menuItem = new MenuItem();
+            menuItem.CommandTarget = (UIElement)sender;
+            menuItem.Command = ApplicationCommands.Paste;
+            popMenu.Items.Add(menuItem);
+
+            menuItem = new MenuItem();
+            menuItem.CommandTarget = (UIElement)sender;
+            menuItem.Header = "创建链接";
+            menuItem.CommandParameter = new object[] { this, annotCommand };
+            menuItem.Command = viewContentViewModel.CreateLinkCommand;
+            menuItem.Click += MenuItem_Click;
+            popMenu.Items.Add(menuItem);
+            return popMenu;
+        }
+        #endregion
+
     }
 }

+ 20 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -3,6 +3,9 @@ using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl;
 using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
 using Prism.Commands;
+using Prism.Events;
+using Prism.Regions;
+using Prism.Services.Dialogs;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -136,15 +139,31 @@ namespace PDF_Office.ViewModels.Tools
 
         #endregion 属性
 
+        public string PropertyRegionName { get; set; }
+        private IEventAggregator events;
+        public IDialogService dialogs;
+        public IRegionManager region;
+
         private CPDFViewer PDFViewer;
         private ViewContentViewModel viewContentViewModel;
+        private AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
+        private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
+        private bool isHiddenAnnot = true;
+        private bool isAddBookMark = true;
+        //private BookmarkContentViewModel bookmarkContentViewModel = null;
+        //private BookmarkContent bookmark = null;
+        //private BOTAContent bOTAContent = null;
+        #region 事件
         public DelegateCommand<CustomIconToggleBtn> MyToolsCommand { get; set; }
 
         private SnapshotEditMenuViewModel snapshotEditMenuViewModel = new SnapshotEditMenuViewModel();
         public SnapshotEditMenuViewModel SnapshotEditMenuViewModel { get => snapshotEditMenuViewModel; set => snapshotEditMenuViewModel = value; }
         public DelegateCommand<object> SetAddAnnotationCommand { get; set; }
 
-        private AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
+        #endregion
+
+
+
     }
 
     public enum AddAnnotType

Plik diff jest za duży
+ 151 - 883
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs


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

@@ -358,7 +358,7 @@
 
             <Image
                 Name="ImageContext"
-                Grid.Row="1"
+                Grid.Row="1" Stretch="Fill "
                 Source="{Binding WriteableBitmap}" />
             <TextBlock
                 Name="TxbContent"

+ 13 - 0
PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

@@ -76,6 +76,19 @@ namespace PDF_Office.Views.BOTA
 
                     TxbMarkupContent.Visibility = Visibility.Collapsed;
 
+                    if (args.WriteableBitmap.Width > 180)
+                    {
+                        ImageContext.Stretch = Stretch.Fill;
+                    }
+                    else if (args.WriteableBitmap.Width > 100)
+                    {
+                        ImageContext.Stretch = Stretch.Fill;
+                    }
+                    else
+                    {
+                        ImageContext.Stretch = Stretch.None;
+                    }
+
                     //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);

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateColorContent.xaml

@@ -59,7 +59,7 @@
                     <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0"   Minimum="-360" Maximum="360"  TypeSouce="{Binding RotationList,Mode=TwoWay}" Value="{Binding RotationValue, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" ></cus:CommonWritableComboBox>
 
                     <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
-                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Loaded="CommonWritableComboBox_Loaded"></cus:CommonWritableComboBox>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}" Maximum="100" Text="{Binding OpacityText,Mode=TwoWay}" Loaded="CommonWritableComboBox_Loaded"></cus:CommonWritableComboBox>
                 </StackPanel>
                 <StackPanel Orientation="Horizontal"></StackPanel>
                 <Grid Margin="0,19,0,0">

+ 1 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundCreateFileContent.xaml

@@ -45,7 +45,7 @@
                         <TextBlock Height="24" Width="24" Background= "Bisque" Margin="0,0,8,0"></TextBlock>
                         <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding RotationList, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                         <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
-                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding OpacityList, Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}"  Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding OpacityList, Mode=TwoWay}" Maximum="100" Text="{Binding OpacityText,Mode=TwoWay}"  Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal"></StackPanel>
                     <Grid Margin="0,19,0,0">

+ 2 - 2
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateFileContent.xaml

@@ -42,8 +42,8 @@
                             <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding RotationList}" Minimum="-360" Maximum="360" Unit=" " Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                         </StackPanel>
                         <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
-                            <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                            <TextBlock Width="24" Height="24" Background="Black"></TextBlock>
+                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Maximum="100" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                         </StackPanel>
                     </StackPanel>
                     <ComboBox Height="32" Margin="0,8,0,0" ItemsSource="{Binding IsFrontList}" SelectedIndex="{Binding IsFrontSelectedIndex}"></ComboBox>

+ 2 - 2
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateTextContent.xaml

@@ -61,8 +61,8 @@
                         <cus:CommonWritableComboBox  Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding RotationList,Mode=TwoWay}" Minimum="-360" Maximum="360" Unit=" " Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
-                        <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        <TextBlock Width="24" Height="24" Background="Black"></TextBlock>
+                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}"  Maximum="100" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                 </StackPanel>
                 <ComboBox Height="32" Margin="0,8,0,0" ItemsSource="{Binding IsFrontList}" SelectedIndex="{Binding IsFrontSelectedIndex}"></ComboBox>

+ 1 - 1
PDF Office/Views/EditTools/Background/BackgroundCreateColorContent.xaml

@@ -59,7 +59,7 @@
                     <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0"   Minimum="-360" Maximum="360"  TypeSouce="{Binding RotationList,Mode=TwoWay}" Value="{Binding RotationValue, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" ></cus:CommonWritableComboBox>
                     
                     <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
-                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Loaded="CommonWritableComboBox_Loaded"></cus:CommonWritableComboBox>
+                    <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Maximum="100" Value="{Binding OpacityValue,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Loaded="CommonWritableComboBox_Loaded"></cus:CommonWritableComboBox>
                 </StackPanel>
                 <StackPanel Orientation="Horizontal"></StackPanel>
                 <Grid Margin="0,19,0,0">

+ 1 - 1
PDF Office/Views/EditTools/Background/BackgroundCreateFileContent.xaml

@@ -45,7 +45,7 @@
                         <TextBlock Height="24" Width="24" Background= "Bisque" Margin="0,0,8,0"></TextBlock>
                         <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding RotationList, Mode=TwoWay}" Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                         <TextBlock Height="24" Width="24" Background="CadetBlue" Margin="0,0,8,0"></TextBlock>
-                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding OpacityList, Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}"  Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32" Margin="0,0,28,0" TypeSouce="{Binding OpacityList, Mode=TwoWay}" Maximum="100" Text="{Binding OpacityText,Mode=TwoWay}"  Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal"></StackPanel>
                     <Grid Margin="0,19,0,0">

+ 2 - 2
PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml

@@ -42,8 +42,8 @@
                             <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding RotationList}" Minimum="-360" Maximum="360" Unit=" " Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                         </StackPanel>
                         <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
-                            <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                            <TextBlock Width="24" Height="24" Background="Black"></TextBlock>
+                            <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Maximum="100" Text="{Binding OpacityText,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                         </StackPanel>
                     </StackPanel>
                     <ComboBox Height="32" Margin="0,8,0,0" ItemsSource="{Binding IsFrontList}" SelectedIndex="{Binding IsFrontSelectedIndex}"></ComboBox>

+ 2 - 2
PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml

@@ -61,8 +61,8 @@
                         <cus:CommonWritableComboBox  Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding RotationList,Mode=TwoWay}" Minimum="-360" Maximum="360" Unit=" " Text="{Binding RotationText,Mode=TwoWay}" Value="{Binding RotationValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
-                        <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
-                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
+                        <TextBlock Width="24" Height="24" Background="Black"></TextBlock>
+                        <cus:CommonWritableComboBox Width="66" Height="32" Margin="8,0,0,0" TypeSouce="{Binding OpacityList,Mode=TwoWay}" Text="{Binding OpacityText,Mode=TwoWay}" Maximum="100" Value="{Binding OpacityValue,Mode=TwoWay}"></cus:CommonWritableComboBox>
                     </StackPanel>
                 </StackPanel>
                 <ComboBox Height="32" Margin="0,8,0,0" ItemsSource="{Binding IsFrontList}" SelectedIndex="{Binding IsFrontSelectedIndex}"></ComboBox>

+ 1 - 0
PDF Office/Views/HomePanel/PDFTools/PDFToolsContent.xaml.cs

@@ -633,6 +633,7 @@ namespace PDF_Office.Views.HomePanel.PDFTools
 
         private void ListBoxCutsWidthChanged(ListBoxEx list)
         {
+            if (list == null) return;
             //3x + 4y = containerWidth;
             //3x = y;
             //x为间距,y为item;

+ 1 - 1
PDF Office/Views/PropertyPanel/AnnotPanel/StampAnnotProperty.xaml

@@ -90,7 +90,7 @@
                         HorizontalContentAlignment="Center"
                         FontSize="12"
                         >
-                <ListBox ItemsSource="{Binding DynamicStampList}" Loaded="DydamicListBox_Loaded" SelectionMode="Single" Height="auto" VerticalAlignment="Top"  BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
+                <ListBox Tag="Dynamic" DataContext="{Binding}"  ItemsSource="{Binding DynamicStampList}" Loaded="DydamicListBox_Loaded" SelectionMode="Single" Height="auto" VerticalAlignment="Top"  BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
                     <ListBox.ItemTemplate>
                         <DataTemplate >
                             <Grid>

+ 10 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/StampAnnotProperty.xaml.cs

@@ -1,4 +1,5 @@
 using PDF_Office.CustomControl;
+using PDF_Office.Helper;
 using PDF_Office.Model.AnnotPanel;
 using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
 using System;
@@ -30,6 +31,15 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
 
         private void ListBoxItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
         {
+            ListBox listBox = CommonHelper.FindVisualParent<ListBox>(sender as ListBoxItem);
+            if (listBox != null)
+            {
+                if (listBox.Tag.ToString() == "Dynamic")
+                {
+                    (DataContext as StampAnnotPropertyViewModel).SetDynamicStamp((sender as ListBoxItem).DataContext as Stamp);
+                    return;
+                }
+            }
             (DataContext as StampAnnotPropertyViewModel).SetStamp((sender as ListBoxItem).DataContext as Stamp);
         }
 

+ 4 - 0
PDF Office/Views/PropertyPanel/PDFEdit/TextEditProperty.xaml

@@ -125,6 +125,7 @@
                             Height="32"
                             HorizontalAlignment="Left"
                             IsValueContent="True"
+                            IsSelectedEmpty ="{Binding IsSelectedEmpty}"
                             ItemSource="{Binding PresetTextItems}"
                             SelectedItems="{Binding PresetTextData, Mode=TwoWay}" />
 
@@ -153,6 +154,7 @@
                             x:Name="FontFamilyBox"
                             Height="32"
                             IsValueContent="True"
+                            IsSelectedEmpty ="{Binding IsSelectedEmpty}"
                             ItemSource="{Binding FontFamilyItems}"
                             SelectedItems="{Binding FontFamilyData, Mode=TwoWay}" />
 
@@ -163,6 +165,7 @@
                                 Height="32"
                                 HorizontalAlignment="Left"
                                 IsValueContent="True"
+                                IsSelectedEmpty ="{Binding IsSelectedEmpty}"
                                 ItemSource="{Binding FontStyleItems}"
                                 SelectedItems="{Binding FontWeightStyleItem, Mode=TwoWay}" />
 
@@ -172,6 +175,7 @@
                                 Width="110"
                                 Height="32"
                                 HorizontalAlignment="Right"
+                                IsSelectedEmpty ="{Binding IsSelectedEmpty}"
                                 SelectedItems="{Binding FontSizeData, Mode=TwoWay}" />
                         </Grid>
                         <Grid>

BIN
PDF Office/x64/models/DA_image_enhance_magic_color_1.0.0.model