Просмотр исходного кода

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

# Conflicts:
#	PDF Office/ViewModels/ViewContentViewModel.cs
ZhouJieSheng 2 лет назад
Родитель
Сommit
9102a77a8e
49 измененных файлов с 1016 добавлено и 383 удалено
  1. 39 0
      PDF Office/Helper/CommonHelper.cs
  2. 38 4
      PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs
  3. 2 2
      PDF Office/Styles/RadioButtonStyle.xaml
  4. 19 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialogViewModel.cs
  5. 2 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesCreateContentViewModel.cs
  6. 21 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialogViewModel.cs
  7. 19 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogViewModel.cs
  8. 3 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterCreateContentViewModel.cs
  9. 19 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialogViewModel.cs
  10. 20 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageRemoveDialogViewModel.cs
  11. 19 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogViewModel.cs
  12. 21 3
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateTextContentViewModel.cs
  13. 27 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialogViewModel.cs
  14. 5 5
      PDF Office/ViewModels/EditTools/Bates/BatesCreateContentViewModel.cs
  15. 7 4
      PDF Office/ViewModels/EditTools/HeaderFooter/HeaderFooterCreateContentViewModel.cs
  16. 27 1
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs
  17. 15 4
      PDF Office/ViewModels/EditTools/Watermark/WatermarkDocumentContentViewModel.cs
  18. 23 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs
  19. 146 7
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs
  20. 6 21
      PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs
  21. 16 0
      PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs
  22. 1 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  23. 29 3
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  24. 21 2
      PDF Office/ViewModels/ViewContentViewModel.cs
  25. 1 0
      PDF Office/Views/BOTA/AnnotationContent.xaml
  26. 5 1
      PDF Office/Views/BOTA/AnnotationContent.xaml.cs
  27. 1 1
      PDF Office/Views/BOTA/BookmarkContent.xaml
  28. 24 1
      PDF Office/Views/BOTA/BookmarkContent.xaml.cs
  29. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml
  30. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml
  31. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialog.xaml
  32. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml
  33. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml
  34. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageRemoveDialog.xaml
  35. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialog.xaml
  36. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml
  37. 2 2
      PDF Office/Views/EditTools/Bates/BatesCreateContent.xaml
  38. 1 1
      PDF Office/Views/EditTools/Bates/BatesTemplateListContent.xaml.cs
  39. 1 1
      PDF Office/Views/EditTools/HeaderFooter/HeaderFooterCreateContent.xaml
  40. 1 1
      PDF Office/Views/EditTools/HeaderFooter/HeaderFooterTemplateListContent.xaml.cs
  41. 29 16
      PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml
  42. 299 184
      PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml
  43. 42 42
      PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml.cs
  44. 28 56
      PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml
  45. 2 4
      PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml.cs
  46. 5 2
      PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml
  47. 1 1
      PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs
  48. 1 1
      PDF Office/Views/Tools/AnnotToolContent.xaml
  49. 20 7
      PDF Office/Views/ViewContent.xaml

+ 39 - 0
PDF Office/Helper/CommonHelper.cs

@@ -175,6 +175,45 @@ namespace PDF_Office.Helper
             catch { return null; }
         }
 
+        public static T FindVisualChildByName<T>(DependencyObject parent, string name) where T : DependencyObject
+
+        {
+
+            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++)
+
+            {
+
+                var child = VisualTreeHelper.GetChild(parent, i);
+
+                string controlName = child.GetValue(System.Windows.Controls.Control.NameProperty) as string;
+
+                if (controlName == name)
+
+                {
+
+                    return child as T;
+
+                }
+
+                else
+
+                {
+
+                    T result = FindVisualChildByName<T>(child, name);
+
+                    if (result != null)
+
+                        return result;
+
+                }
+
+            }
+
+            return null;
+
+        }
+
+
         /// <summary>
         /// 从页码集合获取页码字符串,如1,2,3 转换成1-3
         /// </summary>

+ 38 - 4
PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs

@@ -1,4 +1,5 @@
-using System;
+using PDF_Office.CustomControl.CompositeControl;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,6 +9,8 @@ using System.Windows.Media;
 
 namespace PDF_Office.Model.PropertyPanel.AnnotPanel
 {
+    #region 自定义文字样式选项
+
     public class FontStyleItem
     {
         public string mTag { get; set; }
@@ -20,10 +23,12 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
 
     }
 
-    public class LoadFontStyle
-    {
+    #endregion
+
 
-        public static List<FontStyleItem> Load()
+    public class TextFont
+    {
+        public static List<FontStyleItem> GetPresetFontStyle()
         {
             List<FontStyleItem> fontStyleList = new List<FontStyleItem>();
             FontStyleItem custom = new FontStyleItem();
@@ -101,5 +106,34 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
 
             return fontStyleList;
         }
+
+        public static List<ComboDataItem> GetFontStyle()
+        {
+            var FontStyleItems = new List<ComboDataItem>();
+            ComboDataItem item = new ComboDataItem("Regular", "Regular");
+            FontStyleItems.Add(item);
+            item = new ComboDataItem("Bold", "Bold");
+            FontStyleItems.Add(item);
+            item = new ComboDataItem("Italic", "Italic");
+            FontStyleItems.Add(item);
+            item = new ComboDataItem("Bold Italic", "Bold Italic");
+            FontStyleItems.Add(item);
+
+            return FontStyleItems;
+        }
+
+        public static List<ComboDataItem> GetFamily()
+        {
+            var FontFamilyItems = new List<ComboDataItem>();
+            ComboDataItem item = new ComboDataItem("Courier", "Courier New");
+            FontFamilyItems.Add(item);
+            item = new ComboDataItem("Helvetica", "Helvetica");
+            FontFamilyItems.Add(item);
+            item = new ComboDataItem("Times-Roman", "Times New Roman");
+            FontFamilyItems.Add(item);
+
+            return FontFamilyItems;
+        }
     }
+   
 }

+ 2 - 2
PDF Office/Styles/RadioButtonStyle.xaml

@@ -187,7 +187,7 @@
         </Setter>
     </Style>
     <Style x:Key="ViewModeViewRadioBtn" TargetType="{x:Type RadioButton}">
-        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
         <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
         <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
         <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
@@ -227,7 +227,7 @@
                     </Grid>
                     <ControlTemplate.Triggers>
                         <Trigger Property="HasContent" Value="true">
-                            <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
+                            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                             <Setter Property="Padding" Value="4,-1,0,0" />
                         </Trigger>
                         <Trigger Property="IsMouseOver" Value="true">

+ 19 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialogViewModel.cs

@@ -221,6 +221,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         #region 委托声明
         public DelegateCommand ADDPDFCommand { get; set; }
 
+        public DelegateCommand ADDOpenedPDFCommand { get; set; }
+
         public DelegateCommand RemovePDFFileCommand { get; set; }
 
         public DelegateCommand CreateCommand { get; set; }
@@ -249,6 +251,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             Unicode = Guid.NewGuid().ToString() ;
             BackgroundSettingsVisible = Visibility.Visible;
             ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDOpenedPDFCommand = new DelegateCommand(addOpenedPDFFiles);
             ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
             RemovePDFFileCommand = new DelegateCommand(removepdffile);
             CreateCommand = new DelegateCommand(create);
@@ -462,6 +465,22 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             updateListview("wait");
         }
 
+        /// <summary>
+        /// 添加已打开PDF文件
+        /// </summary>
+        public void addOpenedPDFFiles()
+        {
+            FileNameNumber = fileNames.Count;
+            foreach (var filename in App.OpenedFileList)
+            {
+                fileNames.Add(filename);
+            }
+            RemoveExcess(ref fileNames);
+            SetBackgroundGridIsEnabled = "True";
+            AddFileVisibility = Visibility.Collapsed;
+            updateListview("wait");
+        }
+
         /// <summary>
         /// 删除重复的文件
         /// </summary>

+ 2 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesCreateContentViewModel.cs

@@ -122,7 +122,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         private void InitStarPagetNumberList()
         {
             StarPagetNumberList.Clear();
-            for (int temp = 10; temp <= 15; temp += 1)
+            for (int temp = 1; temp <= 999; temp += 1)
             {
                 StarPagetNumberList.Add(temp.ToString());
             }
@@ -723,6 +723,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BatesInfo.PageRange, PageRangeText);
             navigationContext.Parameters.TryGetValue<string>("Unicode", out Unicode);
+            
             if (navigationContext.Parameters.TryGetValue<BatesHeaderFooterItem>("BatesItem", out TemplateBatesItem))
             {
                 CreateOrEdit = EnumCreateOrEdit.StatusEdit;

+ 21 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialogViewModel.cs

@@ -196,11 +196,15 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         #region 委托声明
         public DelegateCommand ADDPDFCommand { get; set; }
 
+        public DelegateCommand ADDOpenedPDFCommand { get; set; }
+
         public DelegateCommand RemovePDFFileCommand { get; set; }
 
         public DelegateCommand CreateCommand { get; set; }
 
         public DelegateCommand ADDPDFFilesCommand { get; set; }
+
+
         #endregion
 
         public string Unicode = null;
@@ -224,6 +228,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             PDFDataTable.Columns.Add("FileSize");
             PDFDataTable.Columns.Add("FileState");
             ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDOpenedPDFCommand = new DelegateCommand(addOpenedPDFFiles);
             ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
             RemovePDFFileCommand = new DelegateCommand(removepdffile);
             CreateCommand = new DelegateCommand(create);
@@ -393,6 +398,21 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             updateListview("wait");
         }
 
+        /// <summary>
+        /// 添加已打开PDF文件
+        /// </summary>
+        public void addOpenedPDFFiles()
+        {
+            FileNameNumber = fileNames.Count;
+            foreach (var filename in App.OpenedFileList) {
+                fileNames.Add(filename);
+            }
+            RemoveExcess(ref fileNames);
+            SetBatesGridIsEnabled = "True";
+            AddFileVisibility = Visibility.Collapsed;
+            updateListview("wait");
+        }
+
         /// <summary>
         /// 删除重复的文件
         /// </summary>
@@ -410,6 +430,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             Filenames = filenames;
         }
 
+
         /// <summary>
         /// 添加PDF文件夹
         /// </summary>

+ 19 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogViewModel.cs

@@ -124,6 +124,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         #region 委托声明
         public DelegateCommand ADDPDFCommand { get; set; }
 
+        public DelegateCommand ADDOpenedPDFCommand { get; set; }
+
         public DelegateCommand RemovePDFFileCommand { get; set; }
 
         public DelegateCommand ADDPDFFilesCommand { get; set; }
@@ -141,6 +143,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             PDFDataTable.Columns.Add("FileState");
             PDFDataTable.Columns.Add("MaxPageRange");
             ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDOpenedPDFCommand = new DelegateCommand(addOpenedPDFFiles);
             ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
             RemovePDFFileCommand = new DelegateCommand(removepdffile);
             CompressCommand = new DelegateCommand(compress);
@@ -261,6 +264,22 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             updateListview("wait");
         }
 
+        /// <summary>
+        /// 添加已打开PDF文件
+        /// </summary>
+        public void addOpenedPDFFiles()
+        {
+            FileNameNumber = fileNames.Count;
+            foreach (var filename in App.OpenedFileList)
+            {
+                fileNames.Add(filename);
+            }
+            RemoveExcess(ref fileNames);
+            SetCompressGridIsEnabled = "True";
+            AddFileVisibility = Visibility.Collapsed;
+            updateListview("wait");
+        }
+
         /// <summary>
         /// 删除重复的文件
         /// </summary>

+ 3 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterCreateContentViewModel.cs

@@ -118,7 +118,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         private void InitStarPagetNumberList()
         {
             StarPagetNumberList.Clear();
-            for (int temp = 10; temp <= 15; temp += 1)
+            for (int temp = 1; temp <= 999; temp += 1)
             {
                 StarPagetNumberList.Add(temp.ToString());
             }
@@ -578,7 +578,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         }
         public void ADDPages()
         {
-            GetTextValueFromNumber[GetLocationIndex.ToString()] = GetTextValueFromNumber[GetLocationIndex.ToString()] + "<<" + PageNumberFormatList[PageNumberFormatIndex] + ">>";
+            GetTextValueFromNumber[GetLocationIndex.ToString()] = GetTextValueFromNumber[GetLocationIndex.ToString()] + "<<" + PageNumberFormatList[PageNumberFormatIndex].Replace("1", (StarPagetNumberIndex + 1).ToString()) + ">>";
             TextValue = GetTextValueFromNumber[GetLocationIndex.ToString()];
             HeaderFooterInfo.TextData[GetLocationIndex].text = GetTextValueFromNumber[GetLocationIndex.ToString()];
            
@@ -725,6 +725,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         {
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             navigationContext.Parameters.TryGetValue<string>("Unicode", out Unicode);
+            
             //EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref HeaderFooterInfo.PageRange, PageRangeText);
             if (navigationContext.Parameters.TryGetValue<BatesHeaderFooterItem>("HeaderFooterItem", out TemplateHeaderFooterItem))
             {

+ 19 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialogViewModel.cs

@@ -203,6 +203,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         #region 委托声明
         public DelegateCommand ADDPDFCommand { get; set; }
 
+        public DelegateCommand ADDOpenedPDFCommand { get; set; }
+
         public DelegateCommand RemovePDFFileCommand { get; set; }
 
         public DelegateCommand CreateCommand { get; set; }
@@ -231,6 +233,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             PDFDataTable.Columns.Add("FileSize");
             PDFDataTable.Columns.Add("FileState");
             ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDOpenedPDFCommand = new DelegateCommand(addOpenedPDFFiles);
             ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
             RemovePDFFileCommand = new DelegateCommand(removepdffile);
             CreateCommand = new DelegateCommand(create);
@@ -395,6 +398,22 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             updateListview("wait");
         }
 
+        /// <summary>
+        /// 添加已打开PDF文件
+        /// </summary>
+        public void addOpenedPDFFiles()
+        {
+            FileNameNumber = fileNames.Count;
+            foreach (var filename in App.OpenedFileList)
+            {
+                fileNames.Add(filename);
+            }
+            RemoveExcess(ref fileNames);
+            SetHeaderFooterGridIsEnabled = "True";
+            AddFileVisibility = Visibility.Collapsed;
+            updateListview("wait");
+        }
+
         /// <summary>
         /// 删除重复的文件
         /// </summary>

+ 20 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageRemoveDialogViewModel.cs

@@ -172,6 +172,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         #region 委托声明
         public DelegateCommand ADDPDFCommand { get; set; }
 
+        public DelegateCommand ADDOpenedPDFCommand { get; set; }
+
         public DelegateCommand RemovePDFFileCommand { get; set; }
 
         public DelegateCommand ADDPDFFilesCommand { get; set; }
@@ -187,6 +189,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             PDFDataTable.Columns.Add("FileSize");
             PDFDataTable.Columns.Add("FileState");
             ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDOpenedPDFCommand = new DelegateCommand(addOpenedPDFFiles);
             ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
             RemovePDFFileCommand = new DelegateCommand(removepdffile);
             OptionsRemoveCommand = new DelegateCommand(OptionsRemove);
@@ -346,7 +349,23 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             AddFileVisibility = Visibility.Collapsed;
             updateListview("wait");
         }
-        
+
+        /// <summary>
+        /// 添加已打开PDF文件
+        /// </summary>
+        public void addOpenedPDFFiles()
+        {
+            FileNameNumber = fileNames.Count;
+            foreach (var filename in App.OpenedFileList)
+            {
+                fileNames.Add(filename);
+            }
+            RemoveExcess(ref fileNames);
+            SetOptionsRemoveGridIsEnabled = "True";
+            AddFileVisibility = Visibility.Collapsed;
+            updateListview("wait");
+        }
+
 
         /// <summary>
         /// 删除重复的文件

+ 19 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogViewModel.cs

@@ -188,6 +188,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
         public DelegateCommand ADDPDFCommand { get; set; }
 
+        public DelegateCommand ADDOpenedPDFCommand { get; set; }
+
         public DelegateCommand RemovePDFFileCommand { get; set; }
 
         public DelegateCommand ADDPDFFilesCommand { get; set; }
@@ -207,6 +209,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             DelegateCanOpenTextChangedCommand = new DelegateCommand(CanOpenTextChanged);
             DelegateCanEditTextChangedCommand = new DelegateCommand(CanEditTextChanged);
             ADDPDFCommand = new DelegateCommand(addpdf);
+            ADDOpenedPDFCommand = new DelegateCommand(addOpenedPDFFiles);
             ADDPDFFilesCommand = new DelegateCommand(addpdffiles);
             RemovePDFFileCommand = new DelegateCommand(removepdffile);
         }
@@ -353,6 +356,22 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             updateListview("wait");
         }
 
+        /// <summary>
+        /// 添加已打开PDF文件
+        /// </summary>
+        public void addOpenedPDFFiles()
+        {
+            FileNameNumber = fileNames.Count;
+            foreach (var filename in App.OpenedFileList)
+            {
+                fileNames.Add(filename);
+            }
+            RemoveExcess(ref fileNames);
+            SetSafetyGridIsEnabled = "True";
+            AddFileVisibility = Visibility.Collapsed;
+            updateListview("wait");
+        }
+
         /// <summary>
         /// 删除重复的文件
         /// </summary>

+ 21 - 3
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkCreateTextContentViewModel.cs

@@ -193,6 +193,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             set
             {
                 SetProperty(ref _relativeScaleValue, value);
+                WatermarkInfo.TextSize = (float)RelativeScaleValue / 100;
             }
         }
 
@@ -331,7 +332,16 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             {
                 SetProperty(ref _isRelativeScaleValue, value);
                 WatermarkInfo.IsRelativeScale = IsRelativeScaleValue;
-                
+                if (WatermarkInfo.IsRelativeScale)
+                {
+                    WatermarkInfo.TextSize = (float)RelativeScaleValue / 100;
+                }
+                else
+                {
+                    WatermarkInfo.TextSize = 0.5f;
+                    FontSizeSelectedIndex = 0;
+                }
+               
             }
         }
 
@@ -606,10 +616,11 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         {
             if (Index == 0)
             {
-                WatermarkInfo.TextSize = 10;
+                WatermarkInfo.IsRelativeScale = true;
             }
             else
             {
+                WatermarkInfo.IsRelativeScale = false;
                 WatermarkInfo.TextSize = (Index + 7) * 1.33f;
             }
         }
@@ -696,7 +707,14 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                     watermark = document.InitWatermark(C_Watermark_Type.WATERMARK_TYPE_TEXT);
                     watermark.SetText(watermarkInfo.Text);
                     watermark.SetFontName(watermarkInfo.FontName);
-                    watermark.SetFontSize(watermarkInfo.TextSize);
+                    if (WatermarkInfo.IsRelativeScale)
+                    {
+                        watermark.SetFontSizeWithPercentage(WatermarkInfo.TextSize);
+                    }
+                    else
+                    {
+                        watermark.SetFontSize(WatermarkInfo.TextSize);
+                    }
                     watermark.SetTextRGBColor(watermarkInfo.TextColor);
                 }
                 else

+ 27 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialogViewModel.cs

@@ -216,6 +216,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         #region 委托声明
         public DelegateCommand ADDPDFCommand { get; set; }
 
+        public DelegateCommand ADDOpenedPDFCommand { get; set; }
+
         public DelegateCommand RemovePDFFileCommand { get; set; }
 
         public DelegateCommand CreateCommand { get; set; }
@@ -244,6 +246,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             PDFDataTable.Columns.Add("FileSize");
             PDFDataTable.Columns.Add("FileState");
             ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDOpenedPDFCommand = new DelegateCommand(addOpenedPDFFiles);
             ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
             RemovePDFFileCommand = new DelegateCommand(removepdffile);
             CreateCommand = new DelegateCommand(create);
@@ -408,7 +411,14 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                     watermark = document.InitWatermark(C_Watermark_Type.WATERMARK_TYPE_TEXT);
                     watermark.SetText(WatermarkInfo.Text);
                     watermark.SetFontName(WatermarkInfo.FontName);
-                    watermark.SetFontSize(WatermarkInfo.TextSize);
+                    if (WatermarkInfo.IsRelativeScale)
+                    {
+                        watermark.SetFontSizeWithPercentage(WatermarkInfo.TextSize);
+                    }
+                    else
+                    {
+                        watermark.SetFontSize(WatermarkInfo.TextSize);
+                    }
                     watermark.SetTextRGBColor(WatermarkInfo.TextColor);
                 }
                 else
@@ -468,6 +478,22 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             updateListview("wait");
         }
 
+        /// <summary>
+        /// 添加已打开PDF文件
+        /// </summary>
+        public void addOpenedPDFFiles()
+        {
+            FileNameNumber = fileNames.Count;
+            foreach (var filename in App.OpenedFileList)
+            {
+                fileNames.Add(filename);
+            }
+            RemoveExcess(ref fileNames);
+            SetWatermarkGridIsEnabled = "True";
+            AddFileVisibility = Visibility.Collapsed;
+            updateListview("wait");
+        }
+
         /// <summary>
         /// 删除重复的文件
         /// </summary>

+ 5 - 5
PDF Office/ViewModels/EditTools/Bates/BatesCreateContentViewModel.cs

@@ -127,10 +127,10 @@ namespace PDF_Office.ViewModels.EditTools.Bates
             }
         }
 
-        private void InitStarPagetNumberList()
+        private void InitStarPagetNumberList(int pageCount)
         {
             StarPagetNumberList.Clear();
-            for (int temp = 10; temp <= 15; temp += 1)
+            for (int temp = 1; temp <= pageCount; temp += 1)
             {
                 StarPagetNumberList.Add(temp.ToString());
             }
@@ -454,7 +454,6 @@ namespace PDF_Office.ViewModels.EditTools.Bates
 
             InitFontNameList();
             InitFontSizeList();
-            InitStarPagetNumberList();
             InitLocationButtonMatrix();
 
         }
@@ -464,7 +463,7 @@ namespace PDF_Office.ViewModels.EditTools.Bates
             GetTextValueFromNumber.Clear();
             for (var temp = 0; temp <= 5; temp++)
             {
-                GetTextValueFromNumber.Add(temp.ToString(), temp.ToString());
+                GetTextValueFromNumber.Add(temp.ToString(), "");
             }
         }
 
@@ -766,7 +765,7 @@ namespace PDF_Office.ViewModels.EditTools.Bates
 
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             MaxPageRange = PDFViewer.Document.PageCount;
-            
+            InitStarPagetNumberList(MaxPageRange);
             if (navigationContext.Parameters.TryGetValue<BatesHeaderFooterItem>("BatesItem", out TemplateBatesItem))
             {
                 CreateOrEdit = EnumCreateOrEdit.StatusEdit;
@@ -779,6 +778,7 @@ namespace PDF_Office.ViewModels.EditTools.Bates
                 CreateOrEdit = EnumCreateOrEdit.StatusCreate;
                 EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BatesInfo.PageRange, PageRangeText);
             }
+            StarPagetNumberIndex = 0;
         }
 
 

+ 7 - 4
PDF Office/ViewModels/EditTools/HeaderFooter/HeaderFooterCreateContentViewModel.cs

@@ -129,10 +129,10 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
             }
         }
 
-        private void InitStarPagetNumberList()
+        private void InitStarPagetNumberList(int pageCount)
         {
             StarPagetNumberList.Clear();
-            for (int temp = 10; temp <= 15; temp += 1)
+            for (int temp = 1; temp <= pageCount; temp += 1)
             {
                 StarPagetNumberList.Add(temp.ToString());
             }
@@ -174,6 +174,8 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
             PageNumberFormatList.Add("Page 1 of n");
         }
 
+
+
         private int _pageNumberFormatIndex = 0;
         public int PageNumberFormatIndex
         {
@@ -498,7 +500,6 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
 
             InitFontNameList();
             InitFontSizeList();
-            InitStarPagetNumberList();
             InitDateTimeFormatList();
             InitPageNumberFormatList();
             InitLocationButtonMatrix();
@@ -638,7 +639,7 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
         }
         public void ADDPages()
         {
-            GetTextValueFromNumber[GetLocationIndex.ToString()] = GetTextValueFromNumber[GetLocationIndex.ToString()] + "<<" + PageNumberFormatList[PageNumberFormatIndex] + ">>";
+            GetTextValueFromNumber[GetLocationIndex.ToString()] = GetTextValueFromNumber[GetLocationIndex.ToString()] + "<<" + PageNumberFormatList[PageNumberFormatIndex].Replace("1", (StarPagetNumberIndex + 1).ToString()) + ">>";
             TextValue = GetTextValueFromNumber[GetLocationIndex.ToString()];
             HeaderFooterInfo.TextData[GetLocationIndex].text = GetTextValueFromNumber[GetLocationIndex.ToString()];
             eventAggregator.GetEvent<SetHeaderFooterEvent>().Publish(new HeaderFooterInfoUnicode
@@ -784,6 +785,7 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
         {
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
             MaxPageRange = PDFViewer.Document.PageCount;
+            InitStarPagetNumberList(MaxPageRange);
             EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref HeaderFooterInfo.PageRange, PageRangeText);
             if (navigationContext.Parameters.TryGetValue<BatesHeaderFooterItem>("HeaderFooterItem", out TemplateHeaderFooterItem))
             {
@@ -794,6 +796,7 @@ namespace PDF_Office.ViewModels.EditTools.HeaderFooter
             {
                 CreateOrEdit = EnumCreateOrEdit.StatusCreate;
             }
+            StarPagetNumberIndex = 0;
         }
     }
 }

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

@@ -207,6 +207,12 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             set
             {
                 SetProperty(ref _relativeScaleValue, value);
+                WatermarkInfo.TextSize = (float)RelativeScaleValue / 100;
+                eventAggregator.GetEvent<SetWatermarkEvent>().Publish(new WatermarkInfoUnicode
+                {
+                    Unicode = Unicode,
+                    Status = WatermarkInfo
+                });
             }
         }
 
@@ -377,6 +383,15 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
             {
                 SetProperty(ref _isRelativeScaleValue, value);
                 WatermarkInfo.IsRelativeScale = IsRelativeScaleValue;
+                if (WatermarkInfo.IsRelativeScale)
+                {
+                    WatermarkInfo.TextSize = (float)RelativeScaleValue / 100;
+                }
+                else {
+                    WatermarkInfo.TextSize = 0.5f;
+                    FontSizeSelectedIndex = 0;
+                }
+                
                 eventAggregator.GetEvent<SetWatermarkEvent>().Publish(new WatermarkInfoUnicode
                 {
                     Unicode = Unicode,
@@ -682,10 +697,12 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
         {
             if (Index == 0)
             {
-                WatermarkInfo.TextSize = 10;
+                
+                WatermarkInfo.IsRelativeScale=true;
             }
             else
             {
+                WatermarkInfo.IsRelativeScale = false;
                 WatermarkInfo.TextSize = (Index + 7) * 1.33f;
             }
         }
@@ -776,6 +793,15 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 {
                     watermark = document.InitWatermark(C_Watermark_Type.WATERMARK_TYPE_TEXT);
                     watermark.SetText(watermarkInfo.Text);
+                    watermark.SetAutoSize(watermarkInfo.IsRelativeScale);
+                    if (watermarkInfo.IsRelativeScale)
+                    {
+                        watermark.SetFontSizeWithPercentage(watermarkInfo.TextSize);
+                    }
+                    else
+                    {
+                        watermark.SetFontSize(watermarkInfo.TextSize);
+                    }
                     watermark.SetFontName(watermarkInfo.FontName);
                     watermark.SetFontSize(watermarkInfo.TextSize);
                     watermark.SetTextRGBColor(watermarkInfo.TextColor);

+ 15 - 4
PDF Office/ViewModels/EditTools/Watermark/WatermarkDocumentContentViewModel.cs

@@ -183,7 +183,15 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                     watermark = document.InitWatermark(C_Watermark_Type.WATERMARK_TYPE_TEXT);
                     watermark.SetText(watermarkInfo.Text);
                     watermark.SetFontName(watermarkInfo.FontName);
-                    watermark.SetFontSize(watermarkInfo.TextSize);
+                    watermark.SetAutoSize(watermarkInfo.IsRelativeScale);
+                    if (watermarkInfo.IsRelativeScale)
+                    {
+                        watermark.SetFontSizeWithPercentage(watermarkInfo.TextSize);
+                    }
+                    else
+                    {
+                        watermark.SetFontSize(watermarkInfo.TextSize);
+                    }
                     watermark.SetTextRGBColor(watermarkInfo.TextColor);
                 }
                 else
@@ -194,6 +202,7 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                     {
                         watermark.SetImage(watermarkInfo.ImageArray, watermarkInfo.ImageWidth, watermarkInfo.ImageHeight);
                     }
+
                     watermark.SetScale(watermarkInfo.ImageSize / 100);
                 }
                 watermark.SetRotation((float)((watermarkInfo.Rotation / 180) * Math.PI));
@@ -207,9 +216,11 @@ namespace PDF_Office.ViewModels.EditTools.Watermark
                 watermark.SetHorizontalSpacing(watermarkInfo.HorizontalSpacing);
                 watermark.SetVerticalSpacing(watermarkInfo.VerticalSpacing);
                 if (IsNewDoc) { watermark.SetPages("0"); }
-                else {
-                    
-                    watermark.SetPages(watermarkInfo.PageRange); }
+                else
+                {
+
+                    watermark.SetPages(watermarkInfo.PageRange);
+                }
                 Trace.WriteLine("IsCreateWatermark: " + watermark.CreateWatermark());
                 Trace.WriteLine("IsUpdateWatermark: " + watermark.UpdateWatermark());
             }

+ 23 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -105,7 +105,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public DelegateCommand<object> SelectedValueChangedCommand { get; set; }
         public DelegateCommand<object> SelectPenThickChangedCommand { get; set; }
         public DelegateCommand<object> SetEraserThickCommand { get; set; }
+        public DelegateCommand<object> LineModeCheckedCommand { get; set; }
         
+
         public FreehandAnnotPropertyViewModel()
         {
             EraseCommand = new DelegateCommand<object>(Erase_Command);
@@ -115,6 +117,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             SelectedValueChangedCommand = new DelegateCommand<object>(SelectedValueChanged_Command);
             SelectPenThickChangedCommand = new DelegateCommand<object>(SelectPenThickChanged_Command);
             SetEraserThickCommand = new DelegateCommand<object>(SelectEraserThickChanged_Command);
+            LineModeCheckedCommand = new DelegateCommand<object>(LineMode_Checked);
 
             InitVariable();
         }
@@ -140,6 +143,26 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private void LineMode_Checked(object obj)
+        {
+            if (obj != null)
+            {
+                var tag = ((string)obj);
+                switch (tag)
+                {
+                    case "Dashed":
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Dash);
+                        break;
+
+                    case "Solid":
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Solid);
+                        break;
+
+                }
+                AnnotEvent?.UpdateAnnot();
+            }
+        }
+
 
         private void SelectPenThickChanged_Command(object obj)
         {

+ 146 - 7
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -1,5 +1,6 @@
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
+using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
@@ -104,6 +105,96 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private ComboDataItem _presetTextData;
+        public ComboDataItem PresetTextData
+        {
+            get { return _presetTextData; }
+            set
+            {
+                SetProperty(ref _presetTextData, value);
+                if (_presetTextData != null && FontStyleList != null)
+                {
+
+                }
+            }
+        }
+
+        private ComboDataItem _fontSizeData = new ComboDataItem(6);
+        public ComboDataItem FontSizeData
+        {
+            get { return _fontSizeData; }
+            set
+            {
+                SetProperty(ref _fontSizeData, value);
+            }
+        }
+
+        private ComboDataItem _fontFamilyData;
+        public ComboDataItem FontFamilyData
+        {
+            get { return _fontFamilyData; }
+            set
+            {
+                SetProperty(ref _fontFamilyData, value);
+            }
+        }
+
+        private FontStyle _fontStyle;
+        public FontStyle FontStyleItem
+        {
+            get { return _fontStyle; }
+            set { SetProperty(ref _fontStyle, value); }
+        }
+
+        private FontWeight _fontWeight;
+        public FontWeight FontWeightItem
+        {
+            get { return _fontWeight; }
+            set { SetProperty(ref _fontWeight, value); }
+        }
+
+
+        private ComboDataItem _fontWeightStyleItem;
+        public ComboDataItem FontWeightStyleItem
+        {
+            get { return _fontWeightStyleItem; }
+            set
+            {
+                SetProperty(ref _fontWeightStyleItem, value);
+                if (_fontWeightStyleItem.ValueStr != null && string.IsNullOrEmpty((string)_fontWeightStyleItem.ValueStr) == false)
+                {
+                    switch ((string)_fontWeightStyleItem.ValueStr)
+                    {
+                        case "Regular":
+                            FontStyleItem = FontStyles.Normal;
+                            FontWeightItem = FontWeights.Normal;
+                            break;
+
+                        case "Bold":
+                            FontStyleItem = FontStyles.Normal;
+                            FontWeightItem = FontWeights.Bold;
+                            break;
+
+                        case "Italic":
+                            FontStyleItem = FontStyles.Italic;
+                            FontWeightItem = FontWeights.Normal;
+                            break;
+
+                        case "Bold Italic":
+                            FontStyleItem = FontStyles.Italic;
+                            FontWeightItem = FontWeights.Bold;
+                            break;
+                    }
+                    
+                }
+            }
+        }
+
+
+        public List<ComboDataItem> PresetTextItems { get; private set; }
+        public List<ComboDataItem> FontFamilyItems { get; private set; }
+        public List<ComboDataItem> FontStyleItems { get; private set; }
+
         public DelegateCommand<object> SelectedFillOpacityCommand { get; set; }
         public DelegateCommand<object> SelectedFontStyleCommand { get; set; }
         public DelegateCommand<object> SelectedColorCommand { get; set; }
@@ -111,10 +202,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public DelegateCommand<object> FontFamilyChangedCommand { get; set; }
         public DelegateCommand<object> FontStyleChangedCommand { get; set; }
         public DelegateCommand<object> FontSizeChangedCommand { get; set; }
-        public DelegateCommand<object> TextAlignChecked { get; set; }
+        public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
+        public DelegateCommand<object> LineModeCheckedCommand { get; set; }
         
 
+
         public event EventHandler<object> LoadPropertyHandler;
+
         public FreetextAnnotPropertyViewModel()
         {
             SelectedFillOpacityCommand = new DelegateCommand<object>(SelectedFillOpacity);
@@ -124,40 +218,85 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             FontFamilyChangedCommand = new DelegateCommand<object>(FontFamilyChanged_Command);
             FontStyleChangedCommand = new DelegateCommand<object>(FontStyleChanged_Command);
             FontSizeChangedCommand = new DelegateCommand<object>(FontSizeChanged_Command);
-            TextAlignChecked = new DelegateCommand<object>(TextAlign_Checked);
+            TextAlignCheckedCommand = new DelegateCommand<object>(TextAlignChecked);
+            LineModeCheckedCommand = new DelegateCommand<object>(LineMode_Checked);
             InitVariable();
         }
 
         private void InitVariable()
         {
             InitFontStyles();
+            InitFontFamilyComboBox();
+            InitFontStyleComboBox();
+        }
+
+        private void InitFontFamilyComboBox()
+        {
+            FontFamilyItems = TextFont.GetFamily();
+        }
+
+        private void InitFontStyleComboBox()
+        {
+            FontStyleItems = TextFont.GetFontStyle();
         }
 
         private void InitFontStyles()
         {
-            FontStyleList = LoadFontStyle.Load();
+            PresetTextItems = new List<ComboDataItem>();
+            FontStyleList = TextFont.GetPresetFontStyle();
+
+            foreach (var item in FontStyleList)
+            {
+                ComboDataItem itemData = new ComboDataItem(item.mTag, item.mTagContent);
+                PresetTextItems.Add(itemData);
+            }
         }
-        private void TextAlign_Checked(object obj)
+
+        private void TextAlignChecked(object obj)
         {
-            if (obj != null && (string)obj != null)
+            if ((string)obj != null /*&& TextEditEvent != null*/)
             {
-                var tag = (string)obj;
-                switch (tag)
+                switch ((string)obj)
                 {
                     case "AlignLeft":
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Left);
                         break;
+
                     case "AlignCenter":
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Center);
                         break;
+
                     case "AlignRight":
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Right);
                         break;
+
+                    case "Align":
+                        break;
                 }
+
                 AnnotEvent?.UpdateAnnot();
+            }
+        }
+        private void LineMode_Checked(object obj)
+        {
+            if(obj != null)
+            {
+                var tag = ((string)obj);
+                switch (tag)
+                {
+                    case "Dashed":
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Dash);
+                        break;
+
+                    case "Solid":
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, DashStyles.Solid);
+                        break;
 
+                }
+                AnnotEvent?.UpdateAnnot();
             }
         }
+        
 
         private void SelectedFontStyle(object obj)
         {

+ 6 - 21
PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs

@@ -168,7 +168,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
             set
             {
                 SetProperty(ref fontFamily, value);
-                if (TextEditEvent != null)
+                if (TextEditEvent != null && fontFamily != null)
                 {
                     TextEditEvent.FontFamily = fontFamily;
                     TextEditEvent.UpdatePDFEditByEventArgs();
@@ -183,7 +183,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
             set
             {
                 SetProperty(ref fontWeights, value);
-                if (TextEditEvent != null)
+                if (TextEditEvent != null && fontWeights != null)
                 {
                     TextEditEvent.FontWeight = fontWeights;
                     TextEditEvent.UpdatePDFEditByEventArgs();
@@ -198,7 +198,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
             set
             {
                 SetProperty(ref fontStyle, value);
-                if (TextEditEvent != null)
+                if (TextEditEvent != null && fontStyle != null)
                 {
                     TextEditEvent.FontStyle = fontStyle;
                     TextEditEvent.UpdatePDFEditByEventArgs();
@@ -319,33 +319,18 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
 
         private void InitFontFamilyComboBox()
         {
-            FontFamilyItems = new List<ComboDataItem>();
-            ComboDataItem item = new ComboDataItem("Courier", "Courier New");
-            FontFamilyItems.Add(item);
-            item = new ComboDataItem("Helvetica", "Helvetica");
-            FontFamilyItems.Add(item);
-            item = new ComboDataItem("Times-Roman", "Times New Roman");
-            FontFamilyItems.Add(item);
+            FontFamilyItems = TextFont.GetFamily();
         }
 
         private void InitFontStyleComboBox()
         {
-            FontStyleItems = new List<ComboDataItem>();
-            ComboDataItem item = new ComboDataItem("Regular", "Regular");
-            FontStyleItems.Add(item);
-            item = new ComboDataItem("Bold", "Bold");
-            FontStyleItems.Add(item);
-            item = new ComboDataItem("Italic", "Italic");
-            FontStyleItems.Add(item);
-
-            item = new ComboDataItem("Bold Italic", "Bold Italic");
-            FontStyleItems.Add(item);
+            FontStyleItems = TextFont.GetFontStyle();
         }
 
         private void InitFontStyles()
         {
             PresetTextItems = new List<ComboDataItem>();
-            FontStyleList = LoadFontStyle.Load();
+            FontStyleList = TextFont.GetPresetFontStyle();
 
             foreach(var item in FontStyleList)
             {

+ 16 - 0
PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs

@@ -121,6 +121,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
             }
         }
 
+        private bool rBtnFullScreenIsChecked = false;
+
+        public bool IsFullScreen
+        {
+            get { return rBtnFullScreenIsChecked; }
+            set
+            {
+                SetProperty(ref rBtnFullScreenIsChecked, value);
+            }
+        }
+
         public DelegateCommand<object> SplitScreenCommand { get; set; }
         public DelegateCommand<object> DisableCommand { get; set; }
 
@@ -179,6 +190,11 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
                     alertsMessage.ShowDialog("", "Error", "OK");
                     return;
                 }
+                else if (e.Result == ButtonResult.OK)
+                {
+                    IsFullScreen = false;
+                    IsSingleView = true;
+                }
             });
         }
 

+ 1 - 1
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -156,7 +156,7 @@ namespace PDF_Office.ViewModels.Tools
             return highlightArgs;
         }
 
-        private AnnotHandlerEventArgs GetLink(LinkAnnotArgs selectedLinkAnnotArgs = null, AnnotAttribEvent annotAttribEvent = null)
+        public AnnotHandlerEventArgs GetLink(LinkAnnotArgs selectedLinkAnnotArgs = null, AnnotAttribEvent annotAttribEvent = null)
         {
             Dictionary<AnnotAttrib, object> annotAttribsList = new Dictionary<AnnotAttrib, object>();
             LinkAnnotArgs linkArgs = new LinkAnnotArgs();

+ 29 - 3
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -46,6 +46,17 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        private bool btnLinkIsChecked = false;
+
+        public bool BtnLinkIsChecked
+        {
+            get { return btnLinkIsChecked; }
+            set
+            {
+                SetProperty(ref btnLinkIsChecked, value);
+            }
+        }
+
         private SnapshotEditMenuViewModel snapshotEditMenuViewModel = new SnapshotEditMenuViewModel();
         public SnapshotEditMenuViewModel SnapshotEditMenuViewModel { get => snapshotEditMenuViewModel; set => snapshotEditMenuViewModel = value; }
 
@@ -733,10 +744,13 @@ namespace PDF_Office.ViewModels.Tools
                     }
                     else
                     {
-                        e.PopupMenu = NoneSelectAnnotContextMenu(sender);
-                        if (e.PopupMenu != null)
+                        if (e.PressOnSelectedText)
                         {
-                            e.Handle = true;
+                            e.PopupMenu = NoneSelectAnnotContextMenu(sender);
+                            if (e.PopupMenu != null)
+                            {
+                                e.Handle = true;
+                            }
                         }
                     }
 
@@ -784,9 +798,21 @@ namespace PDF_Office.ViewModels.Tools
             menuItem.Command = ApplicationCommands.Copy;
             popMenu.Items.Add(menuItem);
 
+            menuItem = new MenuItem();
+            menuItem.CommandTarget = (UIElement)sender;
+            menuItem.Header = "创建链接";
+            menuItem.CommandParameter = this;
+            menuItem.Command = viewContentViewModel.CreateLinkCommand;
+            menuItem.Click += MenuItem_Click;
+            popMenu.Items.Add(menuItem);
             return popMenu;
         }
 
+        private void MenuItem_Click(object sender, RoutedEventArgs e)
+        {
+            BtnLinkIsChecked = true;
+        }
+
         /// <summary>
         /// 展开显示属性面板
         /// </summary>

+ 21 - 2
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -447,6 +447,8 @@ namespace PDF_Office.ViewModels
 
         public DelegateCommand ShareCommand { get; set; }
 
+        public DelegateCommand<object> CreateLinkCommand { get; set; }
+
         public DelegateCommand PropertyCommand { get; set; }
 
         public DelegateCommand ShowInFolderCommand { get; set; }
@@ -482,6 +484,8 @@ namespace PDF_Office.ViewModels
             PrintCommand = new DelegateCommand(ShowPrintDialog);
 
             SettingsCommand = new DelegateCommand(SettingsEvent);
+            CreateLinkCommand = new DelegateCommand<object>(CreateLinkEvent);
+
             //未显示时无法注册上Region名称
             ToolContentVisible = Visibility.Visible;
             ToolsBarContentVisible = Visibility.Visible;
@@ -507,6 +511,21 @@ namespace PDF_Office.ViewModels
             EnterSelectedBar("TabItemAnnotation");
         }
 
+        /// <summary>
+        /// 右键菜单创建链接
+        /// </summary>
+        /// <param name="obj"></param>
+        private void CreateLinkEvent(object obj)
+        {
+            if (obj is AnnotToolContentViewModel toolContentViewModel)
+            {
+                AnnotHandlerEventArgs annotArgs = toolContentViewModel.GetLink();
+                PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                PDFViewer.SetToolParam(annotArgs);
+                this.IsPropertyOpen = true;
+            }
+        }
+
         private void ShowInFolder()
         {
             CommonHelper.ShowFileBrowser(PDFViewer.Document.FilePath);
@@ -722,7 +741,7 @@ namespace PDF_Office.ViewModels
         /// 阅读模式
         /// </summary>
         /// <param name="viewContent"></param>
-        public async void RbtnReadMode(ViewContent viewContent)
+        public async void RbtnReadMode()
         {
             App.mainWindowViewModel.SelectedItem.IsInReadctonMode = true;
             App.IsBookMode = true;
@@ -1059,7 +1078,7 @@ namespace PDF_Office.ViewModels
         /// </summary>
         public bool saveAsFile(bool isApplyRedaction = false, bool isEraseRedaction = false)
         {
-            var dlg = new SaveFileDialog();
+            var dlg = new Microsoft.Win32.SaveFileDialog();
             dlg.Filter = Properties.Resources.OpenDialogFilter;
             dlg.FileName = PDFViewer.Document.FileName;
             if (dlg.ShowDialog() == true && !string.IsNullOrEmpty(dlg.FileName))

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

@@ -34,6 +34,7 @@
                     Name="MenuItemCopyText"
                     Click="MenuItemCopyText_Click"
                     Header="复制文本" />
+                <MenuItem Header="导入注释为XFDF格式 " />
                 <MenuItem Header="导出注释为XFDF格式 " />
                 <MenuItem
                     Name="MenuItemDelete"

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

@@ -61,9 +61,11 @@ namespace PDF_Office.Views.BOTA
                     {
                         ListBoxItem myListBoxItem = sender as System.Windows.Controls.ListBoxItem;
                         MenuItem copyText = myListBoxItem.ContextMenu.Items[0] as MenuItem;
-                        MenuItem export = myListBoxItem.ContextMenu.Items[1] as MenuItem;
+                        MenuItem import = myListBoxItem.ContextMenu.Items[1] as MenuItem;
+                        MenuItem export = myListBoxItem.ContextMenu.Items[2] as MenuItem;
                         if (AnnotationList.SelectedItems.Count > 1)
                         {
+                            import.IsEnabled = false;
                             export.IsEnabled = false;
                             copyText.IsEnabled = false;
                         }
@@ -81,6 +83,8 @@ namespace PDF_Office.Views.BOTA
                                     copyText.IsEnabled = false;
                                 }
                             }
+                            import.IsEnabled = true;
+                            import.Command = viewModel.ImportCommentsCommand;
                             export.IsEnabled = true;
                             export.Command = viewModel.ExportCommentsCommand;
                         }

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

@@ -146,7 +146,7 @@
 
                 <ListView.ItemContainerStyle>
                     <Style BasedOn="{StaticResource ListViewItemGraySelectStyle}" TargetType="ListViewItem">
-                        <EventSetter Event="PreviewMouseDown" Handler="ListViewItem_MouseLeftButtonDown" />
+                        <EventSetter Event="PreviewMouseDown" Handler="ListViewItem_MouseButtonDown" />
                         <EventSetter Event="LostFocus" Handler="ListViewItem_LostFocus" />
                         <Setter Property="ContextMenu" Value="{StaticResource ContextMenu}" />
                     </Style>

+ 24 - 1
PDF Office/Views/BOTA/BookmarkContent.xaml.cs

@@ -41,7 +41,7 @@ namespace PDF_Office.Views.BOTA
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private void ListViewItem_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void ListViewItem_MouseButtonDown(object sender, MouseButtonEventArgs e)
         {
             object[] objects = new object[] { sender, e };
             TextBlock textBlock = null;
@@ -79,6 +79,29 @@ namespace PDF_Office.Views.BOTA
                     viewModel.ListViewItemMouseDownCommand.Execute(sender);
                 }
             }
+            else if (e.RightButton == MouseButtonState.Pressed)
+            {
+                ContextMenu contextMenu = listBoxItem.ContextMenu;
+                if (contextMenu.Items.Count == 3)
+                {
+                    MenuItem rename = contextMenu.Items[0] as MenuItem;
+                    MenuItem editPageIndex = contextMenu.Items[1] as MenuItem;
+                    MenuItem del = contextMenu.Items[2] as MenuItem;
+                    if (BookMarkListView.SelectedItems.Count > 1)
+                    {
+                        rename.IsEnabled = false;
+                        editPageIndex.IsEnabled = false;
+                    }
+                    else
+                    {
+                        rename.IsEnabled = true;
+                        editPageIndex.IsEnabled = true;
+                        editPageIndex.Command = viewModel.EditPageIndexCommand;
+                    }
+                }
+
+
+            }
         }
 
         /// <summary>

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

@@ -109,6 +109,7 @@
                             <StackPanel Margin="0">
                                 <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
                                 <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
+                                <MenuItem x:Name="添加已打开文件" Header="添加文件夹" Command="{Binding ADDOpenedPDFCommand}"></MenuItem>
                             </StackPanel>
                         </Border>
                     </Grid>

+ 1 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml

@@ -109,6 +109,7 @@
                             <StackPanel Margin="0">
                                 <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
                                 <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
+                                <MenuItem x:Name="添加已打开文件" Header="添加文件夹" Command="{Binding ADDOpenedPDFCommand}"></MenuItem>
                             </StackPanel>
                         </Border>
                     </Grid>

+ 1 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialog.xaml

@@ -103,6 +103,7 @@
                             <StackPanel Margin="0">
                                 <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
                                 <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
+                                <MenuItem x:Name="添加已打开文件" Header="添加文件夹" Command="{Binding ADDOpenedPDFCommand}"></MenuItem>
                             </StackPanel>
                         </Border>
                     </Grid>

+ 1 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml

@@ -109,6 +109,7 @@
                             <StackPanel Margin="0">
                                 <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
                                 <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
+                                <MenuItem x:Name="添加已打开文件" Header="添加文件夹" Command="{Binding ADDOpenedPDFCommand}"></MenuItem>
                             </StackPanel>
                         </Border>
                     </Grid>

+ 1 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml

@@ -109,6 +109,7 @@
                             <StackPanel Margin="0">
                                 <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
                                 <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
+                                <MenuItem x:Name="添加已打开文件" Header="添加文件夹" Command="{Binding ADDOpenedPDFCommand}"></MenuItem>
                             </StackPanel>
                         </Border>
                     </Grid>

+ 1 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageRemoveDialog.xaml

@@ -106,6 +106,7 @@
                             <StackPanel Margin="0">
                                 <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
                                 <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
+                                <MenuItem x:Name="添加已打开文件" Header="添加文件夹" Command="{Binding ADDOpenedPDFCommand}"></MenuItem>
                             </StackPanel>
                         </Border>
                     </Grid>

+ 1 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialog.xaml

@@ -102,6 +102,7 @@
                             <StackPanel Margin="0">
                                 <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
                                 <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
+                                <MenuItem x:Name="添加已打开文件" Header="添加文件夹" Command="{Binding ADDOpenedPDFCommand}"></MenuItem>
                             </StackPanel>
                         </Border>
                     </Grid>

+ 1 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml

@@ -109,6 +109,7 @@
                             <StackPanel Margin="0">
                                 <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
                                 <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
+                                <MenuItem x:Name="添加已打开文件" Header="添加文件夹" Command="{Binding ADDOpenedPDFCommand}"></MenuItem>
                             </StackPanel>
                         </Border>
                     </Grid>

+ 2 - 2
PDF Office/Views/EditTools/Bates/BatesCreateContent.xaml

@@ -122,7 +122,7 @@
                         </StackPanel>
                         <StackPanel Margin="8,0,0,0">
                             <TextBlock Text="起始页" FontSize="12" Foreground="#666666" Height="20" Width="36" HorizontalAlignment="Left"></TextBlock>
-                            <ComboBox Height="32" Width="110" ItemsSource="{Binding StarPagetNumberList}" SelectedIndex="{Binding StarPagetNumberIndex}"></ComboBox>
+                            <ComboBox Height="32" Width="110" ItemsSource="{Binding StarPagetNumberList}" SelectedIndex="{Binding StarPagetNumberIndex,Mode=TwoWay}"></ComboBox>
                         </StackPanel>
                     </StackPanel>
                 </StackPanel>
@@ -151,7 +151,7 @@
                             <RowDefinition Height="23"></RowDefinition>
                             <RowDefinition Height="23"></RowDefinition>
                         </Grid.RowDefinitions>
-                        <RadioButton Grid.Column="0" Grid.Row="0" Tag="0" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" ></RadioButton>
+                        <RadioButton Grid.Column="0" Grid.Row="0" Tag="0" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" IsChecked="True"></RadioButton>
                         <RadioButton Grid.Column="1" Grid.Row="0" Tag="1" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" ></RadioButton>
                         <RadioButton Grid.Column="2" Grid.Row="0" Tag="2" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" ></RadioButton>
                         <RadioButton Grid.Column="0" Grid.Row="1" Tag="3" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"></RadioButton>

+ 1 - 1
PDF Office/Views/EditTools/Bates/BatesTemplateListContent.xaml.cs

@@ -32,7 +32,7 @@ namespace PDF_Office.Views.EditTools.Bates
         {
             var listBox = sender as ListBox;
             viewModel.SelectTemplateItemCommand?.Execute(sender);
-            listBox.SelectedIndex = -1;
+            //listBox.SelectedIndex = -1;
         }
 
         private void MenuEdit_Click(object sender, RoutedEventArgs e)

+ 1 - 1
PDF Office/Views/EditTools/HeaderFooter/HeaderFooterCreateContent.xaml

@@ -143,7 +143,7 @@
                             <RowDefinition Height="23"></RowDefinition>
                             <RowDefinition Height="23"></RowDefinition>
                         </Grid.RowDefinitions>
-                        <RadioButton Grid.Column="0" Grid.Row="0" Tag="0" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" ></RadioButton>
+                        <RadioButton Grid.Column="0" Grid.Row="0" Tag="0" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" IsChecked="True"></RadioButton>
                         <RadioButton Grid.Column="1" Grid.Row="0" Tag="1" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" ></RadioButton>
                         <RadioButton Grid.Column="2" Grid.Row="0" Tag="2" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}" CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}" ></RadioButton>
                         <RadioButton Grid.Column="0" Grid.Row="1" Tag="3" GroupName="TextLocation" Height="23" Width="76" BorderThickness="1" BorderBrush="Black" Style="{StaticResource LocationRadioBtnStyle}" Command="{Binding ChangeLocationCommand}"  CommandParameter="{Binding RelativeSource={RelativeSource Self}, Path=Tag}"></RadioButton>

+ 1 - 1
PDF Office/Views/EditTools/HeaderFooter/HeaderFooterTemplateListContent.xaml.cs

@@ -34,7 +34,7 @@ namespace PDF_Office.Views.EditTools.HeaderFooter
         {
             var listBox = sender as ListBox;
             viewModel.SelectTemplateItemCommand?.Execute(sender);
-            listBox.SelectedIndex = -1;
+            //listBox.SelectedIndex = -1;
         }
 
         private void MenuEdit_Click(object sender, RoutedEventArgs e)

+ 29 - 16
PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml

@@ -183,24 +183,38 @@
                     </Border>
                 </Grid>
 
-
                 <StackPanel Orientation="Horizontal" Margin="0,20,0,0">
-                    <cus:CustomIconToggleBtn x:Name="BtnListMode" Tag="Line" Width="110" Height="32"
-                                              Style="{StaticResource ToggleBtnViewModeStyle}">
-                        <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30">
-                            <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" />
-                        </Border>
-                    </cus:CustomIconToggleBtn>
-                    <cus:CustomIconToggleBtn x:Name="BtnListMode1" Tag="Line" Width="110" Height="32"
-                                              Style="{StaticResource ToggleBtnViewModeStyle}">
-                        <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30" >
-                            <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
-                        </Border>
-                    </cus:CustomIconToggleBtn>
-                </StackPanel>
-            </StackPanel>
 
+                    <RadioButton x:Name="BtnSolid" Tag="Solid" GroupName="LineMode"
+                                 Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
+                                 VerticalContentAlignment="Center" Background="Transparent"
+                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                        <RadioButton.Content>
+                            <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" />
+                        </RadioButton.Content>
+                        <i:Interaction.Triggers>
+                            <i:EventTrigger EventName="Checked">
+                                <i:InvokeCommandAction Command="{Binding LineModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}" />
+                            </i:EventTrigger>
+                        </i:Interaction.Triggers>
+                    </RadioButton>
 
+                    <RadioButton x:Name="BtnDashed" Tag="Dashed" GroupName="LineMode"
+                                 Width="105" Height="32" Margin="0,0" Foreground="#616469"
+                                 VerticalContentAlignment="Center" Background="Transparent"
+                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                        <RadioButton.Content>
+                            <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
+                        </RadioButton.Content>
+                        <i:Interaction.Triggers>
+                            <i:EventTrigger EventName="Checked">
+                                <i:InvokeCommandAction Command="{Binding LineModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}" />
+                            </i:EventTrigger>
+                        </i:Interaction.Triggers>
+                    </RadioButton>
+
+                </StackPanel>
+            </StackPanel>
 
             <StackPanel x:Name="PnlEraser"  Visibility="{Binding IsPen,Converter={StaticResource InvertBoolToVisibleConvert}}">
                 <TextBlock x:Name="eText" LineHeight="20" Margin="12,14,0,0" >Border</TextBlock>
@@ -246,7 +260,6 @@
 
             </StackPanel>
           
-          
 
         </StackPanel>
     </Grid>

+ 299 - 184
PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml

@@ -4,7 +4,8 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
-              xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+             xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+             xmlns:cusColor="clr-namespace:PDF_Office.CustomControl.CompositeControl"
              xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:prism="http://prismlibrary.com/"             
              prism:ViewModelLocator.AutoWireViewModel="True"
@@ -96,180 +97,279 @@
                 </Grid>
             </Border>
 
-
-            <Border BorderBrush="#E2E3E6"  Height="32" Margin="12,0,4,0"  BorderThickness="0">
-                <StackPanel Orientation="Horizontal">
-                    <ComboBox IsReadOnly="True" Name="FontTitleBox" Background="Transparent" Padding="10 10 0 0"  Width="148"   BorderThickness="1" BorderBrush="#FFE2E3E6"
-                                ItemsSource="{Binding FontStyleList}"
-                              ItemTemplate="{StaticResource FontStyleData}"
-                              >
-                        <i:Interaction.Triggers>
-                            <i:EventTrigger EventName="SelectionChanged">
-                                <i:InvokeCommandAction Command="{Binding SelectedFontStyleCommand}" CommandParameter="{Binding ElementName=FontTitleBox,Path=SelectedItem}"/>
-                            </i:EventTrigger>
-                        </i:Interaction.Triggers>
-                    </ComboBox>
-                    <Button Width="32" Height="32" ContextMenu="{StaticResource BtnFlyoutMenu}"/>
-                </StackPanel>
+            <Border
+                    Height="32"
+                    Margin="0,8,0,18"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="0">
+                <Grid>
+                    <CompositeControl:CustomComboControl
+                            x:Name="FontTitleBox"
+                            Width="188"
+                            Height="32"
+                            HorizontalAlignment="Left"
+                            IsValueContent="True"
+                            ItemSource="{Binding PresetTextItems}"
+                            SelectedItems="{Binding PresetTextData, Mode=TwoWay}" />
+
+
+                    <Button
+                            Width="32"
+                            Height="32"
+                            HorizontalAlignment="Right"
+                            ContextMenu="{StaticResource BtnFlyoutMenu}"
+                            Style="{StaticResource btn.sec}">
+                        <Path
+                                Width="16"
+                                Height="16"
+                                Data="M4 8C4 8.82843 3.32843 9.5 2.5 9.5C1.67157 9.5 1 8.82843 1 8C1 7.17157 1.67157 6.5 2.5 6.5C3.32843 6.5 4 7.17157 4 8ZM9.3999 8C9.3999 8.82843 8.72833 9.5 7.8999 9.5C7.07148 9.5 6.3999 8.82843 6.3999 8C6.3999 7.17157 7.07148 6.5 7.8999 6.5C8.72833 6.5 9.3999 7.17157 9.3999 8ZM13.5 9.5C14.3284 9.5 15 8.82843 15 8C15 7.17157 14.3284 6.5 13.5 6.5C12.6716 6.5 12 7.17157 12 8C12 8.82843 12.6716 9.5 13.5 9.5Z"
+                                Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
+                    </Button>
+                </Grid>
             </Border>
 
 
-
-
             <TextBlock x:Name="FontText"  FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,18,0,0" >Font</TextBlock>
 
-            <Grid Margin="0,6,0,0">
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="auto"></ColumnDefinition>
-                    <ColumnDefinition Width="auto"></ColumnDefinition>
-                </Grid.ColumnDefinitions>
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                </Grid.RowDefinitions>
-
-                <Border BorderBrush="#E2E3E6"  Width="148" Height="32" Margin="12,0,4,0"  BorderThickness="0">
-                    <Grid>
-                        <ComboBox IsReadOnly="True" Name="FontFamilyBox" Background="Transparent" Padding="10 10 0 0"  BorderThickness="1" BorderBrush="#FFE2E3E6"
-                                >
-                            <ComboBox.ItemContainerStyle>
-                                <Style TargetType="{x:Type ComboBoxItem}">
-                                    <Setter Property="Padding" Value="10 0 0 0"/>
-                                </Style>
-                            </ComboBox.ItemContainerStyle>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                <TextBlock Text="Courier New" FontFamily="Courier New" Tag="Courier"  FontSize="14"/>
-                            </ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                <TextBlock Text="Arial" FontFamily="Arial" Tag="Helvetica" FontSize="14"/>
-                            </ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">
-                                <TextBlock Text="Times New Roman" FontFamily="Times New Roman" Tag="Times Roman" FontSize="14"/>
-                            </ComboBoxItem>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="SelectionChanged">
-                                    <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}" CommandParameter="{Binding ElementName=FontFamilyBox,Path=SelectedIndex}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ComboBox>
-
-                        <TextBox Name="FontFamilyText" FontFamily="Segoe UI" FontSize="14" Background="White"  Padding="10 0 0 0" Margin="2,0,25,0" IsReadOnly="True"
-                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left">
-                        </TextBox>
+            <StackPanel>
+                <TextBlock
+                        Margin="0,0,0,10"
+                        Style="{StaticResource PropertyHeaderLv2}"
+                        Text="文本" />
+
+                <StackPanel>
+                    <CompositeControl:CustomComboControl
+                            x:Name="FontFamilyBox"
+                            Height="32"
+                            IsValueContent="True"
+                            ItemSource="{Binding FontFamilyItems}"
+                            SelectedItems="{Binding FontFamilyData, Mode=TwoWay}" />
+
+                    <Grid Margin="0,8">
+                        <CompositeControl:CustomComboControl
+                                x:Name="FontStyleBox"
+                                Width="110"
+                                Height="32"
+                                HorizontalAlignment="Left"
+                                IsValueContent="True"
+                                ItemSource="{Binding FontStyleItems}"
+                                SelectedItems="{Binding FontWeightStyleItem, Mode=TwoWay}" />
+
+
+                        <CompositeControl:CustomComboControl
+                                x:Name="FontSizeBox"
+                                Width="110"
+                                Height="32"
+                                HorizontalAlignment="Right"
+                                SelectedItems="{Binding FontSizeData, Mode=TwoWay}" />
                     </Grid>
-                </Border>
-
-                <cus:ColorDropBox x:Name="FontColorBox" Grid.Column="1" Grid.Row="1" SelectedColorChanged="FontColorBox_SelectedColorChanged" BorderThickness="1" BorderBrush="#E2E3E6" Width="80" Height="32" HorizontalAlignment="Left"
-                                   ></cus:ColorDropBox>
-
-                <Border Grid.Row="1" BorderBrush="#E2E3E6"  Width="148" Height="32" Margin="12,8,4,0"  BorderThickness="0">
                     <Grid>
-                        <ComboBox Name="FontStyleBox" IsReadOnly="True" BorderThickness="1" BorderBrush="#FFE2E3E6" Padding="10 10 0 0" Background="Transparent">
-                            <ComboBox.ItemContainerStyle>
-                                <Style TargetType="{x:Type ComboBoxItem}">
-                                    <Setter Property="Padding" Value="10 0 0 0"/>
-                                </Style>
-                            </ComboBox.ItemContainerStyle>
-                            <ComboBoxItem x:Name="RegularItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Regular</ComboBoxItem>
-                            <ComboBoxItem x:Name="BoldItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold</ComboBoxItem>
-                            <ComboBoxItem x:Name="ItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Italic</ComboBoxItem>
-                            <ComboBoxItem x:Name="BoldItalicItem" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">Bold Italic</ComboBoxItem>
-
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="SelectionChanged">
-                                    <i:InvokeCommandAction Command="{Binding FontStyleChangedCommand}" CommandParameter="{Binding ElementName=FontStyleBox,Path=SelectedItem}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ComboBox>
-                        <TextBox Name="FontStyleText" IsReadOnly="True" FontFamily="Segoe UI" FontSize="14" Background="White" Padding="10 0 0 0" Height="20" Margin="2,0,35,0" 
-                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left">
-                        </TextBox>
-                    </Grid>
-                </Border>
-
-                <Border Grid.Row="0" Grid.Column="1" BorderBrush="#E2E3E6"  Width="80" Height="32" Margin="-1,8,0,0"  BorderThickness="0">
-                    <Grid>
-                        <ComboBox Name="FontSizeBox" BorderThickness="1" Background="Transparent" BorderBrush="#FFE2E3E6"
-                                  MaxDropDownHeight="200">
-                            <ComboBox.ItemContainerStyle>
-                                <Style TargetType="{x:Type ComboBoxItem}">
-                                    <Setter Property="Padding" Value="10 0 0 0"/>
-                                </Style>
-                            </ComboBox.ItemContainerStyle>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">6</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">8</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">9</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">10</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">12</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">14</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">18</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">20</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">22</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">24</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">26</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">28</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">32</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">36</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">48</ComboBoxItem>
-                            <ComboBoxItem Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}">72</ComboBoxItem>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="SelectionChanged">
-                                    <i:InvokeCommandAction Command="{Binding FontSizeChangedCommand}" CommandParameter="{Binding ElementName=FontSizeBox,Path=SelectedItem}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ComboBox>
-                        <TextBox Name="FontSizeText" FontFamily="Segoe UI" FontSize="14" Background="White" Height="20" Padding="10 0 0 0" Margin="2,0,35,0" 
-                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" IsReadOnly="True">
-                        </TextBox>
-                    </Grid>
-                </Border>
-
-
-                <Border Grid.ColumnSpan="2" Grid.Row="2" Width="148" Height="32" Margin="12,8,0,0" BorderThickness="1" BorderBrush="#FFE2E3E6" HorizontalAlignment="Left">
-                    <Grid Name="ToolGrid">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="*"></ColumnDefinition>
-                            <ColumnDefinition Width="*"></ColumnDefinition>
-                            <ColumnDefinition Width="*"></ColumnDefinition>
-                        </Grid.ColumnDefinitions>
-
-                        <ToggleButton Name="TextAlignLeftBtn" Tag="AlignLeft" Background="Transparent" BorderThickness="0" Click="BtnTextAlign_Click">
-                            <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#000000" Data="M10,11 L10,12 L0,12 L0,11 L10,11 Z M16,7 L16,8 L0,8 L0,7 L16,7 Z M13,3 L13,4 L0,4 L0,3 L13,3 Z">
-                            </Path>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="Checked">
-                                    <i:InvokeCommandAction Command="{Binding TextAlignChecked}" CommandParameter="{Binding ElementName=TextAlignLeftBtn,Path=Tag}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ToggleButton>
-                        <Line HorizontalAlignment="Left" Style="{StaticResource line1Style}" VerticalAlignment="Center" Grid.Column="1" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000"></Line>
-
-                        <ToggleButton Name="TextAlignCenterBtn" Tag="AlignCenter" Grid.Column="1" Background="Transparent"  BorderThickness="0"  Click="BtnTextAlign_Click">
-                            <Path HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#000000" Data="M16,11 L16,12 L0,12 L0,11 L16,11 Z M13,7 L13,8 L3,8 L3,7 L13,7 Z M16,3 L16,4 L0,4 L0,3 L16,3 Z">
-                            </Path>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="Checked">
-                                    <i:InvokeCommandAction Command="{Binding TextAlignChecked}" CommandParameter="{Binding ElementName=TextAlignCenterBtn,Path=Tag}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ToggleButton>
-                        <Line HorizontalAlignment="Left" Style="{StaticResource line2Style}" VerticalAlignment="Center" Grid.Column="2" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000"></Line>
-
-                        <ToggleButton Name="TextAlignRightBtn" Tag="AlignRight" Grid.Column="2" Background="Transparent"  BorderThickness="0"  Click="BtnTextAlign_Click">
-                            <Path HorizontalAlignment="Center" VerticalAlignment="Center"  Fill="#000000" Data="M16,11 L16,12 L6.00061035,12 L6.00061035,11 L16,11 Z M16,7 L16,8 L0.0009765625,8 L0.0009765625,7 L16,7 Z M16,3 L16,4 L3.00079346,4 L3.00079346,3 L16,3 Z">
-                            </Path>
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="Checked">
-                                    <i:InvokeCommandAction Command="{Binding TextAlignChecked}" CommandParameter="{Binding ElementName=TextAlignRightBtn,Path=Tag}"/>
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </ToggleButton>
+                        <StackPanel Orientation="Horizontal">
+                            <RadioButton
+                                    x:Name="TextAlignLeftBtn"
+                                    Width="32"
+                                    Height="32"
+                                    VerticalContentAlignment="Center"
+                                    Background="Transparent"
+                                    Foreground="#616469"
+                                    GroupName="TextAlign"
+                                    IsChecked="True"
+                                    Style="{DynamicResource GreyBgRadioBtnStyle}"
+                                    Tag="AlignLeft">
+                                <RadioButton.Content>
+                                    <Grid Width="32" Height="32">
+                                        <Canvas Margin="5,10,0,0">
+                                            <Rectangle
+                                                    Canvas.Top="0.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Top="4.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Top="12.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Top="8.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                        </Canvas>
+                                    </Grid>
+                                </RadioButton.Content>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignLeftBtn, Path=Tag}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+
+                            <RadioButton
+                                    x:Name="TextAlignCenterBtn"
+                                    Width="32"
+                                    Height="32"
+                                    Margin="8,0"
+                                    VerticalContentAlignment="Center"
+                                    Background="Transparent"
+                                    Foreground="#616469"
+                                    GroupName="TextAlign"
+                                    Style="{DynamicResource GreyBgRadioBtnStyle}"
+                                    Tag="AlignCenter">
+                                <RadioButton.Content>
+                                    <Grid Width="32" Height="32">
+                                        <Canvas Margin="5,10,0,0">
+                                            <Rectangle
+                                                    Canvas.Top="0.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Left="3"
+                                                    Canvas.Top="4.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Left="3"
+                                                    Canvas.Top="12.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Top="8.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                        </Canvas>
+                                    </Grid>
+                                </RadioButton.Content>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignCenterBtn, Path=Tag}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+
+                            <RadioButton
+                                    x:Name="TextAlignRightBtn"
+                                    Grid.Column="2"
+                                    Width="32"
+                                    Height="32"
+                                    VerticalContentAlignment="Center"
+                                    Background="Transparent"
+                                    Foreground="#616469"
+                                    GroupName="TextAlign"
+                                    Style="{DynamicResource GreyBgRadioBtnStyle}"
+                                    Tag="AlignRight">
+                                <RadioButton.Content>
+                                    <Grid Width="32" Height="32">
+                                        <Canvas Margin="5,10,0,0">
+                                            <Rectangle
+                                                    Canvas.Top="0.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Left="6"
+                                                    Canvas.Top="4.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Left="6"
+                                                    Canvas.Top="12.25"
+                                                    Width="8"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Top="8.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                        </Canvas>
+                                    </Grid>
+                                </RadioButton.Content>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignRightBtn, Path=Tag}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+
+                            <RadioButton
+                                    x:Name="TextAlignBtn"
+                                    Grid.Column="3"
+                                    Width="32"
+                                    Height="32"
+                                    Margin="8,0"
+                                    VerticalContentAlignment="Center"
+                                    Background="Transparent"
+                                    Foreground="#616469"
+                                    GroupName="TextAlign"
+                                    Style="{DynamicResource GreyBgRadioBtnStyle}"
+                                    Tag="Align">
+                                <RadioButton.Content>
+                                    <Grid Width="32" Height="32">
+                                        <Canvas Margin="5,10,0,0">
+                                            <Rectangle
+                                                    Canvas.Top="0.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Top="8.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Top="4.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                            <Rectangle
+                                                    Canvas.Top="12.25"
+                                                    Width="14"
+                                                    Height="1.5"
+                                                    Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
+                                                    StrokeThickness="1.5" />
+                                        </Canvas>
+                                    </Grid>
+                                </RadioButton.Content>
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="Checked">
+                                        <i:InvokeCommandAction Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignBtn, Path=Tag}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </RadioButton>
+                        </StackPanel>
+                        <cusColor:ColorContent
+                                x:Name="FontColorBox"
+                                Width="56"
+                                HorizontalAlignment="Right"
+                                ShowColorList="Collapsed" />
                     </Grid>
-                </Border>
-            </Grid>
-
-
+                </StackPanel>
+            </StackPanel>
             <Grid Margin="0,18,0,0">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="auto"/>
@@ -280,12 +380,11 @@
             </Grid>
 
 
-         
+<!--MVP-->
 
-            <TextBlock x:Name="thicknessText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
+            <TextBlock x:Name="thicknessText" Visibility="Collapsed" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
 
-
-            <Grid>
+            <Grid Visibility="Collapsed">
                 <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="*"></ColumnDefinition>
                     <ColumnDefinition Width="auto"></ColumnDefinition>
@@ -326,20 +425,36 @@
                 </Border>
             </Grid>
 
+            <StackPanel Visibility="Collapsed" Orientation="Horizontal" Margin="0,20,0,0">
+
+                <RadioButton x:Name="BtnSolid" Tag="Solid" GroupName="LineMode"
+                                 Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
+                                 VerticalContentAlignment="Center" Background="Transparent"
+                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                    <RadioButton.Content>
+                        <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" />
+                    </RadioButton.Content>
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Checked">
+                            <i:InvokeCommandAction Command="{Binding LineModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </RadioButton>
+
+                <RadioButton x:Name="BtnDashed" Tag="Dashed" GroupName="LineMode"
+                                 Width="105" Height="32" Margin="0,0" Foreground="#616469"
+                                 VerticalContentAlignment="Center" Background="Transparent"
+                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                    <RadioButton.Content>
+                        <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
+                    </RadioButton.Content>
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Checked">
+                            <i:InvokeCommandAction Command="{Binding LineModeCheckedCommand}" CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </RadioButton>
 
-            <StackPanel x:Name="PnlLineStyle" Orientation="Horizontal" Margin="0,20,0,0">
-                <cus:CustomIconToggleBtn x:Name="BtnSolidLine" Tag="Solid" Width="110" Height="32" Click="BtnLineStyle_Click"
-                                              Style="{StaticResource ToggleBtnViewModeStyle}">
-                    <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30">
-                        <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" />
-                    </Border>
-                </cus:CustomIconToggleBtn>
-                <cus:CustomIconToggleBtn x:Name="BtnDottedLine" Tag="Dotted" Width="110" Height="32" Click="BtnLineStyle_Click"
-                                              Style="{StaticResource ToggleBtnViewModeStyle}">
-                    <Border BorderBrush="Black" BorderThickness="1" Padding="8,0,8,0" Width="108" Height="30" >
-                        <Line X1="10" Y1="15" X2="260" Y2="15" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
-                    </Border>
-                </cus:CustomIconToggleBtn>
             </StackPanel>
         </StackPanel>
     </Grid>

+ 42 - 42
PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml.cs

@@ -27,9 +27,9 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
         public FreetextAnnotProperty()
         {
             InitializeComponent();
-            FontFamilyBox.SelectionChanged += FontFamilyBox_SelectionChanged;
-            FontStyleBox.SelectionChanged += FontStyleBox_SelectionChanged;
-            FontSizeBox.SelectionChanged += FontSizeBox_SelectionChanged;
+            //FontFamilyBox.SelectionChanged += FontFamilyBox_SelectionChanged;
+            //FontStyleBox.SelectionChanged += FontStyleBox_SelectionChanged;
+            //FontSizeBox.SelectionChanged += FontSizeBox_SelectionChanged;
             ThicknessBox.SelectionChanged += ThicknessBox_SelectionChanged; 
             this.Loaded += usercontrol_Loaded;
             cusColor.SelectedColorHandler += cusColor_SelectedColorHandler;
@@ -65,65 +65,65 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
 
         private void FontSizeBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
-            var listItem = FontSizeBox.ItemContainerGenerator.ContainerFromItem(FontSizeBox.SelectedItem) as ComboBoxItem;
-            if (listItem != null)
-                FontSizeText.Text = listItem.Content.ToString();
-            else
-                FontSizeText.Text = "6";
+            //var listItem = FontSizeBox.ItemContainerGenerator.ContainerFromItem(FontSizeBox.SelectedItem) as ComboBoxItem;
+            //if (listItem != null)
+            //    FontSizeText.Text = listItem.Content.ToString();
+            //else
+            //    FontSizeText.Text = "6";
            
         }
 
         private void FontStyleBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
-            var listItem = FontStyleBox.ItemContainerGenerator.ContainerFromItem(FontStyleBox.SelectedItem) as ComboBoxItem;
-            if (listItem != null)
-                FontStyleText.Text = listItem.Content.ToString();
-            else
-                FontStyleText.Text = "Regular";
+            //var listItem = FontStyleBox.ItemContainerGenerator.ContainerFromItem(FontStyleBox.SelectedItem) as ComboBoxItem;
+            //if (listItem != null)
+            //    FontStyleText.Text = listItem.Content.ToString();
+            //else
+            //    FontStyleText.Text = "Regular";
           
         }
 
         private void FontFamilyBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
-            var listItem = FontFamilyBox.ItemContainerGenerator.ContainerFromItem(FontFamilyBox.SelectedItem) as ComboBoxItem;
-            if (listItem != null)
-                FontFamilyText.Text = (listItem.Content as TextBlock).Text;
-            else
-                FontFamilyText.Text = "Courier New";
+            //var listItem = FontFamilyBox.ItemContainerGenerator.ContainerFromItem(FontFamilyBox.SelectedItem) as ComboBoxItem;
+            //if (listItem != null)
+            //    FontFamilyText.Text = (listItem.Content as TextBlock).Text;
+            //else
+            //    FontFamilyText.Text = "Courier New";
         }
 
         private void BtnTextAlign_Click(object sender, RoutedEventArgs e)
         {
 
-            var btn = sender as ToggleButton;
-            foreach(var item in ToolGrid.Children)
-            {
-                var btnItem = item as ToggleButton;
-                if(btnItem != null)
-                {
-                    if(btn!= btnItem)
-                        btnItem.IsChecked = false;
-                    else
-                        btnItem.IsChecked = true;
-                }
-            }
+            //var btn = sender as ToggleButton;
+            //foreach(var item in ToolGrid.Children)
+            //{
+            //    var btnItem = item as ToggleButton;
+            //    if(btnItem != null)
+            //    {
+            //        if(btn!= btnItem)
+            //            btnItem.IsChecked = false;
+            //        else
+            //            btnItem.IsChecked = true;
+            //    }
+            //}
            
         }
 
         private void BtnLineStyle_Click(object sender, RoutedEventArgs e)
         {
-            var btn = sender as CustomIconToggleBtn;
-            foreach (var item in PnlLineStyle.Children)
-            {
-                var btnItem = item as CustomIconToggleBtn;
-                if (btnItem != null)
-                {
-                    if (btn != btnItem)
-                        btnItem.IsChecked = false;
-                    else
-                        btnItem.IsChecked = true;
-                }
-            }
+            //var btn = sender as CustomIconToggleBtn;
+            //foreach (var item in PnlLineStyle.Children)
+            //{
+            //    var btnItem = item as CustomIconToggleBtn;
+            //    if (btnItem != null)
+            //    {
+            //        if (btn != btnItem)
+            //            btnItem.IsChecked = false;
+            //        else
+            //            btnItem.IsChecked = true;
+            //    }
+            //}
         }
 
         private void FontColorBox_SelectedColorChanged(object sender, Color? e)

+ 28 - 56
PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml

@@ -252,8 +252,6 @@
 
             </Grid>
 
-
-
             <Grid>
                 <Grid.ColumnDefinitions>
                     <ColumnDefinition Width="*" />
@@ -342,63 +340,37 @@
                 </Border>
             </Grid>
 
+            <StackPanel  x:Name="PnlLineStyle" Orientation="Horizontal" Margin="0,20,0,0">
 
-            <StackPanel
-                x:Name="PnlLineStyle"
-                Margin="0,20,0,0"
-                Orientation="Horizontal">
-                <cus:CustomIconToggleBtn
-                    x:Name="BtnSolidLine"
-                    Width="110"
-                    Height="32"
-                    Click="BtnLineStyle_Click"
-                    Command="{Binding LineStyleCommand}"
-                    CommandParameter="{Binding ElementName=BtnSolidLine, Path=Tag}"
-                    Style="{StaticResource ToggleBtnViewModeStyle}"
-                    Tag="Solid">
-                    <Border
-                        Width="108"
-                        Height="30"
-                        Padding="8,0,8,0"
-                        BorderBrush="Black"
-                        BorderThickness="1">
-                        <Line
-                            Stroke="Black"
-                            StrokeThickness="2"
-                            X1="10"
-                            X2="260"
-                            Y1="15"
-                            Y2="15" />
-                    </Border>
-                </cus:CustomIconToggleBtn>
-                <cus:CustomIconToggleBtn
-                    x:Name="BtnDottedLine"
-                    Width="110"
-                    Height="32"
-                    Click="BtnLineStyle_Click"
-                    Command="{Binding LineStyleCommand}"
-                    CommandParameter="{Binding ElementName=BtnDottedLine, Path=Tag}"
-                    Style="{StaticResource ToggleBtnViewModeStyle}"
-                    Tag="Dotted">
-                    <Border
-                        Width="108"
-                        Height="30"
-                        Padding="8,0,8,0"
-                        BorderBrush="Black"
-                        BorderThickness="1">
-                        <Line
-                            Stroke="Black"
-                            StrokeDashArray="2"
-                            StrokeThickness="2"
-                            X1="10"
-                            X2="260"
-                            Y1="15"
-                            Y2="15" />
-                    </Border>
-                </cus:CustomIconToggleBtn>
-            </StackPanel>
+                <RadioButton x:Name="BtnSolid" Tag="Solid" GroupName="LineMode"
+                                 Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
+                                 VerticalContentAlignment="Center" Background="Transparent"
+                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                    <RadioButton.Content>
+                        <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" />
+                    </RadioButton.Content>
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Checked">
+                            <i:InvokeCommandAction Command="{Binding LineStyleCommand}" CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </RadioButton>
 
+                <RadioButton x:Name="BtnDashed" Tag="Dashed" GroupName="LineMode"
+                                 Width="105" Height="32" Margin="0,0" Foreground="#616469"
+                                 VerticalContentAlignment="Center" Background="Transparent"
+                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                    <RadioButton.Content>
+                        <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
+                    </RadioButton.Content>
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="Checked">
+                            <i:InvokeCommandAction Command="{Binding LineStyleCommand}" CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </RadioButton>
 
+            </StackPanel>
 
         </StackPanel>
     </Grid>

+ 2 - 4
PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml.cs

@@ -98,13 +98,11 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
         {
             if (isSolid)
             {
-                BtnSolidLine.IsChecked = true;
-                BtnDottedLine.IsChecked = false;
+                BtnSolid.IsChecked = true;
             }
             else
             {
-                BtnDottedLine.IsChecked = true;
-                BtnSolidLine.IsChecked = false;
+                BtnDashed.IsChecked = true;
             }
         }
 

+ 5 - 2
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml

@@ -119,6 +119,7 @@
                     Name="RbtnReadMode"
                     HorizontalAlignment="Left"
                     Click="RbtnReadMode_Click"
+                    GroupName="DisplayMode"
                     Style="{StaticResource ViewModeViewRadioBtn}">
                     <StackPanel Margin="0,0,3,0">
                         <Grid
@@ -142,8 +143,9 @@
                     Margin="4,0,4,0"
                     Command="{Binding OpenFullCommand}"
                     GroupName="DisplayMode"
+                    IsChecked="{Binding IsFullScreen}"
                     Style="{StaticResource ViewModeViewRadioBtn}">
-                    <StackPanel Margin="0,0,3,0">
+                    <StackPanel Margin="0,0,3,0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                         <Path
                             Margin="0,0,0,8"
                             HorizontalAlignment="Center"
@@ -159,7 +161,8 @@
                     Name="RBtnSlide"
                     Margin="0,0,4,0"
                     GroupName="DisplayMode"
-                    Style="{StaticResource ViewModeViewRadioBtn}">
+                    Style="{StaticResource ViewModeViewRadioBtn}"
+                    Visibility="Collapsed">
                     <StackPanel Margin="0,0,3,0">
                         <Grid
                             Width="16"

+ 1 - 1
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs

@@ -47,7 +47,7 @@ namespace PDF_Office.Views.PropertyPanel.ViewModular
                     {
                         //viewContent.RbtnReadMode(sender, e);
                         ViewContentViewModel model = viewContent.DataContext as ViewContentViewModel;
-                        model.RbtnReadMode(viewContent);
+                        model.RbtnReadMode();
                     }
                 }
             }

Разница между файлами не показана из-за своего большого размера
+ 1 - 1
PDF Office/Views/Tools/AnnotToolContent.xaml


+ 20 - 7
PDF Office/Views/ViewContent.xaml

@@ -376,13 +376,26 @@
                 VerticalAlignment="Top"
                 Background=" #BDDFFD"
                 Visibility="{Binding LinkAnnotTipVisibility}">
-                <TextBlock
-                    x:Name="DrawTipsText"
-                    Margin="12,4"
-                    Padding="4,2,4,2"
-                    FontSize="14"
-                    Foreground="#252629"
-                    Text="Please use the scroll bar, thumbnail tool to locate the target page, click or box the area to select the target range" />
+                <WrapPanel Orientation="Horizontal">
+                    <Grid
+                        Width="16"
+                        Height="16"
+                        Margin="9,4">
+                        <Ellipse
+                            Width="16"
+                            Height="16"
+                            Fill="{StaticResource color.icon.base.state.info}" />
+                        <Path Data="M7.25 4V5.5H8.75L8.75 4H7.25ZM7.25 7V12H8.75V7H7.25Z" Fill="White" />
+                    </Grid>
+
+                    <TextBlock
+                        x:Name="DrawTipsText"
+                        Margin="0,4,12,4"
+                        Padding="4,2,4,2"
+                        FontSize="14"
+                        Foreground="#252629"
+                        Text="Please use the scroll bar, thumbnail tool to locate the target page, click or box the area to select the target range" />
+                </WrapPanel>
             </Border>
         </Grid>