Forráskód Böngészése

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

# Conflicts:
#	PDF Office/Views/Dialog/SettingsDialog.xaml
ZhouJieSheng 2 éve
szülő
commit
84f156210b
66 módosított fájl, 3317 hozzáadás és 1908 törlés
  1. BIN
      PDF Office/ComPDFKit.Desk.dll
  2. BIN
      PDF Office/ComPDFKit.Viewer.dll
  3. 1 1
      PDF Office/CustomControl/PageTurningPreview.xaml
  4. 236 14
      PDF Office/Helper/PopControlHelper.cs
  5. 1 0
      PDF Office/Helper/RichTextBoxHelper.cs
  6. 34 23
      PDF Office/Helper/SecurityHelper.cs
  7. 11 4
      PDF Office/Model/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogModel.cs
  8. BIN
      PDF Office/Resources/BOTA/empty_bookmark.png
  9. 11 654
      PDF Office/Styles/ContextMenuStyle.xaml
  10. 13 50
      PDF Office/Styles/ExpanderStyle.xaml
  11. 29 23
      PDF Office/Styles/ListViewStyle.xaml
  12. 26 1
      PDF Office/Styles/PathButtonStyle.xaml
  13. 51 0
      PDF Office/Styles/RadioButtonStyle.xaml
  14. 78 0
      PDF Office/Styles/TextBoxStyle.xaml
  15. 49 0
      PDF Office/Styles/ToggleButton.xaml
  16. 1 1
      PDF Office/Themes/Generic.xaml
  17. 6 0
      PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs
  18. 19 39
      PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs
  19. 2 2
      PDF Office/ViewModels/BOTA/SearchContentViewModel.cs
  20. 4 4
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs
  21. 3 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs
  22. 1 1
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDocumentContentViewModel.cs
  23. 16 13
      PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs
  24. 5 5
      PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogViewModel.cs
  25. 67 25
      PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogViewModel.cs
  26. 252 125
      PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs
  27. 66 22
      PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs
  28. 17 4
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs
  29. 21 5
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs
  30. 1 1
      PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs
  31. 3 9
      PDF Office/ViewModels/TipContent/FileRestrictedTipViewModel.cs
  32. 23 16
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  33. 373 0
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  34. 451 163
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs
  35. 56 6
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  36. 36 30
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  37. 29 20
      PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs
  38. 36 12
      PDF Office/ViewModels/ViewContentViewModel.cs
  39. 6 7
      PDF Office/Views/BOTA/AnnotationContent.xaml
  40. 17 11
      PDF Office/Views/BOTA/AnnotationListItem.xaml
  41. 39 30
      PDF Office/Views/BOTA/BookmarkContent.xaml
  42. 94 5
      PDF Office/Views/BOTA/BookmarkContent.xaml.cs
  43. 187 32
      PDF Office/Views/BOTA/SearchContent.xaml
  44. 55 4
      PDF Office/Views/BOTA/SearchContent.xaml.cs
  45. 20 14
      PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml
  46. 26 23
      PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml
  47. 11 11
      PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml
  48. 9 9
      PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml
  49. 11 11
      PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml
  50. 11 11
      PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml
  51. 11 11
      PDF Office/Views/Dialog/ConverterDialogs/ConverterTextDialog.xaml
  52. 21 19
      PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml
  53. 141 66
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml
  54. 105 26
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialog.xaml
  55. 58 6
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDocumentContent.xaml
  56. 2 2
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModBookletContent.xaml
  57. 3 3
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModMultipleContent.xaml
  58. 26 28
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModPosterContent.xaml
  59. 170 64
      PDF Office/Views/Dialog/ToolsDialogs/MergeDialog.xaml
  60. 4 3
      PDF Office/Views/FillAndSign/PropertyPanel/ShapFillProperty.xaml
  61. 22 13
      PDF Office/Views/PropertyPanel/AnnotPanel/LinkAnnotProperty.xaml
  62. 1 1
      PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml
  63. 155 166
      PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml
  64. 15 15
      PDF Office/Views/TipContent/LinkAnnotTip.xaml
  65. 67 43
      PDF Office/Views/Tools/ConverterBarContent.xaml
  66. 2 1
      PDF Office/Views/ViewContent.xaml

BIN
PDF Office/ComPDFKit.Desk.dll


BIN
PDF Office/ComPDFKit.Viewer.dll


+ 1 - 1
PDF Office/CustomControl/PageTurningPreview.xaml

@@ -8,7 +8,7 @@
              Height="320" Width="212">
     <Grid Width="212" Height="320">
         <StackPanel Orientation="Vertical" Height="320">
-            <Border  Margin="0,16,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Background="LightGray"  Height="248" Width="180">
+            <Border  Margin="0,16,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Background="#0000001A"  Height="248" Width="180">
                 <Viewbox>
                     <Image Name="Image" Height="248" Width="180"></Image>
                 </Viewbox>

+ 236 - 14
PDF Office/Helper/PopControlHelper.cs

@@ -314,8 +314,13 @@ namespace PDF_Office.Helper
         //设置UI内容
         public void SetMenuUI(int index, UIElement controls)
         {
-            PopMenu.Items.Insert(index, controls);
-            GetMenuItems();
+            var menuItem = ContainterOfIndex(index);
+
+            if (menuItem != null)
+            {
+                menuItem.Header = controls;
+            }
+
         }
 
         //按索引号设置菜单
@@ -367,7 +372,7 @@ namespace PDF_Office.Helper
         }
 
         //按索引号设置子菜单
-        public void SetSubMenuBinding(int index, int subIndex, ICommand command, object comTarget = null)
+        public void SetSubMenuBinding(int index, int subIndex, ICommand command, object comTarget = null,bool isChecked = false)
         {
             var menuItem = ContainterOfIndex(index);
 
@@ -379,25 +384,57 @@ namespace PDF_Office.Helper
                     if(item is RadioButton)
                     {
                         var radioItem = item as RadioButton;
-                        radioItem.CommandParameter = radioItem.IsChecked;
+                        radioItem.IsChecked = isChecked;
+                        if (CommandTarget == null)
+                            CommandTarget = comTarget;
 
-                        if (comTarget == null)
-                            radioItem.DataContext = (UIElement)CommandTarget;
-                        else
-                            radioItem.DataContext = (UIElement)comTarget;
+                        radioItem.DataContext = CommandTarget;
+                        radioItem.CommandParameter = radioItem;
 
                         radioItem.Command = command;
                     }
                     else if(item is MenuItem)
                     {
-                        var menuitem = item as MenuItem;
-      
+                        var submenuitem = item as MenuItem;
+
                         if (comTarget == null)
-                            menuitem.CommandTarget = (UIElement)CommandTarget;
+                        {
+                            if (CommandTarget is UIElement)
+                            {
+                                submenuitem.CommandTarget = (UIElement)CommandTarget;
+                            }
+
+                            
+                            if (isChecked)
+                            {
+                                submenuitem.DataContext = CommandTarget;
+                                submenuitem.CommandParameter = submenuitem;//isChecked为true时,可拿MenuItem
+                            }
+                            else
+                            {
+                                submenuitem.DataContext = CommandTarget;
+                                submenuitem.CommandParameter = CommandTarget;
+                            }
+                            
+                        }
+
                         else
-                            menuitem.CommandTarget = (UIElement)comTarget;
-                      
-                        menuItem.Command = command;
+                        {
+                            if (comTarget is UIElement)
+                            {
+                                submenuitem.CommandTarget = (UIElement)comTarget;
+                            }
+                            if (isChecked)
+                            {
+                                submenuitem.CommandParameter = submenuitem;//isChecked为true时,可拿MenuItem
+                            }
+                            else
+                            {
+                                submenuitem.CommandParameter = CommandTarget;
+                            }
+                           
+                        }
+                        submenuitem.Command = command;
                     }
                 }
                 
@@ -470,6 +507,191 @@ namespace PDF_Office.Helper
 
     }
 
+    //菜单按钮类
+    public class CusMenuItem
+    {
+        public Control control { get; private set; }//菜单按钮控件
+        public int Level { get; private set; }//菜单按钮的层级数。Level为0是一级菜单
+        public object Parameter { get; private set; }//核心处理的参数
+        public object tag { get; private set; }//菜单控件Tag
+        public void SetFlagControl(Control control)
+        {
+            this.control = control;
+            tag = control.Tag;
+        }
+
+        public void SetParameter(object parameter)
+        {
+            Parameter = parameter;
+        }
+    }
+
+
+
+
+    public class PopMenu
+    {
+        /// <summary>
+        /// 菜单栏
+        /// </summary>
+        public ContextMenu ContMenu { get; private set; }
+        /// <summary>
+        /// 菜单按钮集合
+        /// </summary>
+        public List<CusMenuItem> Controls { get; private set; }
+
+        public PopMenu(ContextMenu popMenu)
+        {
+            ContMenu = popMenu;
+        }
+
+        /// <summary>
+        /// 打开右键菜单(parameter:commmand核心参数,uiParameter:响应复制粘贴等指令的参数)
+        /// </summary>
+        public ContextMenu OpenMenu(object parameter, object uiParameter = null)
+        {
+            if (Controls == null) return null;
+
+            foreach(var item in Controls)
+            {
+                item.control.DataContext = parameter;
+                if (uiParameter is UIElement && uiParameter != null)
+                    BindingParameter(item, parameter, (UIElement)uiParameter);
+                else
+                    BindingParameter(item, parameter);
+            }
+
+            return ContMenu;
+        }
+
+        /// <summary>
+        /// 右键菜单:创建菜单按钮、单选按钮等
+        /// </summary>
+        public CusMenuItem AddItem(Control control)
+        {
+            if (control == null) return null;
+
+            CusMenuItem controlMenu = new CusMenuItem();
+            controlMenu.SetFlagControl(control);
+            if (Controls == null)
+                Controls = new List<CusMenuItem>();
+
+            ContMenu.Items.Add(controlMenu.control);
+            Controls.Add(controlMenu);
+
+            return controlMenu;
+        }
+
+        //在某菜单按钮的子级,新增子菜单按钮
+        public CusMenuItem AddChild(string parentName, Control child)
+        {
+            if (Controls == null || child == null) return null;
+
+            CusMenuItem childItem = null;
+            foreach (var item in Controls)
+            {
+                var menu = item.control as MenuItem;
+
+                if (menu != null && menu.Name == parentName)
+                {
+                    childItem = new CusMenuItem();
+                    childItem.SetFlagControl(child);
+                    menu.Items.Add(child);
+                    Controls.Add(childItem);
+                    break;
+                }
+            }
+
+            return childItem;
+        }
+
+        //菜单按钮事件绑定
+        public void BindingEvent(CusMenuItem controlMenu,ICommand command)
+        {
+            if (controlMenu == null) return;
+
+
+
+            if(controlMenu.control is RadioButton)
+            {
+                var Btn = (RadioButton)controlMenu.control;
+                Btn.CommandParameter = controlMenu;
+                Btn.Command = command;
+            }
+            else if(controlMenu.control is MenuItem)
+            {
+                var Btn = (MenuItem)controlMenu.control;
+                Btn.CommandParameter = controlMenu;
+                Btn.Command = command;
+            }
+        }
+
+        /// <summary>
+        /// 右键菜单时,菜单按钮command需要的参数
+        /// </summary>
+        private void BindingParameter(CusMenuItem controlMenu, object CommandParameter, UIElement uIElement = null)
+        {
+            if (controlMenu == null) return;
+
+            if (controlMenu.control is RadioButton)
+            {
+                var Btn = (RadioButton)controlMenu.control;
+                if (uIElement != null)
+                    Btn.CommandTarget = uIElement;
+
+                Btn.CommandParameter = controlMenu;
+            }
+            else if (controlMenu.control is MenuItem)
+            {
+                var Btn = (MenuItem)controlMenu.control;
+
+                if(uIElement != null)
+                Btn.CommandTarget = uIElement;
+
+                Btn.CommandParameter = controlMenu;
+            }
+
+            controlMenu.SetParameter(CommandParameter);
+        }
+
+        /// <summary>
+        /// 菜单按钮是否可见
+        /// </summary>
+        public void SetVisual(string controlName, bool isVisible)
+        {
+            if (Controls == null) return;
+
+            foreach(var item in Controls)
+            {
+                if(item.control.Name == controlName)
+                {
+                    item.control.Visibility = (isVisible?Visibility.Visible:Visibility.Collapsed);
+                    break;
+                }
+            }
+        }
+
+        /// <summary>
+        /// 菜单按钮选中状态(若菜单为单选按钮)
+        /// </summary>
+        public void SetIsChecked(string controlName, bool isChecked)
+        {
+            if (Controls == null) return;
+
+            foreach (var item in Controls)
+            {
+                if (item.control.Name == controlName && (item.control as RadioButton) != null)
+                {
+                    var btn = item.control as RadioButton;
+                    btn.IsChecked = isChecked;
+                    break;
+                }
+            }
+
+        }
+
+    }
+
     #endregion
 
 }

+ 1 - 0
PDF Office/Helper/RichTextBoxHelper.cs

@@ -215,6 +215,7 @@ namespace PDF_Office.Helper
                 if (textappend.Equals(keyword, StringComparison.OrdinalIgnoreCase))
                 {
                     textRun.Background = new SolidColorBrush(textColor);
+                    textRun.FontWeight = FontWeight.FromOpenTypeWeight(600);
                 }
                 addBlock.Inlines.Add(textRun);
                 }

+ 34 - 23
PDF Office/Helper/SecurityHelper.cs

@@ -2,17 +2,28 @@
 using PDF_Office.Model;
 using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
 using Prism.Services.Dialogs;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Management;
+using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.SetPasswordDialogModel;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 
 namespace PDF_Office.Helper
 {
-    public  class SecurityHelper
+    public class SecurityHelper
     {
+        /// <summary>
+        /// 由全局变量储存是否修改过密码
+        /// </summary>
+        public static bool IsPasswordChanged = false;
+        /// <summary>
+        /// 全局变量储存修改后的密码
+        /// </summary>
+        public static class PasswordInfo
+        {
+            public static string OpenPassword = null;
+            public static string PermissionsPassword = null;
+            public static CPDFPermissionsInfo CPDFPermissionsInfo = CreateDefaultPermissionsInfo();
+        }
+
         public static bool CheckHaveAllPermissions(CPDFDocument document)
         {
             CPDFPermissionsInfo permissionsInfo = document.GetPermissionsInfo();
@@ -36,31 +47,31 @@ namespace PDF_Office.Helper
         {
             CPDFPermissionsInfo permissionsInfo = document.GetPermissionsInfo();
             ///如果需求这个权限
-           if(((enumPermissionsSet & EnumPermissionsSet.StatusAllowsDocumentChanges) == EnumPermissionsSet.StatusAllowsDocumentChanges ) && (!permissionsInfo.AllowsDocumentChanges))
+            if (((enumPermissionsSet & EnumPermissionsSet.StatusAllowsDocumentChanges) == EnumPermissionsSet.StatusAllowsDocumentChanges) && (!permissionsInfo.AllowsDocumentChanges))
             {
-                    return false;
+                return false;
             }
-           if(((enumPermissionsSet& EnumPermissionsSet.StatusAllowsPrinting) == EnumPermissionsSet.StatusAllowsPrinting) && (!permissionsInfo.AllowsPrinting))
+            if (((enumPermissionsSet & EnumPermissionsSet.StatusAllowsPrinting) == EnumPermissionsSet.StatusAllowsPrinting) && (!permissionsInfo.AllowsPrinting))
             {
                 return false;
             }
-           if(((enumPermissionsSet&EnumPermissionsSet.StatusAllowsHighQualityPrinting) == EnumPermissionsSet.StatusAllowsHighQualityPrinting) && (!permissionsInfo.AllowsHighQualityPrinting))
+            if (((enumPermissionsSet & EnumPermissionsSet.StatusAllowsHighQualityPrinting) == EnumPermissionsSet.StatusAllowsHighQualityPrinting) && (!permissionsInfo.AllowsHighQualityPrinting))
             {
                 return false;
             }
-            if (((enumPermissionsSet&EnumPermissionsSet.StatusAllowsCopying) == EnumPermissionsSet.StatusAllowsCopying)&& (!permissionsInfo.AllowsCopying))
+            if (((enumPermissionsSet & EnumPermissionsSet.StatusAllowsCopying) == EnumPermissionsSet.StatusAllowsCopying) && (!permissionsInfo.AllowsCopying))
             {
                 return false;
             }
-            if (((enumPermissionsSet&EnumPermissionsSet.StatusAllowsDocumentAssembly) == EnumPermissionsSet.StatusAllowsDocumentAssembly) && (!permissionsInfo.AllowsDocumentAssembly))
+            if (((enumPermissionsSet & EnumPermissionsSet.StatusAllowsDocumentAssembly) == EnumPermissionsSet.StatusAllowsDocumentAssembly) && (!permissionsInfo.AllowsDocumentAssembly))
             {
                 return false;
             }
-            if(((enumPermissionsSet&EnumPermissionsSet.StatusAllowsFormFieldEntry) == EnumPermissionsSet.StatusAllowsFormFieldEntry) && (!permissionsInfo.AllowsDocumentAssembly))
+            if (((enumPermissionsSet & EnumPermissionsSet.StatusAllowsFormFieldEntry) == EnumPermissionsSet.StatusAllowsFormFieldEntry) && (!permissionsInfo.AllowsDocumentAssembly))
             {
                 return false;
             }
-            if (((enumPermissionsSet&EnumPermissionsSet.StatusAllowsCommenting) == EnumPermissionsSet.StatusAllowsCommenting) && (!permissionsInfo.AllowsCommenting))
+            if (((enumPermissionsSet & EnumPermissionsSet.StatusAllowsCommenting) == EnumPermissionsSet.StatusAllowsCommenting) && (!permissionsInfo.AllowsCommenting))
             {
                 return false;
             }
@@ -94,10 +105,10 @@ namespace PDF_Office.Helper
         /// </returns>
         public static VerifyPasswordResult VerifyPasswordByPasswordKind(CPDFDocument document, EnumPasswordKind enumPasswordKind, IDialogService dialogService)
         {
-            VerifyPasswordResult verifyPasswordResult  = new VerifyPasswordResult();
-            if ((!document.IsLocked)&&
-                ((enumPasswordKind == EnumPasswordKind.StatusOpenPassword)||
-                (enumPasswordKind == EnumPasswordKind.StatusPermissionsPassword)&& CheckHaveAllPermissions(document)))
+            VerifyPasswordResult verifyPasswordResult = new VerifyPasswordResult();
+            if ((!document.IsLocked) &&
+                ((enumPasswordKind == EnumPasswordKind.StatusOpenPassword) ||
+                (enumPasswordKind == EnumPasswordKind.StatusPermissionsPassword) && CheckHaveAllPermissions(document)))
             {
                 verifyPasswordResult.IsDiscryptied = true;
                 verifyPasswordResult.Password = null;
@@ -107,7 +118,8 @@ namespace PDF_Office.Helper
             DialogParameters value = new DialogParameters();
             value.Add(ParameterNames.PasswordKind, enumPasswordKind);
             value.Add(ParameterNames.PDFDocument, document);
-            dialogService.ShowDialog(DialogNames.CheckPasswordDialog, value, e => {
+            dialogService.ShowDialog(DialogNames.CheckPasswordDialog, value, e =>
+            {
                 verifyPasswordResult.IsDiscryptied = e.Parameters.GetValue<bool>(ParameterNames.PasswordResult);
                 verifyPasswordResult.Password = e.Parameters.GetValue<string>(ParameterNames.Password);
             });
@@ -142,7 +154,7 @@ namespace PDF_Office.Helper
         public static VerifyPasswordResult VerifyPasswordForSelectedPermissions(CPDFDocument document, EnumPermissionsSet enumPermissionsSet, IDialogService dialogService)
         {
             VerifyPasswordResult verifyPasswordResult = new VerifyPasswordResult();
-            if ((!document.IsLocked) &&CheckHaveSelectedPermissions(document, enumPermissionsSet))
+            if ((!document.IsLocked) && CheckHaveSelectedPermissions(document, enumPermissionsSet))
             {
                 verifyPasswordResult.IsDiscryptied = true;
                 verifyPasswordResult.Password = null;
@@ -160,7 +172,8 @@ namespace PDF_Office.Helper
                 value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusPermissionsPassword);
             }
             value.Add(ParameterNames.PDFDocument, document);
-            dialogService.ShowDialog(DialogNames.CheckPasswordDialog, value, e => {
+            dialogService.ShowDialog(DialogNames.CheckPasswordDialog, value, e =>
+            {
                 verifyPasswordResult.IsDiscryptied = e.Parameters.GetValue<bool>(ParameterNames.PasswordResult);
                 verifyPasswordResult.Password = e.Parameters.GetValue<string>(ParameterNames.Password);
             });
@@ -168,8 +181,6 @@ namespace PDF_Office.Helper
         }
     }
 
-
-
     public class VerifyPasswordResult
     {
         public bool IsDiscryptied;

+ 11 - 4
PDF Office/Model/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogModel.cs

@@ -7,13 +7,12 @@ using System.Runtime.CompilerServices;
 using System.Text;
 using System.Threading.Tasks;
 
+
 namespace PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs
 {
     public class SetPasswordDialogModel
     {
-
-
-
+         
         public enum EnumNeedPassword
         {
             StatusNeedOpenPassword = 1 << 0,
@@ -55,10 +54,18 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs
             }
             return permissionsInfo;
         }
-
         ///<returns>
         ///生成带有指定权限的CPDFPermissionsInfo对象
         ///</returns>
+    }
 
+    public class SecurityInfo
+    {
+        public bool IsPasswordChanged = false;
+        public bool NeedOpenPassword = false;
+        public bool NeedPermissionsPassword = false;
+        public string OpenPassword = null;
+        public string PermissionsPassword = null;
+        public CPDFPermissionsInfo CPDFPermissionsInfo = SetPasswordDialogModel.CreateDefaultPermissionsInfo();
     }
 }

BIN
PDF Office/Resources/BOTA/empty_bookmark.png


+ 11 - 654
PDF Office/Styles/ContextMenuStyle.xaml

@@ -39,661 +39,18 @@
     </ContextMenu>
 
     <!--注释 - 高亮、下划线、删除线 -右键菜单-->
-    <ContextMenu x:Key="HightAnnotContextMenu" FontSize="14">
-        <ContextMenu.ItemContainerStyle>
-            <Style TargetType="MenuItem">
-                <Setter Property="Padding" Value="0,7,0,7" />
-                <Setter Property="VerticalContentAlignment" Value="Center" />
-            </Style>
-        </ContextMenu.ItemContainerStyle>
-        <MenuItem
-            Name="HightColorAnnotMenuItem"
-            Header="颜色列表"
-            IsEnabled="True">
-        </MenuItem>
-
-        <MenuItem
-            Name="CopyTextMenuItem"
-            Header="复制文本"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="DeleteHightAnnotMenuItem"
-            Header="删除"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="NoteHightAnnotMenuItem"
-            Header="添加笔记"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="DefaultHightAnnotMenuItem"
-            Header="设置当前属性为默认值"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-    </ContextMenu>
-
-    <!--注释 - 手绘 -右键菜单-->
-    <ContextMenu x:Key="FreeHandAnnotContextMenu" FontSize="14">
-        <ContextMenu.ItemContainerStyle>
-            <Style TargetType="MenuItem">
-                <Setter Property="Padding" Value="0,7,0,7" />
-                <Setter Property="VerticalContentAlignment" Value="Center" />
-            </Style>
-        </ContextMenu.ItemContainerStyle>
-        <MenuItem
-            Name="CopyFreeHandAnnotMenuItem"
-            Header="复制"
-            IsEnabled="True">
-        </MenuItem>
-
-        <MenuItem
-            Name="CutFreeHandAnnotMenuItem"
-            Header="剪切"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="PasteFreeHandAnnotMenuItem"
-            Header="粘贴"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-
-        <MenuItem
-            Name="DeleteFreeHandAnnotMenuItem"
-            Header="删除"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="ColorFreeHandAnnotMenuItem"
-            Header="颜色"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="LineStyleFreeHandAnnotMenuItem"
-            Header="线段样式"
-            IsEnabled="True">
-            <RadioButton x:Name="SolidLineStyleFreeHandAnnotMenuItem" GroupName="LineStyle" Content="实线">
-            </RadioButton>
-            <RadioButton x:Name="DashLineStyleFreeHandAnnotMenuItem" GroupName="LineStyle" Content="虚线">
-            </RadioButton>
-        </MenuItem>
-
-        <MenuItem
-            Name="NoteFreeHandAnnotMenuItem"
-            Header="添加笔记"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="DefaultFreeHandAnnotMenuItem"
-            Header="设置当前属性为默认值"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-    </ContextMenu>
-
-    <!--注释 - 文本 -右键菜单-->
-    <ContextMenu x:Key="FreeTextAnnotContextMenu" FontSize="14">
-        <ContextMenu.ItemContainerStyle>
-            <Style TargetType="MenuItem">
-                <Setter Property="Padding" Value="0,7,0,7" />
-                <Setter Property="VerticalContentAlignment" Value="Center" />
-            </Style>
-        </ContextMenu.ItemContainerStyle>
-        <MenuItem
-            Name="CopyFreeTextAnnotMenuItem"
-            Header="复制"
-            IsEnabled="True">
-        </MenuItem>
-
-        <MenuItem
-            Name="CutFreeTextAnnotMenuItem"
-            Header="剪切"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="PasteFreeTextAnnotMenuItem"
-            Header="粘贴"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-
-        <MenuItem
-            Name="DeleteFreeTextAnnotMenuItem"
-            Header="删除"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="ColorFreeTextAnnotMenuItem"
-            Header="文本颜色"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-        <MenuItem
-            Name="FontFamilyFreeTextAnnotMenuItem"
-            Header="字体"
-            IsEnabled="True">
-        </MenuItem>
-
-        <MenuItem
-            Name="AglinFreeTextAnnotMenuItem"
-            Header="线段样式"
-            IsEnabled="True">
-            <MenuItem
-            Name="LeftAglinFreeTextAnnotMenuItem"
-            Header="左对齐"
-            IsEnabled="True">
-            </MenuItem>
-            <MenuItem
-            Name="CenterAglinFreeTextAnnotMenuItem"
-            Header="居中对齐"
-            IsEnabled="True">
-            </MenuItem>
-            <MenuItem
-            Name="RightAglinFreeTextAnnotMenuItem"
-            Header="右对齐"
-            IsEnabled="True">
-            </MenuItem>
-        </MenuItem>
-
-        <MenuItem
-            Name="DefaultFreeTextAnnotMenuItem"
-            Header="设置当前属性为默认值"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-    </ContextMenu>
-
-    <!--注释 - 便签 -右键菜单-->
-    <ContextMenu x:Key="StrickNoteAnnotContextMenu" FontSize="14">
-        <ContextMenu.ItemContainerStyle>
-            <Style TargetType="MenuItem">
-                <Setter Property="Padding" Value="0,7,0,7" />
-                <Setter Property="VerticalContentAlignment" Value="Center" />
-            </Style>
-        </ContextMenu.ItemContainerStyle>
-        <MenuItem
-            Name="CopyStrickNoteAnnotMenuItem"
-            Header="复制"
-            IsEnabled="True">
-        </MenuItem>
-
-        <MenuItem
-            Name="CutStrickNoteAnnotMenuItem"
-            Header="剪切"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="PasteStrickNoteAnnotMenuItem"
-            Header="粘贴"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-
-        <MenuItem
-            Name="DeleteStrickNoteAnnotMenuItem"
-            Header="删除"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
+    <Style x:Key="UIElementMenuItem" TargetType="MenuItem">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="MenuItem">
+                    <Grid Height="24" Background="#FBFBFD" Width="{TemplateBinding Width}">
+                        <ContentPresenter Content="{TemplateBinding Header}"/>
+                    </Grid>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
 
-        <MenuItem
-            Name="ColorStrickNoteAnnotMenuItem"
-            Header="颜色"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-        
-        <MenuItem
-            Name="EditStrickNoteAnnotMenuItem"
-            Header="编辑便签"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="DefaultStrickNoteAnnotMenuItem"
-            Header="设置当前属性为默认值"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-    </ContextMenu>
-
-    <!--注释 - 形状 -右键菜单-->
-    <ContextMenu x:Key="ShapeAnnotContextMenu" FontSize="14">
-        <ContextMenu.ItemContainerStyle>
-            <Style TargetType="MenuItem">
-                <Setter Property="Padding" Value="0,7,0,7" />
-                <Setter Property="VerticalContentAlignment" Value="Center" />
-            </Style>
-        </ContextMenu.ItemContainerStyle>
-        <MenuItem
-            Name="CopyShapeAnnotMenuItem"
-            Header="复制"
-            IsEnabled="True">
-        </MenuItem>
-
-        <MenuItem
-            Name="CutShapeAnnotMenuItem"
-            Header="剪切"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="PasteShapeAnnotMenuItem"
-            Header="粘贴"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-
-        <MenuItem
-            Name="DeleteShapeAnnotMenuItem"
-            Header="删除"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="ColorShapeAnnotMenuItem"
-            Header="颜色"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="LineStyleShapeAnnotMenuItem"
-            Header="线段样式"
-            IsEnabled="True">
-            <MenuItem
-            Name="SolidLineStyleShapeAnnotMenuItem"
-            Header="实线"
-            IsEnabled="True">
-            </MenuItem>
-            <MenuItem
-            Name="DashLineStyleShapeAnnotMenuItem"
-            Header="虚线"
-            IsEnabled="True">
-            </MenuItem>
-        </MenuItem>
-
-        <MenuItem
-            Name="LineDirectShapeAnnotMenuItem"
-            Header="线段方向"
-            IsEnabled="True">
-            <MenuItem
-            Name="VeriLineDirectShapeAnnotMenuItem"
-            Header="垂直"
-            IsEnabled="True">
-            </MenuItem>
-            <MenuItem
-            Name="HoriLineDirectShapeAnnotMenuItem"
-            Header="水平"
-            IsEnabled="True">
-            </MenuItem>
-        </MenuItem>
-
-        <MenuItem
-            Name="NoteShapeAnnotMenuItem"
-            Header="添加笔记"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="DefaultShapeAnnotMenuItem"
-            Header="设置当前属性为默认值"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-    </ContextMenu>
-
-    <!--注释 - 链接 -右键菜单-->
-    <ContextMenu x:Key="LinkAnnotContextMenu" FontSize="14">
-        <ContextMenu.ItemContainerStyle>
-            <Style TargetType="MenuItem">
-                <Setter Property="Padding" Value="0,7,0,7" />
-                <Setter Property="VerticalContentAlignment" Value="Center" />
-            </Style>
-        </ContextMenu.ItemContainerStyle>
-        <MenuItem
-            Name="CopyLinkAnnotMenuItem"
-            Header="复制"
-            IsEnabled="True">
-        </MenuItem>
-
-        <MenuItem
-            Name="CutLinkAnnotMenuItem"
-            Header="剪切"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="PasteLinkAnnotMenuItem"
-            Header="粘贴"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="DeleteLinkAnnotMenuItem"
-            Header="删除"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-    </ContextMenu>
-
-    <!--注释 - 图章 -右键菜单-->
-    <ContextMenu x:Key="StampAnnotContextMenu" FontSize="14">
-        <ContextMenu.ItemContainerStyle>
-            <Style TargetType="MenuItem">
-                <Setter Property="Padding" Value="0,7,0,7" />
-                <Setter Property="VerticalContentAlignment" Value="Center" />
-            </Style>
-        </ContextMenu.ItemContainerStyle>
-        <MenuItem
-            Name="CopyStampAnnotMenuItem"
-            Header="复制"
-            IsEnabled="True">
-        </MenuItem>
-
-        <MenuItem
-            Name="CutStampAnnotMenuItem"
-            Header="剪切"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="PasteStampAnnotMenuItem"
-            Header="粘贴"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="DeleteStampAnnotMenuItem"
-            Header="删除"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-
-        <MenuItem
-            Name="ExportStampAnnotMenuItem"
-            Header="导出"
-            IsEnabled="True">
-            <MenuItem
-            Name="ExportPNGStampAnnotMenuItem"
-            Header="PNG"
-            IsEnabled="True">
-            </MenuItem>
-            <MenuItem
-            Name="ExportJPGStampAnnotMenuItem"
-            Header="JPG"
-            IsEnabled="True">
-            </MenuItem>
-            <MenuItem
-            Name="ExportPDFStampAnnotMenuItem"
-            Header="PDF"
-            IsEnabled="True">
-            </MenuItem>
-        </MenuItem>
-
-    </ContextMenu>
-
-    <!--注释 - 多选注释 -右键菜单-->
-    <ContextMenu x:Key="MultiSelectAnnotContextMenu" FontSize="14">
-        <ContextMenu.ItemContainerStyle>
-            <Style TargetType="MenuItem">
-                <Setter Property="Padding" Value="0,7,0,7" />
-                <Setter Property="VerticalContentAlignment" Value="Center" />
-            </Style>
-        </ContextMenu.ItemContainerStyle>
-        <MenuItem
-            Name="CopyMultiSelectAnnotMenuItem"
-            Header="复制"
-            IsEnabled="True">
-        </MenuItem>
-
-        <MenuItem
-            Name="CutMultiSelectAnnotMenuItem"
-            Header="剪切"
-            IsEnabled="True">
-            <MenuItem.Icon>
-                <Path Data="M5.24031 1.5H0.5V14.5H15.5V4H7.24031L5.24031 1.5ZM1.5 13.5V2.5H4.75969L6.75969 5H14.5V13.5H1.5ZM4 7.5H12V6.5H4V7.5Z" Fill="Black">
-                    <Path.RenderTransform>
-                        <TranslateTransform X="3.0000" Y="0" />
-                    </Path.RenderTransform>
-                </Path>
-            </MenuItem.Icon>
-        </MenuItem>
-    </ContextMenu>
 
     <!--  注释-内容选择-右键菜单  -->
     <ContextMenu x:Key="SnapshotContextMenu" FontSize="14">

+ 13 - 50
PDF Office/Styles/ExpanderStyle.xaml

@@ -138,10 +138,10 @@
 
     <SolidColorBrush x:Key="Expander.MouseOver.Circle.Stroke" Color="#FF5593FF" />
     <SolidColorBrush x:Key="Expander.MouseOver.Circle.Fill" Color="#FFF3F9FF" />
-    <SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#FF000000" />
+    <SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#616469" />
     <SolidColorBrush x:Key="Expander.Pressed.Circle.Stroke" Color="#FF3C77DD" />
     <SolidColorBrush x:Key="Expander.Pressed.Circle.Fill" Color="#FFD9ECFF" />
-    <SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#FF000000" />
+    <SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#616469" />
     <SolidColorBrush x:Key="Expander.Disabled.Circle.Stroke" Color="#FFBCBCBC" />
     <SolidColorBrush x:Key="Expander.Disabled.Circle.Fill" Color="#FFE6E6E6" />
     <SolidColorBrush x:Key="Expander.Disabled.Arrow.Stroke" Color="#FF707070" />
@@ -153,11 +153,11 @@
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type ToggleButton}">
                     <Border Padding="{TemplateBinding Padding}">
-                        <Grid Background="Transparent" SnapsToDevicePixels="False">
+                        <Grid Background="{StaticResource color.sys.layout.fg.light}" SnapsToDevicePixels="False">
                             <Grid.ColumnDefinitions>
 
                                 <ColumnDefinition Width="*" />
-                                <ColumnDefinition Width="19" />
+                                <ColumnDefinition Width="35" />
                             </Grid.ColumnDefinitions>
                             <Ellipse
                                 x:Name="circle"
@@ -169,29 +169,11 @@
                                 Stroke="{StaticResource Expander.Static.Circle.Stroke}"
                                 Visibility="Collapsed" />
                             <Rectangle Grid.Column="0" />
-                            <!--<Polygon
-                            x:Name="Collapsed"
-                            Grid.Column="1"
-                            Margin="0,0,12,0"
-                            HorizontalAlignment="Center"
-                            VerticalAlignment="Center"
-                            Fill="Black"
-                            Points="11 2 5 8 11 14"
-                            SnapsToDevicePixels="false"
-                            Stroke="{StaticResource Expander.Static.Arrow.Stroke}"
-                            StrokeThickness="2">
-                            <Polygon.RenderTransform>
-                            <TransformGroup>
-                            <TranslateTransform X="8" Y="8" />
-                            <ScaleTransform ScaleX="-1" ScaleY="1" />
-                            <TranslateTransform X="25" Y="-8" />
-                            </TransformGroup>
-                            </Polygon.RenderTransform>
-                            </Polygon>-->
+
                             <Path
                                 Name="arrowdown"
                                 Grid.Column="1"
-                                Margin="0,0,5,0"
+                                Margin="0,0,15,0"
                                 HorizontalAlignment="Right"
                                 VerticalAlignment="Center"
                                 Data="M6 7.56427L2.03039 3.59467L0.969727 4.65533L5.46967 9.15526C5.76256 9.44816 6.23743 9.44816 6.53033 9.15526L11.0303 4.65533L9.9696 3.59467L6 7.56427Z"
@@ -199,34 +181,15 @@
                             <Path
                                 Name="Collapsed"
                                 Grid.Column="1"
-                                Margin="0,0,5,0"
+                                Margin="0,0,15,0"
                                 HorizontalAlignment="Right"
                                 VerticalAlignment="Center"
                                 Data="M7.56438 5.99999L3.59473 9.96964L4.65539 11.0303L9.15537 6.53032C9.44826 6.23743 9.44826 5.76255 9.15537 5.46966L4.65539 0.969675L3.59473 2.03033L7.56438 5.99999Z"
                                 Fill="Black" />
-                            <!--<Polygon
-                            x:Name="arrowdown"
-                            Grid.Column="1"
-                            Margin="0,0,12,0"
-                            HorizontalAlignment="Center"
-                            VerticalAlignment="Center"
-                            Fill="Black"
-                            Points="11 2 5 8 11 14"
-                            SnapsToDevicePixels="false"
-                            Stroke="{StaticResource Expander.Static.Arrow.Stroke}"
-                            StrokeThickness="2"
-                            Visibility="Collapsed">
-                            <Polygon.RenderTransform>
-                            <TransformGroup>
-                            <TranslateTransform X="8" Y="8" />
-                            <RotateTransform Angle="-90" />
-                            <TranslateTransform X="-5" Y="22" />
-                            </TransformGroup>
-                            </Polygon.RenderTransform>
-                            </Polygon>-->
+
                             <ContentPresenter
                                 Grid.Column="0"
-                                Margin="0,0,0,0"
+                                Margin="2,0,0,0"
                                 HorizontalAlignment="Stretch"
                                 VerticalAlignment="Center"
                                 RecognizesAccessKey="True"
@@ -268,8 +231,8 @@
     </Style>
 
     <Style x:Key="GropExpanderHeader" TargetType="{x:Type Expander}">
-        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
-        <Setter Property="Background" Value="#FFFFFF" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
+        <Setter Property="Background" Value="{StaticResource color.sys.layout.mg}" />
         <Setter Property="HorizontalContentAlignment" Value="Stretch" />
         <Setter Property="VerticalContentAlignment" Value="Stretch" />
         <Setter Property="BorderBrush" Value="Transparent" />
@@ -278,7 +241,7 @@
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type Expander}">
                     <Border
-                        Margin="0,8"
+                        Margin="0,2"
                         Background="{TemplateBinding Background}"
                         BorderBrush="{TemplateBinding BorderBrush}"
                         BorderThickness="{TemplateBinding BorderThickness}"
@@ -321,7 +284,7 @@
                             <Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" />
                         </Trigger>
                         <Trigger Property="IsExpanded" Value="false">
-                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
+                            <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
                         </Trigger>
                     </ControlTemplate.Triggers>
                 </ControlTemplate>

+ 29 - 23
PDF Office/Styles/ListViewStyle.xaml

@@ -335,13 +335,16 @@
 
     <Style x:Key="ListViewItemGraySelectStyle" TargetType="{x:Type ListViewItem}">
         <Setter Property="UIElement.SnapsToDevicePixels" Value="True" />
-        <Setter Property="Panel.Background" Value="#F2F2F2" />
-        <Setter Property="Border.BorderBrush" Value="#F2F2F2" />
+        <Setter Property="Panel.Background" Value="{StaticResource color.sys.layout.mg}" />
+        <Setter Property="Border.BorderBrush" Value="{StaticResource color.sys.layout.mg}" />
+        <Setter Property="Margin" Value="8,0" />
         <Setter Property="Control.Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type ListViewItem}">
                     <Border
                         Name="Bd"
+                        CornerRadius="4"
+                        BorderThickness="1"
                         Background="{TemplateBinding Panel.Background}"
                         BorderBrush="{TemplateBinding Border.BorderBrush}"
                         SnapsToDevicePixels="True">
@@ -359,23 +362,23 @@
                             <MultiTrigger.Conditions>
                                 <Condition Property="UIElement.IsMouseOver" Value="True" />
                             </MultiTrigger.Conditions>
-                            <Setter Property="Panel.Background" Value="#d9d9d9" />
-                            <Setter Property="Border.BorderBrush" Value="#d9d9d9" />
-                        </MultiTrigger>
-                        <MultiTrigger>
-                            <MultiTrigger.Conditions>
-                                <Condition Property="UIElement.IsMouseOver" Value="False" />
-                            </MultiTrigger.Conditions>
-                            <Setter Property="Panel.Background" Value="#F2F2F2" />
-                            <Setter Property="Border.BorderBrush" Value="#F2F2F2" />
+                            <Setter Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
+                            <Setter Property="Border.BorderBrush" Value="{StaticResource color.item-state.hov.bg}" />
                         </MultiTrigger>
+                        <!--<MultiTrigger>
+                        <MultiTrigger.Conditions>
+                        <Condition Property="UIElement.IsMouseOver" Value="False" />
+                        </MultiTrigger.Conditions>
+                        <Setter Property="Panel.Background" Value="#F2F2F2" />
+                        <Setter Property="Border.BorderBrush" Value="#F2F2F2" />
+                        </MultiTrigger>-->
                         <MultiTrigger>
                             <MultiTrigger.Conditions>
                                 <Condition Property="Selector.IsSelectionActive" Value="False" />
                                 <Condition Property="Selector.IsSelected" Value="True" />
                             </MultiTrigger.Conditions>
-                            <Setter Property="Panel.Background" Value="#97D7FB" />
-                            <Setter Property="Border.BorderBrush" Value="#97D7FB" />
+                            <Setter Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
+                            <Setter Property="Border.BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
                         </MultiTrigger>
 
                         <MultiTrigger>
@@ -383,8 +386,8 @@
                                 <Condition Property="Selector.IsSelectionActive" Value="True" />
                                 <Condition Property="Selector.IsSelected" Value="True" />
                             </MultiTrigger.Conditions>
-                            <Setter Property="Panel.Background" Value="#97D7FB" />
-                            <Setter Property="Border.BorderBrush" Value="#97D7FB" />
+                            <Setter Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
+                            <Setter Property="Border.BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
                         </MultiTrigger>
                         <!--<Trigger Property="UIElement.IsEnabled" Value="False">
                         <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
@@ -398,9 +401,9 @@
     <ControlTemplate x:Key="AnnotationListItemStyle" TargetType="{x:Type ListBoxItem}">
         <Border
             x:Name="Bd"
-            Margin="5,0,5,10"
-            Padding="5"
-            Background="#f5f5f5"
+            Padding="8"
+            Margin="5"
+            Background="{StaticResource color.sys.layout.mg}"
             BorderBrush="{TemplateBinding BorderBrush}"
             BorderThickness="{TemplateBinding BorderThickness}"
             CornerRadius="4"
@@ -418,24 +421,27 @@
                 <MultiTrigger.Conditions>
                     <Condition Property="IsMouseOver" Value="True" />
                 </MultiTrigger.Conditions>
-                <Setter TargetName="Bd" Property="Background" Value="#EDEEF0" />
+                <Setter TargetName="Bd" Property="Background" Value="{ StaticResource color.item-state.hov.bg}" />
                 <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
+                <!--<Setter Property="Margin" Value="5,0,5,10" />-->
             </MultiTrigger>
             <MultiTrigger>
                 <MultiTrigger.Conditions>
                     <Condition Property="Selector.IsSelectionActive" Value="False" />
                     <Condition Property="IsSelected" Value="True" />
                 </MultiTrigger.Conditions>
-                <Setter TargetName="Bd" Property="Background" Value="#d7d8db" />
-                <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
+                <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
+                <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
+                <!--<Setter Property="Margin" Value="5,0,5,10" />-->
             </MultiTrigger>
             <MultiTrigger>
                 <MultiTrigger.Conditions>
                     <Condition Property="Selector.IsSelectionActive" Value="True" />
                     <Condition Property="IsSelected" Value="True" />
                 </MultiTrigger.Conditions>
-                <Setter TargetName="Bd" Property="Background" Value="#d7d8db" />
-                <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
+                <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
+                <Setter TargetName="Bd" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
+                <!--<Setter Property="Margin" Value="5,0,5,10" />-->
             </MultiTrigger>
             <Trigger Property="IsEnabled" Value="False">
                 <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />

+ 26 - 1
PDF Office/Styles/PathButtonStyle.xaml

@@ -119,7 +119,32 @@
                             <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
                             <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Visible" />
                         </Trigger>
-
+                        <MultiTrigger>
+                            <MultiTrigger.Conditions>
+                                <Condition Property="IsMouseOver" Value="True" />
+                                <Condition Property="IsChecked" Value="True" />
+                            </MultiTrigger.Conditions>
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Visible" />
+                        </MultiTrigger>
+                        <MultiTrigger>
+                            <MultiTrigger.Conditions>
+                                <Condition Property="IsPressed" Value="True" />
+                                <Condition Property="IsChecked" Value="True" />
+                            </MultiTrigger.Conditions>
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathButton}}}" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Visible" />
+                        </MultiTrigger>
                         <Trigger SourceName="PART_Content" Property="Text" Value="">
                             <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
                         </Trigger>

+ 51 - 0
PDF Office/Styles/RadioButtonStyle.xaml

@@ -216,6 +216,7 @@
                                 Height="{TemplateBinding Height}"
                                 Opacity="0" />
                         </Border>
+                        <!--<ContentControl x:Name="content" Visibility="Collapsed" Foreground="{TemplateBinding Foreground}" />-->
                         <ContentPresenter
                             x:Name="contentPresenter"
                             Margin="{TemplateBinding Padding}"
@@ -248,9 +249,11 @@
                         <Trigger Property="IsChecked" Value="true">
                             <Setter TargetName="optionMark" Property="Opacity" Value="1" />
                             <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                            <!--<Setter TargetName="content" Property="Foreground" Value="Red" />-->
                         </Trigger>
                         <Trigger Property="IsChecked" Value="{x:Null}">
                             <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
+                            <!--<Setter TargetName="content" Property="Foreground" Value="Red" />-->
                         </Trigger>
                     </ControlTemplate.Triggers>
                 </ControlTemplate>
@@ -469,7 +472,55 @@
             </Setter.Value>
         </Setter>
     </Style>
+    <Style x:Key="GreyBgRadioBtnStyle2" TargetType="{x:Type RadioButton}">
+        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="Foreground" Value="#616469" />
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type RadioButton}">
+                    <Border
+                        x:Name="templateRoot"
+                        Background="{TemplateBinding Background}"
+                        CornerRadius="4"
+                        SnapsToDevicePixels="True">
 
+                        <ContentPresenter
+                            x:Name="contentPresenter"
+                            Grid.Column="1"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="HasContent" Value="true">
+                            <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+                            <!--<Setter Property="Padding" Value="6,6,0,0" />-->
+                            <Setter Property="HorizontalContentAlignment" Value="Center" />
+                            <Setter Property="VerticalContentAlignment" Value="Center" />
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true" />
+                        <Trigger Property="IsChecked" Value="true">
+                            <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
+                            <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}" />
+                            <Setter Property="Foreground" Value="#252629" />
+                            <Setter TargetName="templateRoot" Property="BorderThickness" Value="1" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
     <Style x:Key="BatchButton" TargetType="{x:Type RadioButton}">
         <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
         <Setter Property="Background" Value="#F7F8FA" />

+ 78 - 0
PDF Office/Styles/TextBoxStyle.xaml

@@ -22,4 +22,82 @@
         <Setter Property="FontWeight" Value="SemiBold" />
         <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv2}" />
     </Style>
+
+    <SolidColorBrush x:Key="TextBox.Static.Border" Color="#FFABAdB3" />
+    <SolidColorBrush x:Key="TextBox.MouseOver.Border" Color="#FF7EB4EA" />
+    <SolidColorBrush x:Key="TextBox.Focus.Border" Color="#FF569DE5" />
+    <Style x:Key="TextBoxStyleRadius" TargetType="{x:Type TextBox}">
+        <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
+        <Setter Property="BorderBrush" Value="{StaticResource TextBox.Static.Border}" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="1" />
+        <Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
+        <Setter Property="HorizontalContentAlignment" Value="Left" />
+        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+        <Setter Property="AllowDrop" Value="true" />
+        <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
+        <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type TextBox}">
+                    <Border
+                                x:Name="border"
+                                Background="{TemplateBinding Background}"
+                                BorderBrush="{TemplateBinding BorderBrush}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                CornerRadius="4"
+                                SnapsToDevicePixels="True">
+                        <ScrollViewer
+                                    x:Name="PART_ContentHost"
+                                    Focusable="false"
+                                    HorizontalScrollBarVisibility="Hidden"
+                                    VerticalScrollBarVisibility="Hidden" />
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="border" Property="Opacity" Value="0.56" />
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource TextBox.MouseOver.Border}" />
+                        </Trigger>
+                        <Trigger Property="IsKeyboardFocused" Value="true">
+                            <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource TextBox.Focus.Border}" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Style.Triggers>
+            <MultiTrigger>
+                <MultiTrigger.Conditions>
+                    <Condition Property="IsInactiveSelectionHighlightEnabled" Value="true" />
+                    <Condition Property="IsSelectionActive" Value="false" />
+                </MultiTrigger.Conditions>
+                <Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}" />
+            </MultiTrigger>
+        </Style.Triggers>
+    </Style>
+    
+    <Style x:Key="Print_normalTxtStyle" TargetType="TextBox">
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Width}">
+                        <Border BorderBrush="{StaticResource color.field.border.norm}" Background="{StaticResource color.field.bg.def}" BorderThickness="1" CornerRadius="4">
+                            <ScrollViewer x:Name="PART_ContentHost" Focusable="false"
+                                                  HorizontalScrollBarVisibility="Hidden" 
+                                                  VerticalScrollBarVisibility="Hidden"
+                                                  VerticalAlignment="Center" MinHeight="22" Margin="8,0,0,0" Opacity="1"/>
+                        </Border>
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter Property="Opacity" Value="0.6"></Setter>
+                         </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
 </ResourceDictionary>

+ 49 - 0
PDF Office/Styles/ToggleButton.xaml

@@ -1,5 +1,54 @@
 <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
     <!--  Design Token for subtool  -->
+    <Style x:Key="LinkToolbarTgb" TargetType="{x:Type ToggleButton}">
+        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border
+                        x:Name="border"
+                        Background="{TemplateBinding Panel.Background}"
+                        BorderBrush="{StaticResource color.field.border.norm}"
+                        BorderThickness="1"
+                        CornerRadius="{StaticResource border-radius.4}"
+                        SnapsToDevicePixels="True">
+                        <ContentPresenter
+                            x:Name="contentPresenter"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Content="{TemplateBinding Content}"
+                            ContentStringFormat="{TemplateBinding ContentStringFormat}"
+                            ContentTemplate="{TemplateBinding ContentTemplate}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                    </Border>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
+                            <!--<Setter TargetName="border" Property="Panel.Background" Value="{StaticResource color.field.border.focus}" />-->
+                        </Trigger>
+
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="False">
+                            <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter TargetName="border" Property="Panel.Background" Value="Transparent" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
     <Style x:Key="SubToolbarTgb" TargetType="{x:Type ToggleButton}">
         <Setter Property="FocusVisualStyle" Value="{x:Null}" />
         <Setter Property="Background" Value="Transparent" />

+ 1 - 1
PDF Office/Themes/Generic.xaml

@@ -66,8 +66,8 @@
                                 x:Name="placeholder"
                                 Margin="{Binding ElementName=PART_ContentHost, Path=Margin}"
                                 Padding="{TemplateBinding Padding}"
-                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                 FontSize="{TemplateBinding FontSize}"
                                 Foreground="{TemplateBinding PlaceholderForeground}"
                                 Text="{TemplateBinding PlaceholderText}"

+ 6 - 0
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -1104,6 +1104,12 @@ namespace PDF_Office.ViewModels.BOTA
                 WriteableBitmap bitmap = GetAnnotImage(PdfViewer.Document, item.PageIndex, item.AnnotIndex);
                 args.WriteableBitmap = bitmap;
             }
+            //if (item.EventType == AnnotArgsType.AnnotLink)
+            //{
+            //    if (string.IsNullOrEmpty(item.MarkupContent))
+            //    {
+            //    }
+            //}
             args.AnnotHandlerEventArgs = item;
             args.PageIndex = item.PageIndex;
             args.AnnotIndex = item.AnnotIndex;

+ 19 - 39
PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs

@@ -34,6 +34,9 @@ using System.Threading.Tasks;
 using static Dropbox.Api.TeamLog.TimeUnit;
 using System.Threading;
 using static Dropbox.Api.Files.SaveUrlError;
+using System.Windows.Documents;
+using System.Runtime.Remoting.Messaging;
+using ListView = System.Windows.Controls.ListView;
 
 namespace PDF_Office.ViewModels.BOTA
 {
@@ -80,6 +83,8 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
+        public CPDFBookmark addCPDFBookmark = null;
+
         #endregion 属性
 
         #region 命令
@@ -209,6 +214,7 @@ namespace PDF_Office.ViewModels.BOTA
                 {
                     Bookmarklist.Remove(bookmark);
                     isAddBookMark = true;
+                    PDFViewer.UndoManager.CanSave = true;
                 }
             }
         }
@@ -250,6 +256,9 @@ namespace PDF_Office.ViewModels.BOTA
                 listViewItem = (ListViewItem)(obj);
                 textBox = CommonHelper.FindVisualChild<TextBox>(listViewItem);
             }
+
+            CPDFBookmark bookmark = (CPDFBookmark)listViewItem.DataContext;
+
             UpdateTitle(listViewItem, textBox);
         }
 
@@ -305,13 +314,14 @@ namespace PDF_Office.ViewModels.BOTA
             string mark = string.Format($"第{index + 1}页");
 
             System.Windows.Controls.ListView listView = obj as System.Windows.Controls.ListView;
+            listView.SelectedItems.Clear();
             bool isExistBookmark = IsExistBookmark(listView);// await Task.Run(() => IsExistBookmark(listView));
             if (isExistBookmark == false)
             {
                 DialogParameters value = new DialogParameters();
                 value.Add(ParameterNames.Bookmark, mark);
                 value.Add(ParameterNames.Title, "创建一个新的书签");
-                dialogs.ShowDialog(DialogNames.AddBookmarkDialog, value, async e =>
+                dialogs.ShowDialog(DialogNames.AddBookmarkDialog, value, e =>
                 {
                     if (e.Result == ButtonResult.OK && e.Parameters != null)
                     {
@@ -322,7 +332,7 @@ namespace PDF_Office.ViewModels.BOTA
                             bookmark.Title = mark;
                             bookmark.Date = DateTime.Now.ToString(@"yyyyMMddHHmmsszzz\'").Replace(':', '\'') + "\n";
                             bookmark.PageIndex = PDFViewer.CurrentIndex;
-
+                            addCPDFBookmark = bookmark;
                             if (PDFViewer.Document.AddBookmark(bookmark))
                             {
                                 PDFViewer.UndoManager.CanSave = true;
@@ -330,7 +340,7 @@ namespace PDF_Office.ViewModels.BOTA
                                 Bookmarklist.Add(bookmark);
 
                                 Bookmarklist = new ObservableCollection<CPDFBookmark>(Bookmarklist.OrderBy(item => item.PageIndex));
-                                SetListViewItemState(listView, bookmark);
+                                Bookmarklist.CollectionChanged += Bookmarklist_CollectionChanged;
                             }
                         }
                         isAddBookMark = false;
@@ -343,41 +353,15 @@ namespace PDF_Office.ViewModels.BOTA
             }
         }
 
-        private void SetListViewItemState(System.Windows.Controls.ListView listView, CPDFBookmark bookmark)
-        {
-            if (listView.SelectedItem != bookmark)
-            {
-                listView.SelectedItem = bookmark;
-                listView.ScrollIntoView(bookmark);
-                ListViewItem myListBoxItem = (ListViewItem)(listView.ItemContainerGenerator.ContainerFromItem(bookmark));
-                TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
-                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
-                textBlock.Visibility = Visibility.Collapsed;
-
-                textBox.Focus();
-                textBox.SelectAll();
-                //if (myListBoxItem == null)
-                //{
-                //    await Task.Delay(3);
-                //    while (listView.RenderSize.Width <= 0 && listView.RenderSize.Height <= 0)
-                //    {
-                //        await Task.Delay(3);
-                //    }
-                //    myListBoxItem = (ListViewItem)(listView.ItemContainerGenerator.ContainerFromItem(bookmark));
-                //    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
-                //    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
-                //    textBlock.Visibility = Visibility.Collapsed;
-
-                //    textBox.Focus();
-                //    textBox.SelectAll();
-                //}
-            }
-        }
-
         private bool IsExistBookmark(System.Windows.Controls.ListView listView)
         {
             bool isExistBookmark = false;
             int index = PDFViewer.CurrentIndex;
+            if (PDFViewer.Document == null)
+            {
+                isExistBookmark = true;
+                return isExistBookmark;
+            }
             //检测是否已存在相同数据
             var list = PDFViewer.Document.GetBookmarkList().FindAll(q => q.PageIndex == index);
 
@@ -418,10 +402,6 @@ namespace PDF_Office.ViewModels.BOTA
             return isExistBookmark;
         }
 
-        private ListViewItem selectListViewItem = null;
-
-
-
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
@@ -431,7 +411,7 @@ namespace PDF_Office.ViewModels.BOTA
                 return;
             }
 
-            Bookmarklist = new ObservableCollection<CPDFBookmark>(PDFViewer.Document.GetBookmarkList().OrderBy(d => d.Title));
+            Bookmarklist = new ObservableCollection<CPDFBookmark>(PDFViewer.Document.GetBookmarkList().OrderBy(d => d.PageIndex));
             Bookmarklist.CollectionChanged += Bookmarklist_CollectionChanged;
             if (Bookmarklist.Count < 1)
             {

+ 2 - 2
PDF Office/ViewModels/BOTA/SearchContentViewModel.cs

@@ -86,7 +86,7 @@ namespace PDF_Office.ViewModels.BOTA
         List<string> HistorySearchText = new List<string>();
         const int MaxHistoryCount = 10;
 
-        private bool caseInsensitive;
+        private bool caseInsensitive = true;
 
         public bool CaseInsensitive
         {
@@ -107,7 +107,7 @@ namespace PDF_Office.ViewModels.BOTA
         {
             textSearch = new PDFTextSearch();
             SearchItemList = new ObservableCollection<SearchItem>();
-            MyProperty = new ObservableCollection<string>() { "1", "2"};
+            MyProperty = new ObservableCollection<string>() { "1", "2" };
             SearchChangedCommand = new DelegateCommand<object>(SearchChanged);
             CleanCommand = new DelegateCommand(clean);
 

+ 4 - 4
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs

@@ -79,7 +79,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             }
         }
 
-        private string removeIsEnable = "False";
+        private string removeIsEnable = "True";
         public string RemoveIsEnable
         {
             get { return removeIsEnable; }
@@ -345,7 +345,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 fileNames.AddRange(dlg.FileNames.ToList());
                 RemoveExcess(ref fileNames);
                 SetPictureToPDFGridIsEnabled = "True";
-                AddFileVisibility = Visibility.Collapsed;
+                AddFileVisibility = Visibility.Hidden;
                 RemoveIsEnable = "True";
                 updateListview("wait");
             }
@@ -356,7 +356,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             fileNames.Add(filename);
             RemoveExcess(ref fileNames);
             SetPictureToPDFGridIsEnabled = "True";
-            AddFileVisibility = Visibility.Collapsed;
+            AddFileVisibility = Visibility.Hidden;
             RemoveIsEnable = "True";
             updateListview("wait");
         }
@@ -384,7 +384,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 RemoveExcess(ref fileNames);
                 updateListview("wait");
                 SetPictureToPDFGridIsEnabled = "True";
-                AddFileVisibility = Visibility.Collapsed;
+                AddFileVisibility = Visibility.Hidden;
                 RemoveIsEnable = "True";
             }
         }

+ 3 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs

@@ -397,9 +397,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
             {
                 PrintSettingsInfo.PrintDocument.PrinterSettings.PrinterName = PrinterName;
                 pageSetupDialog.Document = PrintSettingsInfo.PrintDocument;
+                pageSetupDialog.Document.DefaultPageSettings.Margins = new Margins((int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Left * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Right * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Top * 2.54), (int)(PrintSettingsInfo.PrintDocument.DefaultPageSettings.Margins.Bottom * 2.54));
+
                 if (pageSetupDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                 {
                     PrintSettingsInfo.PrintDocument.DefaultPageSettings = pageSetupDialog.PageSettings;
+
                     if (!PrintSettingsInfo.PrintDocument.DefaultPageSettings.Landscape)
                     {
                         PrintOrientationIndex = 0;

+ 1 - 1
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDocumentContentViewModel.cs

@@ -109,7 +109,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
         public DocumentSettingsInfo documentSettingsInfo = new DocumentSettingsInfo();
 
         /// <summary>
-        /// 用于判断是否需要跳转第一页
+        /// 记录打印设置改变前的总页数,用于判断是否需要跳转第一页,仅当总页数改变时跳转
         /// </summary>
         int PreviousPrintedPageCount = 0;
 

+ 16 - 13
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -231,6 +231,8 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
             }
 
             SaveFileDialog saveFileDialog = new SaveFileDialog();
+            saveFileDialog.FileName = "Untitle";
+            saveFileDialog.Filter = "PDF|*.pdf;";
             if (saveFileDialog.ShowDialog() == false)
             {
                 return;
@@ -244,31 +246,32 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                 case PageSizeType.kDefault:
                     break;
                 case PageSizeType.A4:
-                    rect.Width = 210;
-                    rect.Height = 297;
+
+                    rect.Width = CommonHelper.GetPageSizeFomrUnit(210);
+                    rect.Height = CommonHelper.GetPageSizeFomrUnit(297);
                     break;
                 case PageSizeType.A3:
-                    rect.Width = 297;
-                    rect.Height = 420;
+                    rect.Width = CommonHelper.GetPageSizeFomrUnit(297);
+                    rect.Height = CommonHelper.GetPageSizeFomrUnit(420);
                     break;
                 case PageSizeType.Letter:
-                    rect.Width = 216;
-                    rect.Height = 279;
+                    rect.Width = CommonHelper.GetPageSizeFomrUnit(216);
+                    rect.Height = CommonHelper.GetPageSizeFomrUnit(279);
                     break;
                 case PageSizeType.Legal:
-                    rect.Width = 216;
-                    rect.Height = 356;
+                    rect.Width = CommonHelper.GetPageSizeFomrUnit(216);
+                    rect.Height = CommonHelper.GetPageSizeFomrUnit(356);
                     break;
                 case PageSizeType.Customized:
                     if (!string.IsNullOrEmpty(InputWidth) && !string.IsNullOrEmpty(InputHeight))
                     {
-                        rect.Width = Convert.ToInt32(InputWidth);
-                        rect.Height = Convert.ToInt32(InputHeight);
+                        rect.Width = CommonHelper.GetPageSizeFomrUnit(Convert.ToInt32(InputWidth));
+                        rect.Height = CommonHelper.GetPageSizeFomrUnit(Convert.ToInt32(InputHeight));
                     }
                     else
                     {
-                        rect.Width = 595;
-                        rect.Height = 841;
+                        rect.Width = CommonHelper.GetPageSizeFomrUnit(595);
+                        rect.Height = CommonHelper.GetPageSizeFomrUnit(841);
                     }
                     break;
                 default:
@@ -286,7 +289,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
 
             bool saveResult = SaveDoc.WriteToFilePath(path);
             SaveDoc.Release();
-
+            CommonHelper.ShowFileBrowser(path);
             DialogParameters valuePairs = new DialogParameters();
             valuePairs.Add(ParameterNames.FilePath, path);
             RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));

+ 5 - 5
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogViewModel.cs

@@ -25,14 +25,14 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
             get { return _password; }
             set
             {
-                SetProperty(ref _password, value);
+                SetProperty(ref _password, value); 
                 IsRightValue = "unknow";
                 if (!string.IsNullOrEmpty(value)){
                     ClearPasswordButtonVisibility = Visibility.Visible;
                 }
                 else
                 {
-                    ClearPasswordButtonVisibility = Visibility.Collapsed;
+                    ClearPasswordButtonVisibility = Visibility.Hidden;
                 }
             }
         }
@@ -70,19 +70,19 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
                 }
                 else
                 {
-                    ErrorPasswordMsgVisibility = Visibility.Collapsed;
+                    ErrorPasswordMsgVisibility = Visibility.Hidden;
                 }
             }
         }
 
-        private Visibility _clearPasswordButtonVisibility = Visibility.Collapsed;
+        private Visibility _clearPasswordButtonVisibility = Visibility.Hidden;
         public Visibility ClearPasswordButtonVisibility
         {
             get { return _clearPasswordButtonVisibility; }
             set { SetProperty(ref _clearPasswordButtonVisibility, value); }
         }
 
-        private Visibility _errorPasswordMsgVisibility = Visibility.Collapsed;
+        private Visibility _errorPasswordMsgVisibility = Visibility.Hidden;
         public Visibility ErrorPasswordMsgVisibility
         {
             get { return _errorPasswordMsgVisibility; }

+ 67 - 25
PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/SetPasswordDialogViewModel.cs

@@ -327,46 +327,88 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
             dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, setPasswordpdf, e => { });
         }
 
-
         public void Encrypt()
         {
-
-            string openPassword = "";
-            string permissionsPassword = "";
-
-            CPDFPermissionsInfo permissionsInfo = null;
-
-            if (NeedOpenPassword)
-            {
-                if (!string.IsNullOrEmpty(OpenPassword))
-                {
-                    openPassword = OpenPassword;
-                }
-            }
-            if (NeedPermissionsPassword && (!string.IsNullOrEmpty(PermissionsPassword)))
+            viewContentViewModel.SecurityInfo.IsPasswordChanged = true;
+            if (NeedOpenPassword && (!string.IsNullOrEmpty(OpenPassword)))
             {
-                permissionsPassword = PermissionsPassword;
-                permissionsInfo = CreatePermissionsInfo(enumPermissionsMod);
+                this.viewContentViewModel.SecurityInfo.NeedOpenPassword = true;
+                this.viewContentViewModel.SecurityInfo.OpenPassword = OpenPassword;
             }
             else
             {
-                permissionsInfo = CreateDefaultPermissionsInfo();
+                this.viewContentViewModel.SecurityInfo.NeedOpenPassword = false;
+                viewContentViewModel.SecurityInfo.OpenPassword = null;
             }
-            cPDFViewer.Document.Encrypt(openPassword, permissionsPassword, permissionsInfo);
-           //cPDFViewer.ReloadDocument();
-            if (!string.IsNullOrEmpty(permissionsPassword) )
+
+            if (NeedPermissionsPassword && (!string.IsNullOrEmpty(PermissionsPassword)))
             {
-                cPDFViewer.Document.UnlockWithPassword(permissionsPassword);
-                SecurityHelper.CheckHaveAllPermissions(cPDFViewer.Document);
+                this.viewContentViewModel.SecurityInfo.NeedPermissionsPassword = true;
+                viewContentViewModel.SecurityInfo.PermissionsPassword = PermissionsPassword;
+                viewContentViewModel.SecurityInfo.CPDFPermissionsInfo = CreatePermissionsInfo(enumPermissionsMod);
             }
             else
             {
-                cPDFViewer.Document.UnlockWithPassword(openPassword);
+                this.viewContentViewModel.SecurityInfo.NeedPermissionsPassword = false;
+                viewContentViewModel.SecurityInfo.PermissionsPassword = null;
+                viewContentViewModel.SecurityInfo.CPDFPermissionsInfo = CreateDefaultPermissionsInfo();
             }
-            viewContentViewModel.PDFViewer.UndoManager.CanSave = true;
             RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
         }
 
+        //public void Encrypt()
+        //{
+
+        //    string openPassword = "";
+        //    string permissionsPassword = "";
+
+        //    CPDFPermissionsInfo permissionsInfo = null;
+
+        //    if (NeedOpenPassword)
+        //    {
+        //        if (!string.IsNullOrEmpty(OpenPassword))
+        //        {
+        //            openPassword = OpenPassword;
+        //        }
+        //    }
+        //    if (NeedPermissionsPassword && (!string.IsNullOrEmpty(PermissionsPassword)))
+        //    {
+        //        permissionsPassword = PermissionsPassword;
+        //        permissionsInfo = CreatePermissionsInfo(enumPermissionsMod);
+        //    }
+        //    else
+        //    {
+        //        permissionsInfo = CreateDefaultPermissionsInfo();
+        //    }
+
+        //    System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+        //    /*
+        //     *设置这个对话框的起始保存路径
+        //     */
+        //    sfd.InitialDirectory = cPDFViewer.Document.FilePath;
+        //    /*
+        //     *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+        //     */
+        //    sfd.Filter = "PDF|*.pdf;";
+        //    /*
+        //     *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+        //     */
+        //    sfd.FileName = cPDFViewer.Document.FileName + "_EncryptedFile.pdf";
+        //    /*
+        //     * 做一些工作
+        //     */
+        //    if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+        //    {
+        //        cPDFViewer.Document.Encrypt(openPassword, permissionsPassword, permissionsInfo);
+        //        cPDFViewer.Document.WriteToFilePath(sfd.FileName);
+        //        MessageBoxEx.Show("保存成功");
+        //        RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.OK));
+        //    }
+        //    else
+        //    {
+        //    }
+        //}
+
 
         public void CancelEncrypt() => RequestClose?.Invoke(new Prism.Services.Dialogs.DialogResult(ButtonResult.Cancel));
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 252 - 125
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 66 - 22
PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs


+ 17 - 4
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -97,6 +97,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 {
                     ImagePreviewVisibility = Visibility.Collapsed;
                     BtnGOorBackVisibility = Visibility.Collapsed;
+                    BtnLocationIsEnabled = false;
                 }
                 return pageNumTextContent;
             }
@@ -314,6 +315,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private bool btnLocationIsChecked = false;
+
+        public bool BtnLocationIsChecked
+        {
+            get { return btnLocationIsChecked; }
+            set
+            {
+                SetProperty(ref btnLocationIsChecked, value);
+            }
+        }
+
         private WriteableBitmap previewImage;
 
         public WriteableBitmap PreviewImage
@@ -671,14 +683,14 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         /// <summary>
         /// 定位目标范围
         /// </summary>
-        /// <param name="obj"></param> 
+        /// <param name="obj"></param>
         private void LocationPage(object obj)
         {
             pdfViewer.EnableDrawSelectArea(true);
             historyPageIndex = pdfViewer.CurrentIndex;
             PageNumTextIsEnabled = false;
             isSelected = false;
-
+            BtnLocationIsChecked = true;
             bool isExist = false;
             if (region.Regions.ContainsRegionWithName(viewContentViewModel.TipContentRegionName))
             {
@@ -696,7 +708,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
                 region.RequestNavigate(viewContentViewModel.TipContentRegionName, "LinkAnnotTip");
             }
-            if(string.IsNullOrEmpty(PageNumTextContent))
+            //if(string.IsNullOrEmpty(PageNumTextContent))
             viewContentViewModel.ShowTip(true);
         }
 
@@ -953,7 +965,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         {
             ImagePreviewVisibility = Visibility.Visible;
             BtnGOorBackVisibility = Visibility.Visible;
-
+            BtnLocationIsEnabled = true;
             int dpiHeight = (int)ImagePreviewHeight;
             int dpiWidth = (int)ImagePreviewWidth;
             if (dpiHeight <= 0 || dpiWidth <= 0)
@@ -1107,6 +1119,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                         pdfViewer.GoToPage(historyPageIndex);
                         //viewContentViewModel.LinkAnnotTipVisibility = Visibility.Collapsed;
                         viewContentViewModel.TipVisible = Visibility.Collapsed;
+                        BtnLocationIsChecked = false;
                     }
                 }
             }

+ 21 - 5
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs

@@ -77,6 +77,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private bool _isLineAnnot = false;
+        public bool IsLineAnnot
+        {
+            get { return _isLineAnnot; }
+            set
+            {
+                SetProperty(ref _isLineAnnot, value);
+            }
+        }
+
         private void UpdateDash(AnnotAttribEvent attribEvent)
         {
             if (Dash.Dashes != null && Dash.Dashes.Count > 0)
@@ -163,6 +173,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     rectPath.Rect = new Rect(0, 5, 28, 22);
                     DataPath = rectPath;
                     changeData[AnnotArgsType.AnnotSquare] = tag;
+                    IsLineAnnot = false;
                     break;
 
                 case "Circle":
@@ -172,6 +183,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     circlePath.Center = new Point(14, 14);
                     DataPath = circlePath;
                     changeData[AnnotArgsType.AnnotCircle] = tag;
+                    IsLineAnnot = false;
                     break;
 
                 case "Arrow":
@@ -185,6 +197,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                         arrowLine.EndSharp = C_LINE_TYPE.LINETYPE_ARROW;
                         DataPath = arrowLine.BuildArrowBody();
                         changeData[AnnotArgsType.AnnotLine] = tag;
+                        IsLineAnnot = true;
                         //  changeData[AnnotArgsType.AnnotLine] = tag;
                     }
 
@@ -197,6 +210,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                         arrowLine.LineEnd = new Point(32, 0);
                         DataPath = arrowLine.BuildArrowBody();
                         changeData[AnnotArgsType.AnnotLine] = tag;
+                        IsLineAnnot = true;
                     }
                    
                     break;
@@ -480,17 +494,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             if (annot is SquareAnnotArgs)
             {
                 var Square = Annot as SquareAnnotArgs;
-                isSolid = PropertyPanel.IsSolidStyle(Square.LineDash);
+                isSolid = AnnotPropertyPanel.IsSolidStyle(Square.LineDash);
             }
             else if(annot is CircleAnnotArgs)
             {
                 var Circle = Annot as CircleAnnotArgs;
-                isSolid = PropertyPanel.IsSolidStyle(Circle.LineDash);
+                isSolid = AnnotPropertyPanel.IsSolidStyle(Circle.LineDash);
             }
             else if(annot is LineAnnotArgs)
             {
                 var line = Annot as LineAnnotArgs;
-                isSolid = PropertyPanel.IsSolidStyle(line.LineDash);
+                isSolid = AnnotPropertyPanel.IsSolidStyle(line.LineDash);
             }
 
             return isSolid;
@@ -515,6 +529,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             Dash = Square.LineDash;
                             SharpsType("Rect",true);
                             BasicVm.AnnotTypeTitle = "矩形";
+                            IsLineAnnot = false;
                         }
                         break;
 
@@ -530,6 +545,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             Dash = Circle.LineDash;
                             SharpsType("Circle", true);
                             BasicVm.AnnotTypeTitle = "圆";
+                            IsLineAnnot = false;
                         }
                         break;
 
@@ -554,9 +570,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                                 SharpsType("Line", true);
                                 BasicVm.AnnotTypeTitle = "线条";
                             }
-                               
 
-                           
+                            IsLineAnnot = true;
+
                         }
 
                         break;

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/ViewModular/ViewModularContentViewModel.cs

@@ -50,7 +50,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.ViewModular
             }
         }
 
-        private bool isContinue;
+        private bool isContinue = true;
 
         public bool IsContinue
         {

+ 3 - 9
PDF Office/ViewModels/TipContent/FileRestrictedTipViewModel.cs

@@ -6,14 +6,7 @@ using Prism.Commands;
 using Prism.Events;
 using Prism.Mvvm;
 using Prism.Regions;
-using Prism.Services.Dialogs;
-using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using static Dropbox.Api.Files.ThumbnailMode;
+using Prism.Services.Dialogs; 
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 
 namespace PDF_Office.ViewModels.TipContent
@@ -50,7 +43,8 @@ namespace PDF_Office.ViewModels.TipContent
                 if (result.Password != null)
                 {
                     string filePath = PDFViewer.Document.FilePath;
-                    PDFViewer.ReloadDocument();
+                    PDFViewer.Document.Release();
+                    PDFViewer.InitDocument(filePath);
                     PDFViewer.Document.UnlockWithPassword(result.Password);
                 }
                 ///TODO:

+ 23 - 16
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -143,7 +143,6 @@ namespace PDF_Office.ViewModels.Tools
                         if (e.IsAnnotCreateReset == false)
                         {
                             GetSelectedAnnots(e);
-                            //PDFViewer.SetToolParam(annot);
                         }
                         else
                         {
@@ -211,13 +210,11 @@ namespace PDF_Office.ViewModels.Tools
                             }
                         }
 
-
                         if (isDifferentAnnotTyle)
                             viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
                         else
                             GetSelectedAnnots(e);
                     }
-
                 }
 
                 //注释列表同步选中
@@ -244,10 +241,9 @@ namespace PDF_Office.ViewModels.Tools
             }
             else
             {
-
-                viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                if (BtnLinkIsChecked == false)
+                    viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
             }
-
         }
 
         private bool isShapAnnot(AnnotHandlerEventArgs annot)
@@ -381,27 +377,37 @@ namespace PDF_Office.ViewModels.Tools
                                     case AnnotArgsType.AnnotUnderline:
                                     case AnnotArgsType.AnnotStrikeout:
                                     case AnnotArgsType.AnnotSquiggly:
-                                        e.PopupMenu = SelectHightAnnotMenu(sender);
+                                        e.PopupMenu = HightAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
+
                                     case AnnotArgsType.AnnotFreehand:
-                                        e.PopupMenu = SelectFreeHandAnnotMenu(sender);
+                                        e.PopupMenu = FreeHandAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
+
                                     case AnnotArgsType.AnnotFreeText:
-                                        e.PopupMenu = SelectFreeTextAnnotMenu(sender);
+                                        e.PopupMenu = FreeTextAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
+
                                     case AnnotArgsType.AnnotSticky:
-                                        e.PopupMenu = SelectStrickNoteAnnotMenu(sender);
+                                        e.PopupMenu = StrickNoteAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
+
                                     case AnnotArgsType.AnnotSquare:
-                                    case AnnotArgsType.AnnotLine:
                                     case AnnotArgsType.AnnotCircle:
-                                        e.PopupMenu = SelectShapeAnnotMenu(sender);
+                                        ShapeAnnotPopMenu.SetVisual("ShapeDirect", false);
+                                        e.PopupMenu = ShapeAnnotPopMenu.OpenMenu(selectedAnnot, sender);
+                                        break;
+                                    case AnnotArgsType.AnnotLine:
+                                        ShapeAnnotPopMenu.SetVisual("ShapeDirect", true);
+                                        e.PopupMenu = ShapeAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
+
                                     case AnnotArgsType.AnnotLink:
-                                        e.PopupMenu = SelectHightAnnotMenu(sender);
+                                        e.PopupMenu = LinkAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
+
                                     case AnnotArgsType.AnnotStamp:
-                                        e.PopupMenu = SelectHightAnnotMenu(sender);
+                                        e.PopupMenu = StampAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
                                 }
                             }
@@ -417,9 +423,10 @@ namespace PDF_Office.ViewModels.Tools
                                     }
                                 }
 
-                                e.PopupMenu = SelectMultiAnnotMenu(sender, isHigh);
+                                MultiAnnotPopMenu.SetVisual("MultiCopy", !isHigh);
+                                MultiAnnotPopMenu.SetVisual("MultiCut", !isHigh);
+                                e.PopupMenu = MultiAnnotPopMenu.OpenMenu(e.AnnotEventArgsList,sender);//SelectMultiAnnotMenu(e.AnnotEventArgsList, isHigh);
                             }
-
                         }
                         if (e.PopupMenu != null)
                         {

+ 373 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -7,6 +7,7 @@ using Microsoft.Office.Core;
 using Microsoft.Win32;
 using PDF_Office.CustomControl;
 using PDF_Office.Helper;
+using PDF_Office.Model;
 using PDF_Office.Model.BOTA;
 using PDF_Office.Properties;
 using PDF_Office.ViewModels.BOTA;
@@ -16,6 +17,7 @@ using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using PDFSettings;
 using Prism.Mvvm;
 using Prism.Regions;
+using Prism.Services.Dialogs;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -27,6 +29,7 @@ using System.Windows.Controls;
 using System.Windows.Forms;
 using System.Windows.Input;
 using System.Windows.Media;
+using System.Windows.Media.Imaging;
 using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
 using ContextMenu = System.Windows.Controls.ContextMenu;
 using HorizontalAlignment = System.Windows.HorizontalAlignment;
@@ -1012,6 +1015,376 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+
+
+        #region 注释右键菜单事件
+        //高亮、下划线、删除
+        private void HightAnnotCopyText_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if(annot != null)
+                {
+                    System.Windows.Clipboard.SetText(annot.Content);
+                }
+                
+            }
+        }
+
+        //更改为当前注释属性默认值
+        private void AnnotDefaultValues_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    if (annot is TextHighlightAnnotArgs)
+                    {
+                        var color = (annot as TextHighlightAnnotArgs).Color;
+                        Settings.Default.AppProperties.Annotate.HighLightColor = color;
+                        HighLightColor = new SolidColorBrush(color);
+
+                    }
+                    else if (annot is TextUnderlineAnnotArgs)
+                    {
+                        var color = (annot as TextHighlightAnnotArgs).Color;
+                        Settings.Default.AppProperties.Annotate.UnderLineColor = color;
+                        UnderLineColor = new SolidColorBrush(color);
+                    }
+                    else if (annot is TextStrikeoutAnnotArgs)
+                    {
+                        var color = (annot as TextHighlightAnnotArgs).Color;
+                        Settings.Default.AppProperties.Annotate.StrikethroughColor = color;
+                        StrikeoutColor = new SolidColorBrush(color);
+                    }
+                    else if (annot is FreehandAnnotArgs)
+                    {
+                        var color = (annot as FreehandAnnotArgs).InkColor;
+                        Settings.Default.AppProperties.Annotate.FreeHandColor = color;
+
+                    }
+                    else if (annot is FreeTextAnnotArgs)
+                    {
+                        var freeText = annot as FreeTextAnnotArgs;
+                        Settings.Default.AppProperties.Annotate.TextAnnoteColor = freeText.FontColor;
+                        Settings.Default.AppProperties.Annotate.TextFontFamaily = freeText.FontFamily.ToString();
+                        Settings.Default.AppProperties.Annotate.TextAlign = freeText.Align;
+                    }
+                    else if (annot is StickyAnnotArgs)
+                    {
+                        var color = (annot as StickyAnnotArgs).Color;
+                        Settings.Default.AppProperties.Annotate.NoteAnnoteColor = color;
+                    }
+                    else if (annot is SquareAnnotArgs)
+                    {
+                        var bgColor = (annot as SquareAnnotArgs).BgColor;
+                        Settings.Default.AppProperties.Annotate.RectangleFillColor = bgColor;
+                        var borderColor = (annot as SquareAnnotArgs).LineColor;
+                        Settings.Default.AppProperties.Annotate.RectangleBorderColor = borderColor;
+                    }
+                    else if (annot is CircleAnnotArgs)
+                    {
+                        var bgColor = (annot as CircleAnnotArgs).BgColor;
+                        Settings.Default.AppProperties.Annotate.CircleFillColor = bgColor;
+                        var borderColor = (annot as CircleAnnotArgs).LineColor;
+                        Settings.Default.AppProperties.Annotate.CircleBorderColor = borderColor;
+                    }
+                    else if (annot is LineAnnotArgs)
+                    {
+                        var color = (annot as LineAnnotArgs).LineColor;
+                        Settings.Default.AppProperties.Annotate.LineColor = color;
+                    }
+
+                    Settings.Default.Save();
+                }
+               
+              
+            }
+        }
+
+        //更改颜色
+        private void AnnotColorPalette_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    var item = new ColorDropBoxPop();
+                    item.DataContext = annot;
+                    item.ColorSelected -= AnnotMenu_ColorSelected;
+                    item.ColorSelected += AnnotMenu_ColorSelected;
+                    System.Windows.Controls.Primitives.Popup popup = new System.Windows.Controls.Primitives.Popup();
+                    popup.Child = item;
+                    popup.PlacementRectangle = new Rect(Mouse.GetPosition(App.Current.MainWindow), new Size(item.Width, item.Height));
+                    popup.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
+                    popup.IsOpen = true;
+                }
+
+            }
+        }
+        
+        private void AnnotMenu_ColorSelected(object sender, Color e)
+        {
+            if (sender != null)
+            {
+                var annot = (sender as FrameworkElement).DataContext as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    if(annot is FreehandAnnotArgs || annot is StickyAnnotArgs || annot is LineAnnotArgs)
+                    {
+                        var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.Color, e);
+                        AnnotEvent?.UpdateAnnot();
+                    }
+                    else if(annot is FreeTextAnnotArgs)
+                    {
+                        var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.FontColor, e);
+                        AnnotEvent?.UpdateAnnot();
+                    }
+                    else if (annot is SquareAnnotArgs || annot is CircleAnnotArgs)
+                    {
+                        var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.FillColor, e);
+                        AnnotEvent?.UpdateAnnot();
+                    }
+
+                }
+            }
+        }
+        //添加笔记
+        private void AnnotAddNoteText_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    DialogParameters value = new DialogParameters();
+                    value.Add(ParameterNames.Annotation, annot);
+                    dialogs.ShowDialog(DialogNames.AddAnnotationDialog, value, e =>
+                    {
+                        if (e.Result == ButtonResult.OK && e.Parameters != null)
+                        {
+                            PDFViewer.UndoManager.CanSave = true;
+                            if (e.Parameters.ContainsKey(ParameterNames.Annotation) && e.Parameters.ContainsKey(ParameterNames.AnnotEvent))
+                            {
+                            }
+                        }
+                    });
+                }
+
+            }
+           
+        }
+
+        //手绘
+        private void FreeHandLineStyle_Menu(object obj)
+        {
+
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as FreehandAnnotArgs;
+                if (annot != null)
+                {
+                    var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                    if(menu.tag.ToString() == "Solid")
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, AnnotPropertyPanel.GetLineDashStyle(true));
+                    }
+                    else
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, AnnotPropertyPanel.GetLineDashStyle(false));
+                    }
+
+                    AnnotEvent?.UpdateAnnot();
+
+                }
+
+            }
+        }
+
+        //文本
+
+        private void FreeTextFontFamily_Menu(object obj)
+        {
+
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                    AnnotEvent?.UpdateAttrib(AnnotAttrib.FontFamily, new FontFamily(menu.tag.ToString()));
+                    AnnotEvent?.UpdateAnnot();
+                }
+
+            }
+        }
+
+        private void FreeTextAglin_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                var tag = menu.control.Tag;
+                if (annot != null && tag != null)
+                {
+                    var strTag = tag.ToString();
+
+                    var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                    if (strTag == "Left")
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Left);
+                    }
+                    else if (strTag == "Center")
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Center);
+                    }
+                    else if (strTag == "Right")
+                    {
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.TextAlign, TextAlignment.Right);
+                    }
+                    AnnotEvent?.UpdateAnnot();
+                }
+
+            }
+
+        }
+
+        //便签
+
+        private void StrikeNoteEditStrike_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                if (annot != null)
+                {
+                    List<AnnotHandlerEventArgs> list = new List<AnnotHandlerEventArgs>();
+                    list.Add(annot);
+                    GetStickyNote(list);
+                    annot.Author = Settings.Default.AppProperties.Description.Author;
+                    PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                    PDFViewer.SetToolParam(annot);
+                    isRightMenuAddAnnot = false;
+                }
+
+            }
+        }
+
+        //形状
+
+        private void ShapeLineStyle_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as AnnotHandlerEventArgs;
+                var tag = menu.control.Tag;
+                if (annot != null && tag != null)
+                {
+                    var strTag = tag.ToString();
+                    var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                    if (strTag == "Solid")
+                    {
+                        var dashStyle = AnnotPropertyPanel.GetLineDashStyle(true);
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, dashStyle);
+                    }
+                    else
+                    {
+                        var dashStyle = AnnotPropertyPanel.GetLineDashStyle(false);
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, dashStyle);
+                    }
+                    AnnotEvent?.UpdateAnnot();
+                }
+
+            }
+
+        }
+
+        private void ShapeLineDirect_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as LineAnnotArgs;
+                var tag = menu.control.Tag;
+                if (annot != null && tag != null)
+                {
+                    var strTag = tag.ToString();
+                    var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                    if (strTag == "ver")
+                    {
+                        annot.SetLineVertical();
+                    }
+                    else
+                    {
+                        annot.SetLineHorizontal();
+                    }
+                }
+
+            }
+            
+        }
+
+        //图章
+        private void StampExportPicture_Menu(object obj)
+        {
+            if (obj as CusMenuItem != null)
+            {
+                var menu = obj as CusMenuItem;
+                var annot = menu.Parameter as StampAnnotArgs;
+                if (annot != null)
+                {
+                    Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
+                    var format = menu.tag.ToString();
+                    if (format == "PDF")
+                        dlg.Filter = "PDF|*.pdf";
+                    else
+                        dlg.Filter = format + "|*." + format.ToLower();
+
+                    dlg.DefaultExt = "." + menu.tag.ToString().ToLower();
+                    dlg.FileName = PDFViewer.Document.FileName;
+                    if (dlg.ShowDialog() == true)
+                    {
+                        var stampPicture = dlg.FileName;
+                        if(menu.tag.ToString() == "PDF")
+                        {
+
+                        }
+                        else
+                        {
+                            var writeStamp = annot.GetStampDrawing();
+                            using (FileStream stream5 = new FileStream(stampPicture, FileMode.Create))
+                            {
+                                PngBitmapEncoder encoder5 = new PngBitmapEncoder();
+                                encoder5.Frames.Add(BitmapFrame.Create(writeStamp));
+                                encoder5.Save(stream5);
+                            }
+                        }
+                        
+                    }
+                }
+
+            }
+        }
+        
+
+        #endregion 注释右键菜单事件
+
+
         #endregion 菜单
     }
 }

+ 451 - 163
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs

@@ -1,6 +1,7 @@
 using ComPDFKit.PDFDocument;
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
+using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Helper;
 using Prism.Mvvm;
 using Prism.Regions;
@@ -30,7 +31,6 @@ namespace PDF_Office.ViewModels.Tools
         /// <param name="annotAttribsList">更改注释属性的键值对,更改值后会自动记录undoRedo容器里</param>
         private void AddToPropertyPanel(string viewContent, string toolTag = null, List<AnnotHandlerEventArgs> annots = null, Dictionary<AnnotAttrib, object> annotAttribsList = null, AnnotAttribEvent annotAttribEvent = null)
         {
-
             if (annots != null)
             {
                 propertyPanel.annotlists = annots;
@@ -82,6 +82,7 @@ namespace PDF_Office.ViewModels.Tools
         #endregion 属性面板
 
         #region 阅读页 - 右键菜单
+
         private ContextMenu ViewerContextMenu()
         {
             ContextMenu contextMenu = App.Current.FindResource("ViewerContextMenu") as ContextMenu;
@@ -90,7 +91,6 @@ namespace PDF_Office.ViewModels.Tools
             return contextMenu;
         }
 
-
         private void ViewerContextMenu_Loaded(object sender, RoutedEventArgs e)
         {
             ContextMenu contextMenu = sender as ContextMenu;
@@ -158,8 +158,9 @@ namespace PDF_Office.ViewModels.Tools
                                 break;
 
                             case "AddBookMark":
-                                menuItem1.Click -= AddBookMark_Click;
-                                menuItem1.Click += AddBookMark_Click;
+                                //menuItem1.Click -= AddBookMark_Click;
+                                //menuItem1.Click += AddBookMark_Click;
+                                menuItem1.Command = AddBookMarkCommand;
                                 SetMenuItemVisibility(menuItem1, "DelBookMark", "AddBookMark", isAddBookMark);
                                 break;
 
@@ -335,189 +336,476 @@ namespace PDF_Office.ViewModels.Tools
 
         #region 注释-右键菜单
 
-        //高亮注释,右键菜单
-        private ContextMenu SelectHightAnnotMenu(object sender)
+        /// <summary>
+        /// 高亮注释,右键菜单
+        /// </summary>
+        private void InitSelectHightAnnotMenu()
         {
-            var popMenu = App.Current.FindResource("HightAnnotContextMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
-            //颜色列表
-            customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
-            //复制文本
-            customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
-            //删除
-            customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
-            //添加笔记
-            customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
-            //设置当前属性为默认值
-            customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
-            return popMenu;
+            var popMenu = new ContextMenu();
+            PopMenu pop = new PopMenu(popMenu);
+            ColorContent colorContent = new ColorContent();
+            colorContent.Name = "hightcolor";
+            colorContent.SelectedColorHandler -= colorContent_SelectedColorHandler;
+            colorContent.SelectedColorHandler += colorContent_SelectedColorHandler;
+            colorContent.VerticalAlignment = VerticalAlignment.Top;
+            colorContent.Height = 60;
+             var menuItem = new MenuItem();
+            menuItem.Name = "hightColor";
+            menuItem.Height = colorContent.Height;
+            menuItem.Header = colorContent;
+            var hightColorStyle = App.Current.FindResource("UIElementMenuItem") as Style;
+            if (hightColorStyle != null)
+                menuItem.Style = hightColorStyle;
+
+            pop.AddItem(menuItem);
+
+            pop.AddItem(GetSeparator());
+
+            menuItem = new MenuItem();
+            menuItem.Name = "hightCopyText";
+            menuItem.Header = "复制文本";
+            pop.BindingEvent(pop.AddItem(menuItem), HightAnnotCopyText_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "hightdelete";
+            menuItem.Header = "删除";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
+
+            pop.AddItem(GetSeparator());
+
+            menuItem = new MenuItem();
+            menuItem.Name = "hightAddNote";
+            menuItem.Header = "添加笔记";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotAddNoteText_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "hightdefault";
+            menuItem.Header = "设置当前属性为默认值";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
+            HightAnnotPopMenu = pop;
         }
 
-        //手绘
-        private ContextMenu SelectFreeHandAnnotMenu(object sender)
+        private Separator GetSeparator()
         {
-            var popMenu = App.Current.FindResource("FreeHandAnnotContextMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
-            //复制
-            customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
-            //剪切
-            customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
-            //粘贴
-            customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
-            //删除
-            customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
-            //颜色
-            customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
-            //线段样式
-            customMenu.SetSubMenuBinding(5, 0, ApplicationCommands.Delete);
-            customMenu.SetSubMenuBinding(5, 1, ApplicationCommands.Delete);
-            //添加笔记
-            customMenu.SetMenuBinding(6, ApplicationCommands.Delete);
-            //设置当前属性为默认值
-            customMenu.SetMenuBinding(7, ApplicationCommands.Delete);
-            return popMenu;
+            Separator  separator = new Separator();
+            separator.Height = 1;
+            separator.BorderBrush = new SolidColorBrush(Color.FromArgb(0x33, 0x00, 0x00, 0x00));
+            separator.BorderThickness = new Thickness(1);
+            return separator;
         }
 
-        //文本
-        private ContextMenu SelectFreeTextAnnotMenu(object sender)
+        private void colorContent_SelectedColorHandler(object sender, Color e)
         {
-            var popMenu = App.Current.FindResource("FreeTextAnnotContextMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
-            //复制
-            customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
-            //剪切
-            customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
-            //粘贴
-            customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
-            //删除
-            customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
-            //文本颜色
-            customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
-            //字体
-            customMenu.SetSubMenuBinding(5, 0, ApplicationCommands.Delete);
-            customMenu.SetSubMenuBinding(5, 1, ApplicationCommands.Delete);
-            customMenu.SetSubMenuBinding(5, 2, ApplicationCommands.Delete);
-            //文本对齐
-            customMenu.SetSubMenuBinding(6, 0, ApplicationCommands.Delete);
-            customMenu.SetSubMenuBinding(6, 1, ApplicationCommands.Delete);
-            customMenu.SetSubMenuBinding(6, 2, ApplicationCommands.Delete);
-            //设置当前属性为默认值
-            customMenu.SetMenuBinding(7, ApplicationCommands.Delete);
-            return popMenu;
+            if (e == null) return;
+
+            var annot =(sender as FrameworkElement).DataContext as AnnotHandlerEventArgs;
+            if(annot != null)
+            {
+                var test = annot as TextHighlightAnnotArgs;
+                if(test != null)
+                {
+                    var anvent = AnnotAttribEvent.GetAnnotAttribEvent(test, test.GetAnnotAttrib());
+                    anvent.UpdateAttrib(AnnotAttrib.Color, e);
+                    anvent.UpdateAnnot();
+                }
+               
+            }
         }
 
-        //便签
-        private ContextMenu SelectStrickNoteAnnotMenu(object sender)
+        /// <summary>
+        /// 手绘
+        /// </summary>
+        private void InitSelectFreeHandAnnotMenu()
         {
-            var popMenu = App.Current.FindResource("StrickNoteAnnotContextMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
-            //复制
-            customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
-            //剪切
-            customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
-            //粘贴
-            customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
-            //删除
-            customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
-            //颜色
-            customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
-            //编辑便签
-            customMenu.SetMenuBinding(5, ApplicationCommands.Delete);
-            //设置当前属性为默认值
-            customMenu.SetMenuBinding(7, ApplicationCommands.Delete);
-            return popMenu;
+            var popMenu = new ContextMenu();
+            PopMenu pop = new PopMenu(popMenu);
+            var menuItem = new MenuItem();
+            menuItem.Name = "FreeHandCopy";
+            menuItem.Header = "复制";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeHandCut";
+            menuItem.Header = "剪切";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeHandPaste";
+            menuItem.Header = "粘贴";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeHandDelete";
+            menuItem.Header = "删除";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
+
+            pop.AddItem(GetSeparator());
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeHandColor";
+            menuItem.Header = "颜色...";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeHandLineStyle";
+            menuItem.Header = "线段样式";
+            pop.AddItem(menuItem);
+
+            RadioButton radioButton = new RadioButton();
+            radioButton.Name = "FreeHandSolid";
+            radioButton.Content = "实线";
+            radioButton.GroupName = "LineStyle";
+            radioButton.Tag = "Solid";
+            pop.BindingEvent(pop.AddChild("FreeHandLineStyle",radioButton), FreeHandLineStyle_MenuCommand);
+
+            radioButton = new RadioButton();
+            radioButton.Name = "FreeHandDash";
+            radioButton.Content = "虚线";
+            radioButton.GroupName = "LineStyle";
+            radioButton.Tag = "Dash";
+            pop.BindingEvent(pop.AddChild("FreeHandLineStyle", radioButton), FreeHandLineStyle_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeHandAddNote";
+            menuItem.Header = "添加笔记";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotAddNoteText_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeHandDefault";
+            menuItem.Header = "设置当前属性为默认值";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
+            FreeHandAnnotPopMenu = pop;
         }
+        /// <summary>
+        /// 文本
+        /// </summary>
+        private void InitSelectFreeTextAnnotMenu()
+        {
+            var popMenu = new ContextMenu();
+            PopMenu pop = new PopMenu(popMenu);
+            var menuItem = new MenuItem();
+            menuItem.Name = "FreeTextCopy";
+            menuItem.Header = "复制";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextCut";
+            menuItem.Header = "剪切";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextPaste";
+            menuItem.Header = "粘贴";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextDelete";
+            menuItem.Header = "删除";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
 
-        //形状
-        private ContextMenu SelectShapeAnnotMenu(object sender)
+            pop.AddItem(GetSeparator());
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextColor";
+            menuItem.Header = "颜色...";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextFontFamily";
+            menuItem.Header = "字体";
+            pop.AddItem(menuItem);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextArial";
+            menuItem.Header = "楷体";
+            menuItem.Tag = "Arial";
+            pop.BindingEvent(pop.AddChild("FreeTextFontFamily", menuItem), FreeTextFontFamily_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextCourier";
+            menuItem.Header = "Courier";
+            menuItem.Tag = "Courier";
+            pop.BindingEvent(pop.AddChild("FreeTextFontFamily", menuItem), FreeTextFontFamily_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextTimesRoman";
+            menuItem.Header = "Times New Roman";
+            menuItem.Tag = "Times New Roman";
+            pop.BindingEvent(pop.AddChild("FreeTextFontFamily", menuItem), FreeTextFontFamily_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextAglin";
+            menuItem.Header = "文本对齐";
+            pop.AddItem(menuItem);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextAglinLeft";
+            menuItem.Header = "左对齐";
+            menuItem.Tag = "Left";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", menuItem), FreeTextAglin_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextAglinCenter";
+            menuItem.Header = "居中对齐";
+            menuItem.Tag = "Center";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", menuItem), FreeTextAglin_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeTextAglinRight";
+            menuItem.Header = "右对齐";
+            menuItem.Tag = "Right";
+            pop.BindingEvent(pop.AddChild("FreeTextAglin", menuItem), FreeTextAglin_MenuCommand);
+
+
+            menuItem = new MenuItem();
+            menuItem.Name = "FreeHandDefault";
+            menuItem.Header = "设置当前属性为默认值";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
+            FreeTextAnnotPopMenu = pop;
+        }
+
+        /// <summary>
+        /// 便签
+        /// </summary>
+        private void InitSelectStrickNoteAnnotMenu()
         {
-            var popMenu = App.Current.FindResource("ShapeAnnotContextMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
-            //复制
-            customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
-            //剪切
-            customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
-            //粘贴
-            customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
-            //删除
-            customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
-            //颜色
-            customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
-            //线段样式
-            customMenu.SetSubMenuBinding(6, 0, ApplicationCommands.Delete);
-            customMenu.SetSubMenuBinding(6, 1, ApplicationCommands.Delete);
-            //线段方向
-            customMenu.SetSubMenuBinding(7, 0, ApplicationCommands.Delete);
-            customMenu.SetSubMenuBinding(7, 1, ApplicationCommands.Delete);
-            //添加笔记
-            customMenu.SetMenuBinding(8, ApplicationCommands.Delete);
-            //设置当前属性为默认值
-            customMenu.SetMenuBinding(8, ApplicationCommands.Delete);
-            return popMenu;
+            var popMenu = new ContextMenu();
+            PopMenu pop = new PopMenu(popMenu);
+            var menuItem = new MenuItem();
+            menuItem.Name = "StrickNoteCopy";
+            menuItem.Header = "复制";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StrickNoteCut";
+            menuItem.Header = "剪切";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StrickNotePaste";
+            menuItem.Header = "粘贴";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StrickNoteDelete";
+            menuItem.Header = "删除";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
+
+            pop.AddItem(GetSeparator());
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StrickNoteColor";
+            menuItem.Header = "颜色...";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StrickNoteEdit";
+            menuItem.Header = "编辑便签";
+            pop.BindingEvent(pop.AddItem(menuItem), StrikeNoteEditStrike_MenuCommand);
+            menuItem = new MenuItem();
+            menuItem.Name = "StrickNoteDefault";
+            menuItem.Header = "设置当前属性为默认值";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
+            StrickNoteAnnotPopMenu = pop;
         }
 
-        //链接
-        private ContextMenu SelectLinkAnnotMenu(object sender)
+        /// <summary>
+        /// 形状
+        /// </summary>
+        private void InitSelectShapeAnnotMenu()
         {
-            var popMenu = App.Current.FindResource("LinkAnnotContextMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
-            //复制
-            customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
-            //剪切
-            customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
-            //粘贴
-            customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
-            //删除
-            customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
-            return popMenu;
+            var popMenu = new ContextMenu();
+            PopMenu pop = new PopMenu(popMenu);
+            var menuItem = new MenuItem();
+            menuItem.Name = "ShapeCopy";
+            menuItem.Header = "复制";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeCut";
+            menuItem.Header = "剪切";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapePaste";
+            menuItem.Header = "粘贴";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeDelete";
+            menuItem.Header = "删除";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
+
+            pop.AddItem(GetSeparator());
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeColor";
+            menuItem.Header = "颜色...";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotColorPalette_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeLineStyle";
+            menuItem.Header = "线段样式";
+            pop.AddItem(menuItem);
+
+            RadioButton radioButton = new RadioButton();
+            radioButton.Name = "ShapeSolid";
+            radioButton.Content = "实线";
+            radioButton.GroupName = "LineStyle";
+            radioButton.Tag = "Solid";
+            pop.BindingEvent(pop.AddChild("ShapeLineStyle", radioButton), ShapeLineStyle_MenuCommand);
+
+            radioButton = new RadioButton();
+            radioButton.Name = "ShapeDash";
+            radioButton.Content = "虚线";
+            radioButton.GroupName = "LineStyle";
+            radioButton.Tag = "Dash";
+            pop.BindingEvent(pop.AddChild("ShapeLineStyle", radioButton), ShapeLineStyle_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeDirect";
+            menuItem.Header = "线段方向";
+            pop.AddItem(menuItem);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeVer";
+            menuItem.Header = "垂直";
+            menuItem.Tag = "Ver";
+            pop.BindingEvent(pop.AddChild("ShapeDirect", menuItem), ShapeLineDirect_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeHor";
+            menuItem.Header = "横向";
+            menuItem.Tag = "Hor";
+            pop.BindingEvent(pop.AddChild("ShapeDirect", menuItem), ShapeLineDirect_MenuCommand);
+
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeNoteText";
+            menuItem.Header = "添加笔记";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotAddNoteText_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "ShapeDefault";
+            menuItem.Header = "设置当前属性为默认值";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotDefaultValue_MenuCommand);
+            ShapeAnnotPopMenu = pop;
         }
 
-        //图章、签名
-        private ContextMenu SelectStampAnnotMenu(object sender)
+        /// <summary>
+        /// 链接
+        /// </summary>
+        private void InitSelectLinkAnnotMenu()
         {
-            var popMenu = App.Current.FindResource("StampAnnotContextMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
-            //复制
-            customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
-            //剪切
-            customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
-            //粘贴
-            customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
-            //删除
-            customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
-            //导出
-            customMenu.SetSubMenuBinding(4, 0, ApplicationCommands.Paste);
-            customMenu.SetSubMenuBinding(4, 1, ApplicationCommands.Paste);
-            customMenu.SetSubMenuBinding(4, 2, ApplicationCommands.Paste);
-            //添加笔记
-            customMenu.SetMenuBinding(5, ApplicationCommands.Paste);
-            return popMenu;
+            var popMenu = new ContextMenu();
+            PopMenu pop = new PopMenu(popMenu);
+            var menuItem = new MenuItem();
+            menuItem.Name = "LinkCopy";
+            menuItem.Header = "复制";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "LinkCut";
+            menuItem.Header = "剪切";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "LinkPaste";
+            menuItem.Header = "粘贴";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "LinkDelete";
+            menuItem.Header = "删除";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
+            LinkAnnotPopMenu = pop;
         }
 
-        //多选
-        private ContextMenu SelectMultiAnnotMenu(object sender, bool isHightAnnot)
+        /// <summary>
+        /// 图章、签名
+        /// </summary>
+        private void InitSelectStampAnnotMenu()
         {
-            var popMenu = App.Current.FindResource("MultiSelectAnnotContextMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
-            if (isHightAnnot)
-            {
-                customMenu.SetVisibilityProperty(0, false);
-                customMenu.SetVisibilityProperty(2, false);
-            }
-            else
-            {
-                //复制
-                customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
-                //剪切
-                customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
-            }
-            //删除
-            customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
-            return popMenu;
+            var popMenu = new ContextMenu();
+            PopMenu pop = new PopMenu(popMenu);
+            var menuItem = new MenuItem();
+            menuItem.Name = "StampCopy";
+            menuItem.Header = "复制";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StampCut";
+            menuItem.Header = "剪切";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StampPaste";
+            menuItem.Header = "粘贴";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Paste);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StampDelete";
+            menuItem.Header = "删除";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
+
+            pop.AddItem(GetSeparator());
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StampExportPicture";
+            menuItem.Header = "导出";
+            pop.AddItem(menuItem);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StampExportPNG";
+            menuItem.Header = "PNG";
+            menuItem.Tag = "PNG";
+            pop.BindingEvent(pop.AddChild("StampExportPicture",menuItem), StampExportPicture_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StampExportPNG";
+            menuItem.Header = "JPG";
+            menuItem.Tag = "JPG";
+            pop.BindingEvent(pop.AddChild("StampExportPicture", menuItem), StampExportPicture_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StampExportPNG";
+            menuItem.Header = "PDF";
+            menuItem.Tag = "PDF";
+            pop.BindingEvent(pop.AddChild("StampExportPicture", menuItem), StampExportPicture_MenuCommand);
+
+            menuItem = new MenuItem();
+            menuItem.Name = "StampAddNote";
+            menuItem.Header = "添加笔记";
+            pop.BindingEvent(pop.AddItem(menuItem), AnnotAddNoteText_MenuCommand);
+
+            StampAnnotPopMenu = pop;
         }
 
+        /// <summary>
+        /// 多选注释
+        /// </summary>
+        private void InitSelectMultiAnnotMenu()
+        {
+            var popMenu = new ContextMenu();
+            PopMenu pop = new PopMenu(popMenu);
+            var menuItem = new MenuItem();
+            menuItem.Name = "MultiCopy";
+            menuItem.Header = "复制";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Copy);
 
-        #endregion 注释-右键菜单
+            menuItem = new MenuItem();
+            menuItem.Name = "MultiCut";
+            menuItem.Header = "剪切";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Cut);
 
+            menuItem = new MenuItem();
+            menuItem.Name = "MultiDelete";
+            menuItem.Header = "删除";
+            pop.BindingEvent(pop.AddItem(menuItem), ApplicationCommands.Delete);
+            MultiAnnotPopMenu = pop;
+        }
+
+
+        #endregion 注释-右键菜单
     }
-}
+}

+ 56 - 6
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl;
+using PDF_Office.Helper;
 using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
 using Prism.Commands;
 using Prism.Events;
@@ -36,7 +37,7 @@ namespace PDF_Office.ViewModels.Tools
         { }
 
         //外部UI控件选中状态
-        public bool IsSolidStyle(DashStyle LineDash)
+        public static bool IsSolidStyle(DashStyle LineDash)
         {
             bool isSolid = true;
             if (LineDash == null || LineDash.Dashes.Count == 0)
@@ -48,19 +49,32 @@ namespace PDF_Office.ViewModels.Tools
             {
                 if (item > 0)
                 {
-
                     isSolid = false;
                     break;
                 }
             }
             return isSolid;
+        }
+
+        public static DashStyle GetLineDashStyle(bool isSolid)
+        {
+            DashStyle newDash = new DashStyle();
+            if(isSolid == false)
+            {
+                newDash.Dashes.Add(2);
+                newDash.Dashes.Add(2);
+            }
+            else
+            {
+                newDash = DashStyles.Solid;
+            }
 
+            return newDash;
         }
 
         //单个属性更改
         public void UpdateAnnotAAttrib(AnnotAttrib annotAttrib, object obj)
         {
-
             if (annotlists != null && annotlists.Count > 1)
             {
                 foreach (var itemevent in AnnotEvents)
@@ -74,7 +88,6 @@ namespace PDF_Office.ViewModels.Tools
                 AnnotEvent?.UpdateAttrib(annotAttrib, obj);
                 AnnotEvent?.UpdateAnnot();
             }
-
         }
 
         //多个属性更改
@@ -101,11 +114,12 @@ namespace PDF_Office.ViewModels.Tools
 
                 AnnotEvent?.UpdateAnnot();
             }
-
         }
 
         //是否为多选
-        public bool IsMultiSelected { get { return (annotlists != null && annotlists.Count > 1); } }
+        public bool IsMultiSelected
+        { get { return (annotlists != null && annotlists.Count > 1); } }
+
         /// <summary>
         /// 更新多个属性,触发到工具栏注释工具,改变工具图标下的颜色值
         /// </summary>
@@ -235,6 +249,15 @@ namespace PDF_Office.ViewModels.Tools
         private bool isAddBookMark = true;
         private bool isRightMenuAddAnnot = false;
 
+        private PopMenu HightAnnotPopMenu;
+        private PopMenu FreeHandAnnotPopMenu;
+        private PopMenu FreeTextAnnotPopMenu;
+        private PopMenu StrickNoteAnnotPopMenu;
+        private PopMenu ShapeAnnotPopMenu;
+        private PopMenu LinkAnnotPopMenu;
+        private PopMenu StampAnnotPopMenu;
+        private PopMenu MultiAnnotPopMenu;
+
         #region 事件
 
         public DelegateCommand<CustomIconToggleBtn> MyToolsCommand { get; set; }
@@ -242,6 +265,33 @@ namespace PDF_Office.ViewModels.Tools
         private SnapshotEditMenuViewModel snapshotEditMenuViewModel = new SnapshotEditMenuViewModel();
         public SnapshotEditMenuViewModel SnapshotEditMenuViewModel { get => snapshotEditMenuViewModel; set => snapshotEditMenuViewModel = value; }
         public DelegateCommand<object> SetAddAnnotationCommand { get; set; }
+        public DelegateCommand AddBookMarkCommand { get; set; }
+
+        #region 注释 - 右键菜单
+        //公共
+        public DelegateCommand<object> AnnotDefaultValue_MenuCommand { get; set; }
+        public DelegateCommand<object> AnnotColorPalette_MenuCommand { get; set; }
+        public DelegateCommand<object> AnnotAddNoteText_MenuCommand { get; set; }
+        //高亮、下划线、删除
+        public DelegateCommand<object> HightAnnotCopyText_MenuCommand { get; set; }
+        
+        //手绘
+        public DelegateCommand<object> FreeHandLineStyle_MenuCommand { get; set; }
+
+        //文本
+        public DelegateCommand<object> FreeTextFontFamily_MenuCommand { get; set; }
+        public DelegateCommand<object> FreeTextAglin_MenuCommand { get; set; }
+
+        //便签
+        public DelegateCommand<object> StrikeNoteEditStrike_MenuCommand { get; set; }
+
+        //形状
+        public DelegateCommand<object> ShapeLineStyle_MenuCommand { get; set; }
+        public DelegateCommand<object> ShapeLineDirect_MenuCommand { get; set; }
+
+        //图章
+        public DelegateCommand<object> StampExportPicture_MenuCommand { get; set; }
+        #endregion 注释 - 右键菜单
 
         #endregion 事件
     }

+ 36 - 30
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -52,13 +52,48 @@ namespace PDF_Office.ViewModels.Tools
             BindingEvent();
             InitDefaultValue();
             InitToolDict();
+            InitPopMenu();
+        }
+
+        private void InitPopMenu()
+        {
+            InitSelectHightAnnotMenu();
+            InitSelectFreeHandAnnotMenu();
+            InitSelectFreeTextAnnotMenu();
+            InitSelectStrickNoteAnnotMenu();
+            InitSelectShapeAnnotMenu();
+            InitSelectLinkAnnotMenu();
+            InitSelectStampAnnotMenu();
+            InitSelectMultiAnnotMenu();
         }
 
         private void InitCommand()
         {
             MyToolsCommand = new DelegateCommand<CustomIconToggleBtn>(BtnMyTools_Click);
             SetAddAnnotationCommand = new DelegateCommand<object>(AddAnnotation_Click);
+            AddBookMarkCommand = new DelegateCommand(AddBookMark_Click);
             PropertyRegionName = Guid.NewGuid().ToString();
+
+            #region 注释 - 右键菜单
+            //公共command
+            AnnotDefaultValue_MenuCommand = new DelegateCommand<object>(AnnotDefaultValues_Menu);
+            AnnotColorPalette_MenuCommand = new DelegateCommand<object>(AnnotColorPalette_Menu);
+            AnnotAddNoteText_MenuCommand = new DelegateCommand<object>(AnnotAddNoteText_Menu);
+            //高亮、下划线、删除
+            HightAnnotCopyText_MenuCommand = new DelegateCommand<object>(HightAnnotCopyText_Menu);
+            //手绘
+            FreeHandLineStyle_MenuCommand = new DelegateCommand<object>(FreeHandLineStyle_Menu);
+            //文本
+            FreeTextFontFamily_MenuCommand = new DelegateCommand<object>(FreeTextFontFamily_Menu);
+            FreeTextAglin_MenuCommand = new DelegateCommand<object>(FreeTextAglin_Menu);
+            //便签
+            StrikeNoteEditStrike_MenuCommand = new DelegateCommand<object>(StrikeNoteEditStrike_Menu);
+            //形状
+            ShapeLineStyle_MenuCommand = new DelegateCommand<object>(ShapeLineStyle_Menu);
+            ShapeLineDirect_MenuCommand = new DelegateCommand<object>(ShapeLineDirect_Menu);
+            //图章
+            StampExportPicture_MenuCommand = new DelegateCommand<object>(StampExportPicture_Menu);
+            #endregion 注释 - 右键菜单
         }
 
         #endregion 初始化
@@ -408,34 +443,6 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        private void BookMark(MenuItem addBookMark, MenuItem delBookMark)
-        {
-            int index = PDFViewer.CurrentIndex;
-            //检测是否已存在相同数据
-            CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
-            if (list != null)
-            {
-                isAddBookMark = false;
-            }
-            else
-            {
-                isAddBookMark = true;
-            }
-
-            if (isAddBookMark)
-            {
-                addBookMark.Visibility = Visibility.Visible;
-                delBookMark.Visibility = Visibility.Collapsed;
-                addBookMark.Click += AddBookMark_Click;
-            }
-            else
-            {
-                delBookMark.Visibility = Visibility.Visible;
-                addBookMark.Visibility = Visibility.Collapsed;
-                delBookMark.Click += DelBookMark_Click;
-            }
-        }
-
         private void DelBookMark_Click(object sender, RoutedEventArgs e)
         {
             if (viewContentViewModel.OpenBOTA == false)
@@ -452,7 +459,6 @@ namespace PDF_Office.ViewModels.Tools
             int index = PDFViewer.CurrentIndex;
             //检测是否已存在相同数据
             CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
-
             if (bookmarkContentViewModel != null && bookmark != null && bOTAContent != null && list != null)
             {
                 bookmarkContentViewModel.DeleteCommand.Execute(list);
@@ -468,7 +474,7 @@ namespace PDF_Office.ViewModels.Tools
             //}
         }
 
-        private async void AddBookMark_Click(object sender, RoutedEventArgs e)
+        private void AddBookMark_Click()
         {
             if (viewContentViewModel.OpenBOTA == false)
             {

+ 29 - 20
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -106,7 +106,8 @@ namespace PDF_Office.ViewModels.Tools
         {
             DialogParameters value = new DialogParameters();
             value.Add(ParameterNames.PDFViewer, PDFViewer);
-            dialogs.ShowDialog(DialogNames.CompressDialog, value, e => {
+            dialogs.ShowDialog(DialogNames.CompressDialog, value, e =>
+            {
 
                 OnOpened((Prism.Services.Dialogs.DialogResult)e);
             });
@@ -114,9 +115,9 @@ namespace PDF_Office.ViewModels.Tools
 
         private int GetIndex(int pageindex)
         {
-            PageIndex = (pageindex+1).ToString();
+            PageIndex = (pageindex + 1).ToString();
             App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Visible;
-            if (PageIndex == PageNumber) { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed;}
+            if (PageIndex == PageNumber) { App.mainWindowViewModel.IsProcessVisible = System.Windows.Visibility.Collapsed; }
             return 0;
         }
         private void CompressClear()
@@ -131,8 +132,8 @@ namespace PDF_Office.ViewModels.Tools
             string filepath = "";
             string password = "";
             int compressquality = 45;
-           doc=e.Parameters.GetValue<CPDFDocument>(ParameterNames.PDFDocument);
-            filepath= e.Parameters.GetValue<string>(ParameterNames.FilePath);
+            doc = e.Parameters.GetValue<CPDFDocument>(ParameterNames.PDFDocument);
+            filepath = e.Parameters.GetValue<string>(ParameterNames.FilePath);
             password = e.Parameters.GetValue<string>(ParameterNames.PassWord);
             compressquality = e.Parameters.GetValue<int>("compressDialogModel.CompressQuality");
             if (doc != null)
@@ -160,28 +161,36 @@ namespace PDF_Office.ViewModels.Tools
 
         private void OpenSetPasswordDialog()
         {
-            PDFViewer.ReloadDocument();
-            bool a =  PDFViewer.Document.UnlockWithPassword("321");
-            VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(PDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs);
-            if (result.IsDiscryptied)
+            if (!viewContentViewModel.SecurityInfo.IsPasswordChanged)
             {
-                if (result.Password != null)
+                VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(PDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs);
+                if (result.IsDiscryptied)
                 {
-                    PDFViewer.ReloadDocument();
-                    PDFViewer.Document.UnlockWithPassword(result.Password);
+                    if (result.Password != null)
+                    {
+                        string filePath = PDFViewer.Document.FilePath;
+                        PDFViewer.Document.Release();
+                        PDFViewer.InitDocument(filePath);
+                        PDFViewer.Document.UnlockWithPassword(result.Password);
+                    }
                 }
-                DialogParameters value = new DialogParameters();
-                value.Add(ParameterNames.PDFViewer,  this.PDFViewer);
-                value.Add(ParameterNames.ViewContentViewModel, viewContentViewModel);
+            }
 
-                dialogs.ShowDialog(DialogNames.SetPasswordDialog, value, e =>
+            DialogParameters value = new DialogParameters();
+            value.Add(ParameterNames.PDFViewer, this.PDFViewer);
+            value.Add(ParameterNames.ViewContentViewModel, this.viewContentViewModel);
+            dialogs.ShowDialog(DialogNames.SetPasswordDialog, value, e =>
+            {
+                if (e.Result == ButtonResult.OK)
                 {
-                    if(e.Result == ButtonResult.OK)
+                    SecurityHelper.IsPasswordChanged = true;
+                    if (viewContentViewModel.SecurityInfo.IsPasswordChanged)
                     {
-                        this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusSetPasswordSuccessfully,  Unicode = unicode})  ;
+                        viewContentViewModel.PDFViewer.UndoManager.CanSave = true;
                     }
-                });
-            }
+                    this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusSetPasswordSuccessfully, Unicode = unicode });
+                }
+            });
         }
 
         private void OpenCancelPasswordDialog()

+ 36 - 12
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -3,32 +3,25 @@ using Prism.Commands;
 using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
 using System.Threading.Tasks;
 using ComPDFKitViewer.PdfViewer;
 using Prism.Regions;
-using DryIoc;
-using System.Diagnostics;
 using Prism.Services.Dialogs;
 using PDF_Office.CustomControl;
 using PDF_Office.Model;
 using System.Windows;
 using System.Windows.Controls;
 using System.IO;
-using PDFSettings;
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.ViewModels.Tools;
-using PDF_Office.Views;
 using Prism.Events;
 using PDF_Office.EventAggregators;
-using PDF_Office.Views.EditTools.Background;
-using PDF_Office.Views.Dialog;
 using PDF_Office.Helper;
-using System.Security.Policy;
-using System.Windows.Documents;
 using ComPDFKit.PDFDocument;
 using PDFSettings.Settings;
+using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
+using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.SetPasswordDialogModel;
+
 
 namespace PDF_Office.ViewModels
 {
@@ -78,10 +71,13 @@ namespace PDF_Office.ViewModels
         public string ReadModeRegionName { get; set; }
 
         public string ConverterBarContentRegionName { get; set; }
+
         public string TextEditContentRegionName { get; set; }
 
         public string BackgroundContentRegionName { get; set; }
 
+        public List<Point> FillAndSign = new List<Point>();
+
         /// <summary>
         /// 文档的密码
         /// </summary>
@@ -432,6 +428,8 @@ namespace PDF_Office.ViewModels
             }
         }
 
+        public SecurityInfo SecurityInfo = new SecurityInfo();
+
         private Dictionary<string, string> regionNameByTabItem;
 
         private Dictionary<string, string> barContentByTabItem;
@@ -618,7 +616,7 @@ namespace PDF_Office.ViewModels
                 region.RequestNavigate(LeftTipContentRegionName, "FileRestrictedTip", param);
             }
         }
-        public void ShowSelectedTip(ShowTipEventArgs showTipEventArgs)  
+        public void ShowSelectedTip(ShowTipEventArgs showTipEventArgs)
         {
             switch (showTipEventArgs.enumTipKind)
             {
@@ -998,7 +996,7 @@ namespace PDF_Office.ViewModels
             if (pdfview != null)
             {
                 PDFViewer = pdfview;
-                if(pdfview.Tag!=null)
+                if (pdfview.Tag != null)
                 {
                     //保存密码
                     PassWord = pdfview.Tag.ToString();
@@ -1150,6 +1148,32 @@ namespace PDF_Office.ViewModels
                         return false;
                 }
 
+                if (SecurityInfo.IsPasswordChanged)
+                {
+                    string currentFilePath = PDFViewer.Document.FilePath;
+                    string tempFilePath = PDFViewer.Document.FilePath + ".temp.pdf";
+                    string openPassword = null;
+                    string permissionsPassword = null;
+                    CPDFPermissionsInfo cPDFPermissionsInfo = CreateDefaultPermissionsInfo();
+                    if (SecurityInfo.NeedOpenPassword)
+                    {
+                        openPassword = SecurityInfo.OpenPassword;
+                    }
+
+                    if (SecurityInfo.NeedPermissionsPassword)
+                    {
+                        permissionsPassword = SecurityInfo.PermissionsPassword;
+                        cPDFPermissionsInfo = SecurityInfo.CPDFPermissionsInfo;
+                    }
+                    PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
+                    AlertsMessage alertsMessage = new AlertsMessage();
+                    alertsMessage.ShowDialog("", "文件安全设置已修改,需要另存为", "Cancel", "OK");
+                    if (alertsMessage.result == ContentResult.Ok)
+                        return saveAsFile();
+                    else
+                        return false;
+                }
+
                 bool result = PDFViewer.Document.WriteToLoadedPath();
                 if (result)
                 {

+ 6 - 7
PDF Office/Views/BOTA/AnnotationContent.xaml

@@ -62,7 +62,7 @@
                 x:Name="AnnotationList"
                 Grid.ColumnSpan="3"
                 HorizontalContentAlignment="Stretch"
-                Background="#F2F2F2"
+                Background="{StaticResource color.sys.layout.mg}"
                 BorderThickness="0"
                 ItemTemplate="{StaticResource AnnotationListItemTemplate}"
                 ItemsSource="{Binding AnnotationListItems}"
@@ -85,6 +85,7 @@
                     <GroupStyle>
                         <GroupStyle.ContainerStyle>
                             <Style TargetType="{x:Type GroupItem}">
+                                <Setter Property="Background" Value="{StaticResource color.sys.layout.mg}" />
                                 <Setter Property="Template">
                                     <Setter.Value>
                                         <ControlTemplate TargetType="{x:Type GroupItem}">
@@ -162,10 +163,7 @@
                 Grid.ColumnSpan="2"
                 VerticalAlignment="Center"
                 Visibility="{Binding IsEmptyPanelVisibility}">
-                <Image
-                    Width="140"
-                    Height="140"
-                    Source="pack://application:,,,/Resources/BOTA/empty_annotation.png" />
+                <Image Source="pack://application:,,,/Resources/BOTA/empty_annotation.png" />
                 <TextBlock
                     Name="txtEmpty"
                     Margin="0,12,0,0"
@@ -189,10 +187,11 @@
         <Grid Name="TopGrid" Grid.Row="0">
             <TextBlock
                 x:Name="Title"
-                Margin="12,0,0,0"
+                Margin="16,0,0,0"
                 VerticalAlignment="Center"
-                FontSize="18"
+                FontSize="14"
                 FontWeight="SemiBold"
+                Foreground="{StaticResource color.sys.text.neutral.lv1}"
                 Text="Markup"
                 TextAlignment="Left" />
             <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">

+ 17 - 11
PDF Office/Views/BOTA/AnnotationListItem.xaml

@@ -368,17 +368,23 @@
 
             <StackPanel Grid.Row="2">
                 <!--  附注  -->
-                <TextBlock
-                    Name="TxbContent"
-                    Margin="5"
-                    FontFamily="Segoe UI"
-                    FontSize="14"
-                    Foreground="#616469"
-                    Text="{Binding Content}"
-                    TextAlignment="Left"
-                    TextTrimming="CharacterEllipsis"
-                    TextWrapping="Wrap"
-                    Visibility="{Binding ElementName=TxbContent, Path=Text, Converter={StaticResource StringToVisibleConvert}}" />
+                <Border
+                    BorderBrush="{StaticResource color.sys.border.neutral.lv2}"
+                    BorderThickness="1"
+                    CornerRadius="4"
+                    Visibility="{Binding ElementName=TxbContent, Path=Text, Converter={StaticResource StringToVisibleConvert}}">
+                    <TextBlock
+                        Name="TxbContent"
+                        Margin="5"
+                        FontFamily="Segoe UI"
+                        FontSize="14"
+                        Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                        Text="{Binding Content}"
+                        TextAlignment="Left"
+                        TextTrimming="CharacterEllipsis"
+                        TextWrapping="Wrap"
+                        Visibility="{Binding ElementName=TxbContent, Path=Text, Converter={StaticResource StringToVisibleConvert}}" />
+                </Border>
                 <!--<TextBox
                 Name="TxTContent"
                 Margin="5"

+ 39 - 30
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -2,6 +2,7 @@
     x:Class="PDF_Office.Views.BOTA.BookmarkContent"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:CustomControl="clr-namespace:PDF_Office.CustomControl"
     xmlns:bota="clr-namespace:PDF_Office.ViewModels.BOTA"
     xmlns:convert="clr-namespace:PDF_Office.DataConvert"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -55,27 +56,29 @@
                                 </TransformGroup>
                             </Path.RenderTransform>
                         </Path>
-                        <TextBox
-                            Name="TxtTitleInput"
-                            Grid.Column="1"
-                            Padding="5"
-                            HorizontalContentAlignment="Left"
-                            Background="White"
-                            BorderThickness="1"
-                            FontSize="14"
-                            Text="{Binding Title}"
-                            TextWrapping="Wrap">
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="KeyDown">
-                                    <i:InvokeCommandAction Command="{Binding DataContext.KeyDownCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                        </TextBox>
+                        <Grid Grid.Column="1" Visibility="{Binding ElementName=TxbTitle, Path=Visibility, Mode=TwoWay, Converter={StaticResource UnVisivleConvert}}">
+                            <TextBox
+                                x:Name="TxtTitleInput"
+                                Padding="5"
+                                HorizontalContentAlignment="Left"
+                                Background="White"
+                                BorderThickness="1"
+                                FontSize="14"
+                                Style="{StaticResource TextBoxStyleRadius}"
+                                Text="{Binding Title}"
+                                TextWrapping="Wrap">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="KeyDown">
+                                        <i:InvokeCommandAction Command="{Binding DataContext.KeyDownCommand, RelativeSource={RelativeSource AncestorType={x:Type UserControl}}}" PassEventArgsToCommand="True" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </TextBox>
+                        </Grid>
                         <TextBlock
                             Name="TxbTitle"
                             Grid.Column="1"
                             Padding="5"
-                            Background="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=Background}"
+                            Background="Transparent"
                             FontSize="14"
                             Text="{Binding Title}"
                             Visibility="Visible" />
@@ -95,7 +98,7 @@
             </ContextMenu>
         </ResourceDictionary>
     </UserControl.Resources>
-    <Grid Background="#F2F2F2">
+    <Grid Background="{StaticResource color.sys.layout.mg}">
         <Grid.RowDefinitions>
             <RowDefinition Height="40" />
             <RowDefinition />
@@ -103,11 +106,12 @@
         <Grid MinWidth="190">
             <TextBlock
                 x:Name="TxtTitle"
-                Margin="12,0,0,0"
+                Margin="16,0,0,0"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
-                FontSize="18"
+                FontSize="14"
                 FontWeight="SemiBold"
+                Foreground="{StaticResource color.sys.text.neutral.lv1}"
                 Text="Bookmarks" />
             <Button
                 Name="BtnAddBookmark"
@@ -115,8 +119,7 @@
                 Height="40"
                 Margin="0,0,0,0"
                 HorizontalAlignment="Right"
-                Command="{Binding AddBookmarkCommand}"
-                CommandParameter="{Binding ElementName=BookMarkListView}"
+                Click="BtnAddBookmark_Click"
                 Style="{StaticResource PageEditToolBtn}">
                 <Path Data="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.25005 4.80003V7.25003H4.80005V8.75003H7.25005V11.2H8.75005V8.75003H11.2V7.25003H8.75005V4.80003H7.25005Z" Fill="#616469">
                     <Path.RenderTransform>
@@ -131,11 +134,10 @@
             <ListView
                 Name="BookMarkListView"
                 HorizontalContentAlignment="Stretch"
-                Background="#F2F2F2"
+                Background="{StaticResource color.sys.layout.mg}"
                 BorderThickness="0"
                 ItemTemplate="{StaticResource myDataTemplate}"
                 ItemsSource="{Binding Bookmarklist}"
-
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 VirtualizingPanel.CacheLength="1"
                 VirtualizingPanel.CacheLengthUnit="Page"
@@ -162,17 +164,24 @@
             Width="150"
             VerticalAlignment="Center"
             Visibility="{Binding IsEmptyPanelVisibility}">
-            <Image
-                Width="140"
-                Height="140"
-                Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />
+            <Image Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />
             <TextBlock
                 Name="txtEmpty"
                 Margin="0,12,0,0"
                 FontFamily="Segoe UI"
-                FontSize="16"
-                Text="No bookmark"
+                FontSize="14"
+                Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                Text="No bookmark found"
                 TextAlignment="Center" />
+            <TextBlock
+                Name="txtEmpty2"
+                Margin="0,12,0,0"
+                FontFamily="Segoe UI"
+                FontSize="14"
+                Foreground="{StaticResource color.sys.text.neutral.lv3}"
+                Text="Please right-click on the selected page and select Add Bookmark, or click the Add button on the upper right to create a bookmark."
+                TextAlignment="Center"
+                TextWrapping="Wrap" />
         </StackPanel>
     </Grid>
 </UserControl>

+ 94 - 5
PDF Office/Views/BOTA/BookmarkContent.xaml.cs

@@ -8,13 +8,16 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
+using System.Windows.Controls.Primitives;
 using System.Windows.Data;
 using System.Windows.Documents;
 using System.Windows.Input;
 using System.Windows.Media;
+using System.Windows.Media.Animation;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
+using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
 
 namespace PDF_Office.Views.BOTA
 {
@@ -29,7 +32,7 @@ namespace PDF_Office.Views.BOTA
         /// 上一个ListBoxItem,为选中状态做准备
         /// </summary>
         private ListBoxItem histotyListBoxItem = null;
-
+        private bool isAdd = false;
         public BookmarkContent()
         {
             InitializeComponent();
@@ -118,6 +121,7 @@ namespace PDF_Office.Views.BOTA
             {
                 textBox.Focus();
                 textBox.SelectAll();
+                listBoxItem.IsSelected = true;
             }));
         }
 
@@ -132,17 +136,47 @@ namespace PDF_Office.Views.BOTA
             if (listItem != null)
             {
                 viewModel.LostFocusCommand.Execute(listItem);
+
                 TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listItem);
-                TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listItem);
-                if (textBlock.Visibility == Visibility.Collapsed)
+                TextBox text = CommonHelper.FindVisualChild<TextBox>(listItem);
+
+                if (textBlock.Visibility != Visibility.Visible)
                 {
-                    listItem.IsSelected = false;
-                    textBlock.Visibility = Visibility.Visible;
+                    if (isAdd == false)
+                    {
+                        listItem.IsSelected = false;
+                    }
+                    else
+                    {
+                        isAdd = false;
+                    }
+                    if (text.IsSelectionActive == true)
+                    {
+                        textBlock.Visibility = Visibility.Visible;
+                    }
                 }
                 else
                 {
                     listItem.IsSelected = true;
                 }
+
+                //if (histotyListBoxItem != null)
+                //{
+                //    histotyListBoxItem.IsSelected = false;
+                //    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
+                //    textBlock.Visibility = Visibility.Visible;
+                //    textBlock.Focusable = true;
+                //}
+                //if (textBlock.Visibility == Visibility.Collapsed)
+                //{
+                //    listItem.IsSelected = false;
+                //    //textBlock.Visibility = Visibility.Visible;
+                //}
+                //else
+                //{
+                //    listItem.IsSelected = true;
+                //    //textBlock.Visibility = Visibility.Collapsed;
+                //}
             }
         }
 
@@ -240,5 +274,60 @@ namespace PDF_Office.Views.BOTA
                 }
             }
         }
+
+
+
+        private void BtnAddBookmark_Click(object sender, RoutedEventArgs e)
+        {
+            isAdd = true;
+            viewModel.AddBookmarkCommand.Execute(BookMarkListView);
+            BookMarkListView.ScrollIntoView(viewModel.addCPDFBookmark);
+            ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.addCPDFBookmark));
+            if (myListBoxItem == null)
+            {
+                BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
+                BookMarkListView.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
+            }
+            else
+            {
+                myListBoxItem.IsSelected = true;
+                myListBoxItem.Focus();
+
+                TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
+                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
+                textBlock.Visibility = Visibility.Collapsed;
+
+                textBox.Focus();
+                textBox.SelectAll();
+            }
+        }
+
+        private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
+        {
+            ItemContainerGenerator itemContainer = sender as ItemContainerGenerator;
+            if (itemContainer.Status == GeneratorStatus.ContainersGenerated)
+            {
+                BookMarkListView.ScrollIntoView(viewModel.addCPDFBookmark);
+                ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.addCPDFBookmark));
+                if (myListBoxItem != null)
+                {
+                    if (myListBoxItem.RenderSize.Width < 0 && myListBoxItem.RenderSize.Height < 0)
+                    {
+                        BookMarkListView.UpdateLayout();
+                        myListBoxItem.UpdateLayout();
+                        BookMarkListView.ScrollIntoView(viewModel.addCPDFBookmark);
+                    }
+                    myListBoxItem.IsSelected = true;
+                    myListBoxItem.Focus();
+
+                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
+                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
+                    textBlock.Visibility = Visibility.Collapsed;
+
+                    //textBox.Focus();
+                    textBox.SelectAll();
+                }
+            }
+        }
     }
 }

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 187 - 32
PDF Office/Views/BOTA/SearchContent.xaml


+ 55 - 4
PDF Office/Views/BOTA/SearchContent.xaml.cs

@@ -30,7 +30,8 @@ namespace PDF_Office.Views.BOTA
         {
             InitializeComponent();
         }
-
+        List<string> HistorySearchText = new List<string>();
+        const int MaxHistoryCount = 10;
         private void TextBox_KeyDown(object sender, KeyEventArgs e)
         {
             if (e.Key==Key.Enter)
@@ -41,6 +42,13 @@ namespace PDF_Office.Views.BOTA
                     return;
                 }
                 (DataContext as SearchContentViewModel).SearchText(text.Text);
+                 HistorySearchText.Remove(text.Text);
+                if (HistorySearchText.Count >= MaxHistoryCount)
+                {
+                    HistorySearchText.RemoveAt(0);
+                }
+                HistorySearchText.Add(text.Text);
+                UpDataItem();
             }
         }
 
@@ -49,9 +57,9 @@ namespace PDF_Office.Views.BOTA
         /// </summary>
         private void BtnExptend_Click(object sender, RoutedEventArgs e)
         {
-            var btn = sender as CustomIconToggleBtn;
+            var btn = sender as PathButton;
             if (btn == null) return;
-
+            btn.IsChecked = !btn.IsChecked;
 
             var item = (sender as FrameworkElement).DataContext as CollectionViewGroup;
             if (item != null)
@@ -99,9 +107,52 @@ namespace PDF_Office.Views.BOTA
             ContextSearchText.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
             ContextSearchText.IsOpen = true;
         }
+        private void UpDataItem()
+        {
+            foreach (var item in ContextSearchText.Items)
+            {
+                if (item is MenuItem)
+                {
+                    (item as MenuItem).Click -= SearchContent_Click;
+                }
+            }
+            ContextSearchText.Items.Clear();
+            ContextSearchText.Items.Add(IgnoreItem);
+            ContextSearchText.Items.Add(IgnoreSeparator);
+
+            foreach (var item in HistorySearchText)
+            {
+                MenuItem Searchitem = new MenuItem();
+                Searchitem.Height = 32;
+                Searchitem.Header = item;
+
+                Searchitem.Padding = new Thickness(0, 7, 0, 7);
+
+                Searchitem.Click += SearchContent_Click;
+                ContextSearchText.Items.Add(Searchitem);
+            }
+
+            if (HistorySearchText.Count>0)
+            {
+                ContextSearchText.Items.Add(ClearSeparator);
+                ContextSearchText.Items.Add(ClearItem);
+            }
+        }
+
+        private void SearchContent_Click(object sender, RoutedEventArgs e)
+        {
+            MenuItem item = sender as MenuItem;
+            if (item != null)
+            {
+                SearchText.Text = item.Header.ToString();
+                (DataContext as SearchContentViewModel).SearchText(SearchText.Text);
+            }
+        }
 
-        private void MenuItem_Click(object sender, RoutedEventArgs e)
+        private void ClearItem_Click(object sender, RoutedEventArgs e)
         {
+            HistorySearchText.Clear();
+            UpDataItem();
         }
     }
 }

+ 20 - 14
PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml

@@ -25,44 +25,50 @@
                     <ColumnDefinition Width="212"/>
                     <ColumnDefinition Width="*" />
                 </Grid.ColumnDefinitions>
-                <Grid Grid.Column="0">
+                <Grid Grid.Column="0" VerticalAlignment="Top">
                     <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" />
                 </Grid>
                 <Grid Grid.Column="1">
-                    <StackPanel Margin="18,16,0,0">
+                    <StackPanel Margin="16,2,0,0">
                         <TextBlock
-                                Width="60"
                                 Height="20"
+                                Style="{StaticResource PropertyHeaderLv2}"
+                            
                                 HorizontalAlignment="Left"
-                                Text="CSV设置:" />
-                        <StackPanel Margin="0,8,0,0">
+                                Text="CSV Workbook Settings" />
+                        <StackPanel Margin="0,10,0,0">
                             <RadioButton
                                 IsChecked="True"
                                 Name="ForEachPageRadioBtn"
+                               
+                                FontFamily="Segoe UI"
+                                Padding="9,0,0,0"
                                 Command="{Binding RadioButtonCommand}"
                                 CommandParameter="{Binding ElementName=ForEachPageRadioBtn, Path=Name}">
-                                <TextBlock Text="为每个表格创建工作表" />
+                                <TextBlock Text="Retain Flowing Text" />
                             </RadioButton>
                             <RadioButton
                                 
                                 Name="OnlyTableRadioBtn"
-                                Margin="0,6,0,0"
+                                Margin="0,8,0,0"
+                                Padding="9,0,0,0"
+                                FontFamily="Segoe UI"
                                 Command="{Binding RadioButtonCommand}"
                                 CommandParameter="{Binding ElementName=OnlyTableRadioBtn, Path=Name}">
-                                <TextBlock Text="为文档创建单个工作表" />
+                                <TextBlock Text="Retain Page Layout" />
                             </RadioButton>
                         </StackPanel>
-                        <StackPanel Margin="0,14,0,0" Orientation="Vertical">
+                        <StackPanel Margin="0,19,0,0" Orientation="Vertical">
                             <TextBlock
-                                Width="48"
                                 Height="20"
                                 HorizontalAlignment="Left"
-                                Text="页面范围" />
+                                Style="{StaticResource PropertyHeaderLv2}"
+                                Text="Page Range" />
                             <cus:WritableComboBox
                                 x:Name="PageRangeComboBox"
                                 Width="228"
                                 Height="32"
-                                Margin="0,4,0,0"
+                                Margin="0,10,0,0"
                                 HorizontalAlignment="Left"
                                 IsCurrentPage="True"
                                 MaxPageRange="{Binding MaxPageRange}"
@@ -85,11 +91,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}"  Style="{StaticResource btn.sec}">
+                <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}"  Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
-                </Button>
+                </Button>-->
                 <Button
                     Width="98"
                     Height="32"

+ 26 - 23
PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml

@@ -8,8 +8,8 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
              xmlns:prism="http://prismlibrary.com/"           
-             Width="529"
-             Height="482"
+             Width="586"
+             Height="498"
              d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
              d:DesignHeight="498"
              d:DesignWidth="586"
@@ -27,37 +27,40 @@
                     <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" VerticalAlignment="Top"></cus:PageTurningPreview>
                 </Grid>
                 <Grid Grid.Column="1">
-                    <StackPanel Orientation="Vertical" Margin="18,16,0,0">
+                    <StackPanel Orientation="Vertical" Margin="16,2,0,0">
                         <StackPanel Orientation="Vertical">
-                            <TextBlock Text="Excel工作簿设置:" Height="20"/>
-                            <StackPanel Orientation="Vertical" Margin="0,7,0,0">
-                                <RadioButton Name="AnyContentRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=AnyContentRadioBtn,Path=Name}" IsChecked="True">
-                                    <TextBlock Text="所有内容"/>
+                            <TextBlock Text="ExcelExcel Workbook Settings" Height="20"  Style="{StaticResource PropertyHeaderLv2}"/>
+                            <StackPanel Orientation="Vertical" Margin="0,10,0,0">
+                                <RadioButton Name="AnyContentRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=AnyContentRadioBtn,Path=Name}" IsChecked="True" Padding="9,0,0,0"
+                                FontFamily="Segoe UI">
+                                    <TextBlock Text="All contents"/>
                                 </RadioButton>
-                                <ComboBox Margin="0,8,0,0" Width="228" Height="28.55" IsEnabled="{Binding ElementName=AnyContentRadioBtn,Path=IsChecked}"  SelectedIndex="{Binding AnyContentSelectIndex}">
+                                <ComboBox Margin="0,8,0,0" Width="326" Height="32" HorizontalAlignment="Left" IsEnabled="{Binding ElementName=AnyContentRadioBtn,Path=IsChecked}"  SelectedIndex="{Binding AnyContentSelectIndex}" >
                                     <ComboBoxItem Content="为每个页面创建工作表 "/>
                                     <ComboBoxItem Content="为文档创建单个工作表"/>
                                 </ComboBox>
-                                <RadioButton Margin="0,10,0,0" Name="OnlyTableRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTableRadioBtn,Path=Name}">
-                                    <TextBlock Text="只提取表格"/>
+                                <RadioButton Margin="0,8,0,0" Name="OnlyTableRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTableRadioBtn,Path=Name}" Padding="9,0,0,0"
+                                FontFamily="Segoe UI">
+                                    <TextBlock Text="Only Tables"/>
                                 </RadioButton>
-                                <ComboBox Name="OnlyTableComboBox" Margin="0,8,0,0" Width="228" Height="28.55" IsEnabled="{Binding ElementName=OnlyTableRadioBtn,Path=IsChecked}"  SelectedIndex="{Binding OnlyTableSelectIndex}">
+                                <ComboBox Name="OnlyTableComboBox"  Margin="0,8,0,0" Width="326" Height="32" HorizontalAlignment="Left" IsEnabled="{Binding ElementName=OnlyTableRadioBtn,Path=IsChecked}"  SelectedIndex="{Binding OnlyTableSelectIndex}">
                                     <ComboBoxItem Content="支持一个表格提取到单独的工作表"/>
                                     <ComboBoxItem Content="支持按页面提取表格到单独的工作表"/>
                                     <ComboBoxItem Content="支持将所有表格提取到一个工作表"/>
                                 </ComboBox>
-                                <RadioButton Margin="0,10,0,0" Name="OnlyTextRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTextRadioBtn,Path=Name}">
-                                    <TextBlock Text="只提取文字"></TextBlock>
+                                <RadioButton Margin="0,8,0,0" Name="OnlyTextRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTextRadioBtn,Path=Name}" Padding="9,0,0,0"
+                                FontFamily="Segoe UI">
+                                    <TextBlock Text="Only Text"></TextBlock>
                                 </RadioButton>
                             </StackPanel>
                         </StackPanel>
-                        <StackPanel Orientation="Vertical"  Margin="0,16,0,0">
+                        <StackPanel Orientation="Vertical"  Margin="0,18,0,0">
                             <StackPanel Orientation="Vertical">
-                                <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
-                                <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}">
-                                    <TextBlock Text="在需要时识别文本"/>
+                                <TextBlock Text="Text Recognition Settings:" HorizontalAlignment="Left"  Height="20"  Style="{StaticResource PropertyHeaderLv2}"/>
+                                <CheckBox Name="OCRCheckBox"  Margin="0,10,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}" Padding="9,0,0,0">
+                                    <TextBlock Text="Recognize text if needed"/>
                                 </CheckBox>
-                                <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
+                                <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,8,0,0" Width="326" Height="32" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
                                     <ComboBoxItem Content="Chinese Simplified"/>
                                     <ComboBoxItem Content="Chinese Traditional"/>
                                     <ComboBoxItem Content="English"/>
@@ -65,9 +68,9 @@
                                     <ComboBoxItem Content="Korean"/>
                                 </ComboBox>
                             </StackPanel>
-                            <StackPanel Orientation="Vertical" Margin="0,14,0,0">
-                                <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
-                                <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
+                            <StackPanel Orientation="Vertical" Margin="0,18,0,0">
+                                <TextBlock Text="Page Range" Height="20"  HorizontalAlignment="Left"  Style="{StaticResource PropertyHeaderLv2}"/>
+                                <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,10,0,0" Width="326" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
                                     <i:Interaction.Triggers>
                                         <i:EventTrigger EventName="SelectionChanged">
                                             <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
@@ -85,11 +88,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
+                <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
-                </Button>
+                </Button>-->
                 <Button
                     Width="98"
                     Height="32"

+ 11 - 11
PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml

@@ -23,17 +23,17 @@
                     <ColumnDefinition Width="212"/>
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
-                <Grid Grid.Column="0">
+                <Grid Grid.Column="0" VerticalAlignment="Top">
                     <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
                 </Grid>
                 <Grid Grid.Column="1">
-                    <StackPanel Orientation="Vertical"  Margin="18,16,0,0">
+                    <StackPanel Orientation="Vertical"  Margin="16,2,0,0">
                         <StackPanel Orientation="Vertical">
-                            <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
-                            <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}">
-                                <TextBlock Text="在需要时识别文本"/>
+                            <TextBlock Text="Text Recognition Settings" HorizontalAlignment="Left"  Height="20"  Style="{StaticResource PropertyHeaderLv2}"/>
+                            <CheckBox Name="OCRCheckBox"  Margin="0,10,0,0" Padding="9,0,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}">
+                                <TextBlock Text="Recognize text if needed"/>
                             </CheckBox>
-                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
+                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,8,0,0" Width="228"  Height="32" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
                                 <ComboBoxItem Content="Chinese Simplified"/>
                                 <ComboBoxItem Content="Chinese Traditional"/>
                                 <ComboBoxItem Content="English"/>
@@ -41,9 +41,9 @@
                                 <ComboBoxItem Content="Korean"/>
                             </ComboBox>
                         </StackPanel>
-                        <StackPanel Orientation="Vertical" Margin="0,14,0,0">
-                            <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
-                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                        <StackPanel Orientation="Vertical" Margin="0,18,0,0" >
+                            <TextBlock Text="Page Range" Height="20"  Style="{StaticResource PropertyHeaderLv2}" HorizontalAlignment="Left"/>
+                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,10,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="SelectionChanged">
                                         <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
@@ -60,11 +60,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
+                <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
-                </Button>
+                </Button>-->
                 <Button
                     Width="98"
                     Height="32"

+ 9 - 9
PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml

@@ -25,22 +25,22 @@
                     <ColumnDefinition Width="212" />
                     <ColumnDefinition Width="*" />
                 </Grid.ColumnDefinitions>
-                <Grid Grid.Column="0">
+                <Grid Grid.Column="0" VerticalAlignment="Top">
                     <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" />
                 </Grid>
                 <Grid Grid.Column="1">
-                    <StackPanel Margin="18,16,0,0">
+                    <StackPanel Margin="16,2,0,0">
                         <StackPanel>
                             <TextBlock
-                                Width="48"
+                                Style="{StaticResource PropertyHeaderLv2}"
                                 Height="20"
                                 HorizontalAlignment="Left"
-                                Text="文件类型" />
+                                Text="File Type" />
                             <ComboBox
                                 Name="ImageTypeComboBox"
                                 Width="228"
                                 Height="32"
-                                Margin="0,8,0,0"
+                                Margin="0,10,0,0"
                                 HorizontalAlignment="Left"
                                 ItemsSource="{Binding ImageTypeFamily}"
                                 SelectedIndex="{Binding ImageTypeSelectedIndex, Mode=TwoWay}"
@@ -55,17 +55,17 @@
                                 SelectedIndex="{Binding ImageDPISelectedIndex, Mode=TwoWay}"
                                 />-->
                         </StackPanel>
-                        <StackPanel Margin="0,16,0,0">
+                        <StackPanel Margin="0,18,0,0">
                             <TextBlock
-                                Width="48"
+                                Style="{StaticResource PropertyHeaderLv2}"
                                 Height="20"
                                 HorizontalAlignment="Left"
-                                Text="页面范围" />
+                                Text="Page Range" />
                             <cus:WritableComboBox
                                 x:Name="PageRangeComboBox"
                                 Width="228"
                                 Height="32"
-                                Margin="0,4,0,0"
+                                Margin="0,10,0,0"
                                 HorizontalAlignment="Left"
                                 IsCurrentPage="True"
                                 MaxPageRange="{Binding MaxPageRange}"

+ 11 - 11
PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml

@@ -23,17 +23,17 @@
                     <ColumnDefinition Width="212"/>
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
-                <Grid Grid.Column="0">
+                <Grid Grid.Column="0" VerticalAlignment="Top">
                     <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
                 </Grid>
                 <Grid Grid.Column="1">
-                    <StackPanel Orientation="Vertical"  Margin="18,16,0,0">
+                    <StackPanel Orientation="Vertical"  Margin="16,2,0,0">
                         <StackPanel Orientation="Vertical">
-                            <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
-                            <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}" >
-                                <TextBlock Text="在需要时识别文本"/>
+                            <TextBlock Text="Text Recognition Settings" HorizontalAlignment="Left"  Style="{StaticResource PropertyHeaderLv2}" Height="20"/>
+                            <CheckBox Name="OCRCheckBox"  Margin="0,10,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}" >
+                                <TextBlock Text="Recognize text if needed"/>
                             </CheckBox>
-                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
+                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,8,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
                                 <ComboBoxItem Content="Chinese Simplified"/>
                                 <ComboBoxItem Content="Chinese Traditional"/>
                                 <ComboBoxItem Content="English"/>
@@ -41,9 +41,9 @@
                                 <ComboBoxItem Content="Korean"/>
                             </ComboBox>
                         </StackPanel>
-                        <StackPanel Orientation="Vertical" Margin="0,14,0,0">
-                            <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
-                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
+                        <StackPanel Orientation="Vertical" Margin="0,18,0,0">
+                            <TextBlock Text="Page Range" Height="20"  Style="{StaticResource PropertyHeaderLv2}" HorizontalAlignment="Left"/>
+                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,10,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="SelectionChanged">
                                         <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
@@ -60,11 +60,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
+                <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
-                </Button>
+                </Button>-->
                 <Button
                     Width="98"
                     Height="32"

+ 11 - 11
PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml

@@ -23,17 +23,17 @@
                     <ColumnDefinition Width="212"/>
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
-                <Grid Grid.Column="0" >
+                <Grid Grid.Column="0" VerticalAlignment="Top">
                     <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
                 </Grid>
                 <Grid Grid.Column="1">
-                    <StackPanel Orientation="Vertical"  Margin="18,16,0,0">
+                    <StackPanel Orientation="Vertical"  Margin="16,2,0,0">
                         <StackPanel Orientation="Vertical">
-                            <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
-                            <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}" >
-                                <TextBlock Text="在需要时识别文本"/>
+                            <TextBlock Text="Text Recognition Settings" HorizontalAlignment="Left"  Style="{StaticResource PropertyHeaderLv2}" Height="20"/>
+                            <CheckBox Name="OCRCheckBox"  Margin="0,10,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}" >
+                                <TextBlock Text="Recognize text if needed"/>
                             </CheckBox>
-                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
+                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,8,0,0" Width="228" Height="32" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
                                 <ComboBoxItem Content="Chinese Simplified"/>
                                 <ComboBoxItem Content="Chinese Traditional"/>
                                 <ComboBoxItem Content="English"/>
@@ -41,9 +41,9 @@
                                 <ComboBoxItem Content="Korean"/>
                             </ComboBox>
                         </StackPanel>
-                        <StackPanel Orientation="Vertical" Margin="0,14,0,0">
-                            <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
-                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
+                        <StackPanel Orientation="Vertical" Margin="0,18,0,0">
+                            <TextBlock Text="Page Range" Height="20"  Style="{StaticResource PropertyHeaderLv2}" HorizontalAlignment="Left"/>
+                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,10,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="SelectionChanged">
                                         <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
@@ -60,11 +60,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
+                <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
-                </Button>
+                </Button>-->
                 <Button
                     Width="98"
                     Height="32"

+ 11 - 11
PDF Office/Views/Dialog/ConverterDialogs/ConverterTextDialog.xaml

@@ -23,17 +23,17 @@
                     <ColumnDefinition Width="212"/>
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
-                <Grid Grid.Column="0">
+                <Grid Grid.Column="0" VerticalAlignment="Top">
                     <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
                 </Grid>
                 <Grid Grid.Column="1">
-                    <StackPanel Orientation="Vertical"  Margin="18,16,0,0">
+                    <StackPanel Orientation="Vertical"  Margin="16,2,0,0">
                         <StackPanel Orientation="Vertical">
-                            <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
-                            <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}">
-                                <TextBlock Text="在需要时识别文本"/>
+                            <TextBlock Text="Text Recognition Settings" HorizontalAlignment="Left"  Style="{StaticResource PropertyHeaderLv2}" Height="20"/>
+                            <CheckBox Name="OCRCheckBox"  Margin="0,10,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}">
+                                <TextBlock Text="Recognize text if needed"/>
                             </CheckBox>
-                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}" Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
+                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}" Margin="0,8,0,0" Width="228" Height="32" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
                                 <ComboBoxItem Content="Chinese Simplified"/>
                                 <ComboBoxItem Content="Chinese Traditional"/>
                                 <ComboBoxItem Content="English"/>
@@ -41,9 +41,9 @@
                                 <ComboBoxItem Content="Korean"/>
                             </ComboBox>
                         </StackPanel>
-                        <StackPanel Orientation="Vertical" Margin="0,14,0,0">
-                            <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
-                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
+                        <StackPanel Orientation="Vertical" Margin="0,18,0,0">
+                            <TextBlock Text="Page Range" Height="20"  Style="{StaticResource PropertyHeaderLv2}" HorizontalAlignment="Left"/>
+                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,10,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}" Loaded="PageRangeComboBox_Loaded">
                                 <i:Interaction.Triggers>
                                     <i:EventTrigger EventName="SelectionChanged">
                                         <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
@@ -60,11 +60,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
+                <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
-                </Button>
+                </Button>-->
                 <Button
                     Width="98"
                     Height="32"

+ 21 - 19
PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml

@@ -23,29 +23,31 @@
                     <ColumnDefinition Width="212"/>
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
-                <Grid Grid.Column="0" >
+                <Grid Grid.Column="0" VerticalAlignment="Top">
                     <cus:PageTurningPreview  x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"/>
                 </Grid>
                 <Grid Grid.Column="1">
-                    <StackPanel Orientation="Vertical" Margin="18,0,0,0">
-                        <StackPanel Orientation="Vertical" Margin="0,16,0,0" HorizontalAlignment="Left">
-                            <TextBlock Text="版面设置:" Width="60" Height="20" HorizontalAlignment="Left"/>
-                            <StackPanel Orientation="Horizontal" Margin="0,7,0,0">
-                                <RadioButton Name="FlowingTextRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=FlowingTextRadioBtn,Path=Name}" IsEnabled="False">
-                                    <TextBlock Text="保留流排文本"/>
+                    <StackPanel Orientation="Vertical" Margin="16,2,0,0">
+                        <StackPanel Orientation="Vertical" HorizontalAlignment="Left">
+                            <TextBlock Text="Layout Settings"  Style="{StaticResource PropertyHeaderLv2}" Height="20" HorizontalAlignment="Left"/>
+                            <StackPanel Orientation="Vertical" Margin="0,10,0,0">
+                                <RadioButton Name="FlowingTextRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=FlowingTextRadioBtn,Path=Name}" IsEnabled="False"  FontFamily="Segoe UI"
+                                Padding="9,0,0,0">
+                                    <TextBlock Text="Retain Flowing Text"/>
                                 </RadioButton>
-                                <RadioButton  Margin="15,0,0,0" Name="PageLayoutRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=PageLayoutRadioBtn,Path=Name}" IsChecked="True">
-                                    <TextBlock Text="保留页面布局"/>
+                                <RadioButton  Margin="0,8,0,0" Name="PageLayoutRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=PageLayoutRadioBtn,Path=Name}" IsChecked="True"  FontFamily="Segoe UI"
+                                Padding="9,0,0,0">
+                                    <TextBlock Text="Retain Page Layout"/>
                                 </RadioButton>
                             </StackPanel>
                         </StackPanel>
-                        <StackPanel Orientation="Vertical"  Margin="0,17,0,0">
+                        <StackPanel Orientation="Vertical"  Margin="0,18,0,0">
                             <StackPanel Orientation="Vertical">
-                                <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
-                                <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}">
-                                    <TextBlock Text="在需要时识别文本"/>
+                                <TextBlock Text="Text Recognition Settings" HorizontalAlignment="Left"  Style="{StaticResource PropertyHeaderLv2}" Height="20"/>
+                                <CheckBox Name="OCRCheckBox"  Margin="0,10,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}">
+                                    <TextBlock Text="Recognize text if needed"/>
                                 </CheckBox>
-                                <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
+                                <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,8,0,0" Width="228" Height="32" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
                                     <ComboBoxItem Content="Chinese Simplified"/>
                                     <ComboBoxItem Content="Chinese Traditional"/>
                                     <ComboBoxItem Content="English"/>
@@ -53,9 +55,9 @@
                                     <ComboBoxItem Content="Korean"/>
                                 </ComboBox>
                             </StackPanel>
-                            <StackPanel Orientation="Vertical" Margin="0,14,0,0">
-                                <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
-                                <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                            <StackPanel Orientation="Vertical" Margin="0,18,0,0">
+                                <TextBlock Text="Page Range" Height="20"  Style="{StaticResource PropertyHeaderLv2}" HorizontalAlignment="Left"/>
+                                <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,10,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}" MaxPageRange="{Binding MaxPageRange}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
                                     <i:Interaction.Triggers>
                                         <i:EventTrigger EventName="SelectionChanged">
                                             <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
@@ -73,11 +75,11 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
+                <!--<Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
-                </Button>
+                </Button>-->
                 <Button
                     Width="98"
                     Height="32"

+ 141 - 66
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml

@@ -14,6 +14,72 @@
              mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
+            <Style x:Key="HeadStyle" TargetType="{x:Type GridViewColumnHeader}">
+                <Setter Property="OverridesDefaultStyle" Value="False" />
+                <Setter Property="TextBlock.HorizontalAlignment" Value="Left"/>
+                <Setter Property="TextBlock.VerticalAlignment" Value="Center"/>
+                <Setter Property="Height" Value=" 32"/>
+                <Setter Property="Width" Value="Auto"/>
+                <Setter Property="TextBlock.FontFamily" Value="Segoe UI"></Setter>
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type GridViewColumnHeader}">
+                            <Grid Name="g" Background="#FFFFFF">
+                                <Border Name="bd" Padding="{TemplateBinding Padding}">
+                                    <ContentPresenter Margin="5,4,1,3" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
+                                </Border>
+                            </Grid>
+                            <ControlTemplate.Triggers>
+                                <Trigger Property="IsMouseOver" Value="True">
+                                    <Setter TargetName="g" Property="Background">
+                                        <Setter.Value>
+                                            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
+                                                <GradientStop Offset="0.3" Color="#CED0D4" />
+                                            </LinearGradientBrush>
+                                        </Setter.Value>
+                                    </Setter>
+                                </Trigger>
+
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+            <!--  ListViewItem的样式  -->
+            <Style x:Key="listitem1" TargetType="{x:Type ListViewItem}">
+                <Style.Setters>
+                    <Setter Property="SnapsToDevicePixels" Value="True" />
+                    <Setter Property="Template">
+                        <Setter.Value>
+                            <ControlTemplate TargetType="{x:Type ListViewItem}">
+                                <Border
+                                x:Name="bd"
+                                Padding="{TemplateBinding Padding}"
+                                SnapsToDevicePixels="True">
+                                    <GridViewRowPresenter
+                                    Margin="3"
+                                    Columns="{TemplateBinding GridView.ColumnCollection}"
+                                    Content="{TemplateBinding Content}" />
+                                </Border>
+                                <ControlTemplate.Triggers>
+                                    <Trigger Property="IsSelected" Value="True">
+                                        <Trigger.Setters>
+                                            <Setter TargetName="bd" Property="Background">
+                                                <Setter.Value>
+                                                    <LinearGradientBrush StartPoint="0.5,0.22" EndPoint="0.5,1">
+                                                        <GradientStop Offset="0.31" Color="LightGray" />
+                                                        <GradientStop Offset="0.88" Color="Gray" />
+                                                    </LinearGradientBrush>
+                                                </Setter.Value>
+                                            </Setter>
+                                        </Trigger.Setters>
+                                    </Trigger>
+                                </ControlTemplate.Triggers>
+                            </ControlTemplate>
+                        </Setter.Value>
+                    </Setter>
+                </Style.Setters>
+            </Style>
             <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
         </ResourceDictionary>
     </UserControl.Resources>
@@ -25,7 +91,7 @@
         </Grid.ColumnDefinitions>
         <Grid Grid.Column="0">
             <Grid.RowDefinitions>
-                <RowDefinition Height="482"/>
+                <RowDefinition Height="*"/>
                 <RowDefinition Height="72"/>
             </Grid.RowDefinitions>
             <Grid  Grid.Row="0" AllowDrop="True"
@@ -35,63 +101,68 @@
                   DragLeave="MainPage_DragLeave"
                   >
                 <!--<Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>-->
-            <Button Name="BtnBlank"  Background="Green" Height="400" Width="400" Visibility="{Binding AddFileVisibility}" Command="{Binding ADDPictureCommand}">
-            </Button>
-            <ListView x:Name="listView" DataContext="{Binding ImagesDataTable}"  Background="White"  ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}">
-                <ListView.ContextMenu>
-                    <ContextMenu  StaysOpen="True" >
-                        <MenuItem Header="打开文件" Name="OpenFileMenuItem"  Click="OpenFileMenuItem_Click"/>
-                        <MenuItem Header="移除" Name="RemoveFileMenuItem" Click="RemoveFileMenuItem_Click"/>
-                    </ContextMenu>
-                </ListView.ContextMenu>
-                <ListView.View>
-                    <GridView>
-                        <GridViewColumn  Header="文档名"  Width="400" DisplayMemberBinding="{Binding FileName}"/>
-                        <GridViewColumn Header="大小" Width="100" DisplayMemberBinding="{Binding FileSize}"/>
-                        <GridViewColumn Header="状态" Width="80" >
-                            <GridViewColumn.CellTemplate>
-                                <DataTemplate>
-                                    <StackPanel Orientation="Horizontal">
+                <Button Name="BtnBlank"  Background="Green" Height="480" Width="632" Visibility="{Binding AddFileVisibility}" Command="{Binding ADDPictureCommand}">
+                </Button>
+                <ListView x:Name="listView"  DataContext="{Binding ImagesDataTable}"   Background="White"   ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" BorderThickness="1,0,1,1" Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}">
+                    
+                    <ListView.ContextMenu>
+                        <ContextMenu  StaysOpen="True"  >
+                            <MenuItem Header="打开文件" Name="OpenFileMenuItem"  Click="OpenFileMenuItem_Click" />
+                            <MenuItem Header="移除" Name="RemoveFileMenuItem" Click="RemoveFileMenuItem_Click"/>
+                        </ContextMenu>
+                    </ListView.ContextMenu >
+                    <ListView.View >
+                        <GridView  ColumnHeaderContainerStyle="{StaticResource HeadStyle}">
+                            <GridViewColumn  Header="文档名"  Width="400" DisplayMemberBinding="{Binding FileName}">
+                            </GridViewColumn>
+                                <GridViewColumn Header="大小" Width="100" DisplayMemberBinding="{Binding FileSize}"/>
+                            <GridViewColumn Header="状态" Width="82" >
+                                <GridViewColumn.CellTemplate>
+                                    <DataTemplate>
+                                        <StackPanel Orientation="Horizontal">
                                             <cus:BatchStatus StatusValue="{Binding FileState,Mode=TwoWay}" Width="16" Height="16" MaxStatusValue="{Binding MaxPageRange,Mode=TwoWay}"/>
-                                            <Button Name="DeleteTemplateBtn" Width="14" Height="14" Content="X" Foreground="Red" FontSize="8" VerticalAlignment="Center" Margin="38,0,0,0" Click="DeleteTemplateBtn_Click">
-                                        </Button>
-                                    </StackPanel>
-                                    <DataTemplate.Triggers>
-                                        <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="True">
-                                            <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>
-                                        </DataTrigger>
-                                        <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="False">
-                                            <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Hidden"/>
-                                        </DataTrigger>
-                                    </DataTemplate.Triggers>
-                                </DataTemplate>
-                            </GridViewColumn.CellTemplate>
-                        </GridViewColumn>
-                    </GridView>
-                </ListView.View>
-                <ListView.ItemContainerStyle>
-                    <Style TargetType="ListViewItem">
-                        <Setter Property="Height" Value="42"/>
-                        <Style.Triggers>
-                            <Trigger Property="ListView.AlternationIndex" Value="1">
-                                <Setter Property="Background" Value="LightGray"/>
-                            </Trigger>
-                        </Style.Triggers>
-                    </Style>
-                </ListView.ItemContainerStyle>
-            </ListView>
+                                            <Button Name="DeleteTemplateBtn" Width="17" Height="17"  Margin="39,0,0,0" Click="DeleteTemplateBtn_Click" Style="{StaticResource btn.sec}">
+                                                <Grid Width="14" Height="14">
+                                                    <Path Data ="M7 14C10.866 14 14 10.866 14 7C14 3.13401 10.866 0 7 0C3.13401 0 0 3.13401 0 7C0 10.866 3.13401 14 7 14ZM10.5303 4.53038L8.06069 7L10.5303 9.46962L9.46967 10.5303L7.00002 8.06066L4.53033 10.5303L3.46967 9.46967L5.93936 7L3.46967 4.53033L4.53033 3.46967L7.00002 5.93934L9.46967 3.46971L10.5303 4.53038Z" Fill="#CED0D4" Stretch="Fill"/>
+                                                </Grid>
+                                            </Button>
+                                        </StackPanel>
+                                        <DataTemplate.Triggers>
+                                            <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="True">
+                                                <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>
+                                            </DataTrigger>
+                                            <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="False">
+                                                <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Hidden"/>
+                                            </DataTrigger>
+                                        </DataTemplate.Triggers>
+                                    </DataTemplate>
+                                </GridViewColumn.CellTemplate>
+                            </GridViewColumn>
+                        </GridView>
+                    </ListView.View>
+                    <ListView.ItemContainerStyle>
+                        <Style TargetType="ListViewItem">
+                            <Setter Property="Height" Value="42"/>
+                            <Style.Triggers>
+                                <Trigger Property="ListView.AlternationIndex" Value="1">
+                                    <Setter Property="Background" Value="LightGray"/>
+                                </Trigger>
+                            </Style.Triggers>
+                        </Style>
+                    </ListView.ItemContainerStyle>
+                </ListView>
             </Grid>
             <Grid Grid.Row="1">
                 <Button x:Name="MenuBtn"  Width="113"
-                    Height="40"
+                    Height="32"
                     Margin="25,0,0,0"
-                    HorizontalAlignment="Left" Click="Menu_Click">
+                    HorizontalAlignment="Left" Click="Menu_Click" Style="{StaticResource btn.sec}">
                     <StackPanel Orientation="Horizontal" >
                         <Border HorizontalAlignment="Right">
-                            <TextBlock Text="添加文件" FontSize="18" Foreground="Black"></TextBlock>
+                            <TextBlock Text="Add Files" FontSize="14" Foreground="Black" Width="57" Height="22" ></TextBlock>
                         </Border>
-                        <Border  Margin="12,0,0,0">
-                            <Path  VerticalAlignment="Center" HorizontalAlignment="Right" Stroke="Black"  Data="M0 0L8 4 L16 0" Height="10" Stretch="Fill" />
+                        <Border  Margin="12,0,0,0" Width="12" Height="7">
+                            <Path  VerticalAlignment="Center" HorizontalAlignment="Right" Fill="#94989C"  Data="M6 4.80726L1.26513 0L0 1.28448L5.36743 6.73398C5.71679 7.08868 6.28321 7.08868 6.63257 6.73398L12 1.28448L10.7349 0L6 4.80726Z"  Stretch="Fill" />
                         </Border>
                     </StackPanel>
                 </Button>
@@ -117,39 +188,43 @@
 
                 </Button>-->
                 <Button
-                    Width="40"
-                    Height="40"
+                    
+                    Width="32"
+                    Height="32"
                     Margin="25,0"
                     HorizontalAlignment="Right"
                     IsEnabled="{Binding RemoveIsEnable}"
-                    Command="{Binding RemovePictureFileCommand}">
-
+                    Command="{Binding RemovePictureFileCommand}"  Style="{StaticResource btn.sec}">
+                    <Grid  Width="16" Height="16">
+                        <Path   Fill="#616469"  Data="M6 1.75H10V0.25H6V1.75ZM1 4.25H2.25V15C2.25 15.4142 2.58579 15.75 3 15.75H13C13.4142 15.75 13.75 15.4142 13.75 15V4.25H15V2.75H1V4.25ZM3.75 14.25V4.25H12.25V14.25H3.75ZM7.25 6.5V11.5H8.75V6.5H7.25Z" />
+                    </Grid>
                 </Button>
             </Grid>
         </Grid>
         <Grid Grid.Column="1" Background="WhiteSmoke" IsEnabled="{Binding SetPictureToPDFGridIsEnabled}">
             <Grid.RowDefinitions>
                 <RowDefinition Height="1*"/>
-                <RowDefinition Height="2*"/>
-                <RowDefinition Height="72"/>
+                <RowDefinition Height="64"/>
             </Grid.RowDefinitions>
-            <Grid Grid.Row="0" Margin="15,23,0,0">
-                <StackPanel >
-                    <TextBlock Text="导出"/>
+            <Grid Grid.Row="0" Margin="16,14,0,0">
+                <StackPanel>
+                    <TextBlock Text="Setting" Style="{StaticResource PagesView_titleContext}"/>
+                    <TextBlock Text="Export" Height="20"  Style="{StaticResource PropertyHeaderLv2}" Margin="0,16,0,0"/>
+
                     <StackPanel Margin="0,8,0,0">
-                        <RadioButton Name="NewFilesRadioButtom" Click="RadioButton_Click" IsChecked="True">
+                        <RadioButton Name="NewFilesRadioButtom" Click="RadioButton_Click" IsChecked="True" Padding="9,0,0,0">
                             <TextBlock Text="新建文档"/>
                         </RadioButton>
-                        <RadioButton Name="OneNewFileNameRadioButtom" Margin="0,8,0,0" Click="RadioButton_Click">
+                        <RadioButton Name="OneNewFileNameRadioButtom" Margin="0,8,0,0" Click="RadioButton_Click" Padding="9,0,0,0">
                             <TextBlock Text="合并为同一份PDF文档"/>
                         </RadioButton>
-                        <RadioButton Name="SelectFileNameRadioButton" Margin="0,8,0,0" Click="RadioButton_Click">
+                        <RadioButton Name="SelectFileNameRadioButton" Margin="0,8,0,0" Click="RadioButton_Click" Padding="9,0,0,0">
                             <TextBlock Text="插入现有PDF文档"/>
                         </RadioButton>
                     </StackPanel>
                     <StackPanel Orientation="Horizontal" Margin="0,4,0,0">
                         <TextBox IsEnabled="False" Text="{Binding SelectFileName}" VerticalContentAlignment="Center" Height="32" Width="190"/>
-                        <Button Width="32" Command="{Binding SelectFileCommand}" IsEnabled="{Binding ElementName=SelectFileNameRadioButton,Path=IsChecked}">
+                        <Button Width="32" Command="{Binding SelectFileCommand}" IsEnabled="{Binding ElementName=SelectFileNameRadioButton,Path=IsChecked}" Style="{StaticResource btn.sec}">
 
                         </Button>
                     </StackPanel>
@@ -167,12 +242,12 @@
                     </CheckBox>
                 </StackPanel>
             </Grid>
-            <Grid Grid.Row="2">
-                <Button Height="40" Width="228" Background="Black" Command="{Binding ToPDFCommand}" IsEnabled="{Binding ImageToPDFBtnIsEnable}">
+            <Grid Grid.Row="1">
+                <Button Height="32" Width="228"  Command="{Binding ToPDFCommand}" IsEnabled="{Binding ImageToPDFBtnIsEnable}" Style="{StaticResource Btn.cta}">
                     <TextBlock Text="导出文档" FontSize="18" Foreground="White"/>
                 </Button>
             </Grid>
         </Grid>
     </Grid>
-       
+
 </UserControl>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 105 - 26
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialog.xaml


+ 58 - 6
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDocumentContent.xaml

@@ -3,8 +3,62 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:prism="http://prismlibrary.com/" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              prism:ViewModelLocator.AutoWireViewModel="True" >
+    <UserControl.Resources>
+        <Style TargetType="Button" x:Key="PrePageBtnStyle">
+            <Setter Property="Height" Value="24"></Setter>
+            <Setter Property="Width" Value="24"></Setter>
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type Button}">
+                        <Grid  x:Name="UserfulRegion">
+                            <Border BorderBrush="{StaticResource color.field.border.norm}" BorderThickness="1" CornerRadius="4" >
+                                <Grid>
+                                    <Rectangle Width="24" Height="24" Fill="Transparent"></Rectangle>
+                                    <Path x:Name="Path" Fill="{StaticResource color.icon.base.neutral.norm.lv1}" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M3.11071 4.24945L5.43035 1.9298L4.36969 0.869141L0.769719 4.46912C0.476825 4.76201 0.476826 5.23688 0.769719 5.52978L4.36969 9.12975L5.43035 8.06909L3.11071 5.74945H14.5V4.24945H3.11071Z"></Path>
+                                </Grid>
+                            </Border>
+                        </Grid>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+        <Style TargetType="Button" x:Key="NextPageBtnStyle">
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type Button}">
+                        <Grid  x:Name="UserfulRegion">
+                            <Border BorderBrush="{StaticResource color.field.border.norm}" BorderThickness="1" CornerRadius="4" >
+                                <Grid>
+                                    
+                                <Rectangle Width="24" Height="24" Fill="Transparent"></Rectangle>
+                                <Path x:Name="Path" Fill="{StaticResource color.icon.base.neutral.norm.lv1}" HorizontalAlignment="Center" VerticalAlignment="Center" Data="M11.8893 4.24992L0.5 4.24992V5.74992L11.8893 5.74992L9.56967 8.06958L10.6303 9.13024L14.2303 5.53026C14.5232 5.23737 14.5232 4.7625 14.2303 4.4696L10.6303 0.869629L9.56967 1.93029L11.8893 4.24992Z"></Path>
+                                </Grid>
+
+                            </Border>
+                        </Grid>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+        <Style TargetType="TextBox" x:Key="PageTxtStyle">
+            <Setter Property="Height" Value="24"></Setter>
+            <Setter Property="Width" Value="57"></Setter>
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="TextBox">
+                        <Border BorderBrush="{StaticResource color.field.border.norm}" BorderThickness="1" Background="{StaticResource color.field.bg.def}" CornerRadius="4">
+                                    <ScrollViewer x:Name="PART_ContentHost" Focusable="false"
+                                                  HorizontalScrollBarVisibility="Hidden" 
+                                                  VerticalScrollBarVisibility="Hidden"
+                                                  VerticalAlignment="Center" MinHeight="20"/>
+                            </Border>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+    </UserControl.Resources>
     <Grid  Height="356" Width="212">
-        <Border Height="356" Width="212"  Background="#F7F8FA" HorizontalAlignment="Center" VerticalAlignment="Top">
+        <Border Height="356" Width="212"  Background="{StaticResource color.sys.layout.mg}" HorizontalAlignment="Center" VerticalAlignment="Top" CornerRadius="8">
             <Grid>
                 <Grid.RowDefinitions>
                     <RowDefinition Height="52"></RowDefinition>
@@ -29,10 +83,9 @@
                 </Border>
                 <Grid Grid.Row="2">
                     <StackPanel Orientation="Horizontal"   HorizontalAlignment="Center" VerticalAlignment="Center">
-                        <Button Name="PrePageBtn"   Width="20" Height="20" HorizontalAlignment="Left" FontSize="16" Background="WhiteSmoke" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Command="{Binding TurnPageCommand}" CommandParameter="{Binding ElementName=PrePageBtn}">
-                            <TextBlock Text="&lt;" VerticalAlignment="Center"></TextBlock>
+                        <Button Name="PrePageBtn" Tag="PrePage" Style="{StaticResource PrePageBtnStyle}" Height="24" Width="24"  HorizontalAlignment="Left" FontSize="16" Background="WhiteSmoke" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Command="{Binding TurnPageCommand}" CommandParameter="{Binding ElementName=PrePageBtn}">
                         </Button>
-                        <TextBox x:Name="CurrentPageIndexTxt" Width="30" Height="25" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10,0,5,0" Text="{Binding TargetPaperIndex, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"  >
+                        <TextBox x:Name="CurrentPageIndexTxt" Style="{StaticResource PageTxtStyle}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="10,0,5,0" Text="{Binding TargetPaperIndex, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"  >
                             <i:Interaction.Triggers>
                                 <i:EventTrigger x:Name="PropertyChanged">
                                     <i:InvokeCommandAction Command="{Binding JumpPageCommand}" CommandParameter="{Binding ElementName=CurrentPageIndexTxt}"></i:InvokeCommandAction>
@@ -41,8 +94,7 @@
                         </TextBox>
                         <TextBlock  Text="of"  HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0" FontFamily="Segoe UI" FontSize="14"></TextBlock>
                         <TextBlock HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" Text="{Binding PrintedPageCount}"></TextBlock>
-                        <Button Name="NextPageBtn"  Width="20" Height="20" HorizontalAlignment="Left" FontSize="16"  Background="WhiteSmoke"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Command="{Binding TurnPageCommand}" CommandParameter="{Binding ElementName=NextPageBtn}">
-                            <TextBlock Text=">" VerticalAlignment="Center"></TextBlock>
+                        <Button Name="NextPageBtn"  Tag="NextPage" Style="{StaticResource NextPageBtnStyle}"  Height="24" Width="24"  HorizontalAlignment="Left" FontSize="16"  Background="WhiteSmoke"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Command="{Binding TurnPageCommand}" CommandParameter="{Binding ElementName=NextPageBtn}">
                         </Button>
                     </StackPanel>
                 </Grid>

+ 2 - 2
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModBookletContent.xaml

@@ -26,13 +26,13 @@
                 </StackPanel>
                 <StackPanel Grid.Row="1" Orientation="Horizontal">
                     <TextBlock Text="Sheets from:" FontFamily="Segoe UI" FontSize="14"  Width="94" Margin="0,0,16,0"   VerticalAlignment="Center" ></TextBlock>
-                    <TextBox Name="PaperFromTxt" Height="32" Width="50"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding PaperFrom,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
+                    <TextBox    Style="{StaticResource Print_normalTxtStyle}" Name="PaperFromTxt" Height="32" Width="50"  VerticalContentAlignment="Center" Text="{Binding PaperFrom,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
                         <TextBox.InputBindings>
                             <KeyBinding Command="{Binding SetSheetCommand}"  CommandParameter="{Binding ElementName=PaperFromTxt}"  Key="Return"></KeyBinding>
                         </TextBox.InputBindings>
                     </TextBox>
                     <TextBlock FontFamily="Segoe UI" FontSize="14" Text="to"  VerticalAlignment="Center" Margin="8,0,8,0" ></TextBlock>
-                    <TextBox Name="PaperToTxt" Height="32" Width="50"   HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Text="{Binding PaperTo,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
+                    <TextBox   Style="{StaticResource Print_normalTxtStyle}" Name="PaperToTxt" Height="32" Width="50"  VerticalContentAlignment="Center" Text="{Binding PaperTo,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
                         <TextBox.InputBindings>
                             <KeyBinding Command="{Binding SetSheetCommand}"  CommandParameter="{Binding ElementName=PaperToTxt}"  Key="Return"></KeyBinding>
                         </TextBox.InputBindings>

+ 3 - 3
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModMultipleContent.xaml

@@ -33,14 +33,14 @@
                         </i:Interaction.Triggers>
                     </ComboBox>
                     <StackPanel Grid.Row="0" Orientation="Horizontal" IsEnabled="{Binding EnableCustomiseMatrix,UpdateSourceTrigger=PropertyChanged, Mode=OneWay}">
-                        <TextBox Height="32" Width="53" Margin="16,0,8,0" Text="{Binding HorizontalPageNumber, UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
+                        <TextBox   Style="{StaticResource Print_normalTxtStyle}" VerticalContentAlignment="Center" Height="32" Width="53" Margin="16,0,8,0" Text="{Binding HorizontalPageNumber, UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}">
                             <TextBox.InputBindings>
                                 <KeyBinding  Command="{Binding SetCustomMatrixCommand}" Key="Return"></KeyBinding>
                             </TextBox.InputBindings>
 
                         </TextBox>
-                        <TextBlock Text="X" VerticalAlignment="Center"></TextBlock>
-                        <TextBox Height="32" Width="53"  Margin="8,0,0,0" Text="{Binding  VerticalPageNumber, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
+                        <TextBlock Text="X" VerticalAlignment="Center" Foreground="{StaticResource color.sys.text.neutral.lv3}"></TextBlock>
+                        <TextBox   Style="{StaticResource Print_normalTxtStyle}" VerticalContentAlignment="Center" Height="32" Width="53"  Margin="8,0,0,0" Text="{Binding  VerticalPageNumber, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
                             <TextBox.InputBindings>
                                 <KeyBinding  Command="{Binding SetCustomMatrixCommand}" Key="Return"></KeyBinding>
                             </TextBox.InputBindings>

+ 26 - 28
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterModPosterContent.xaml

@@ -8,6 +8,24 @@
              d:DesignHeight="180"
              d:DesignWidth="466"
              prism:ViewModelLocator.AutoWireViewModel="True">
+    <UserControl.Resources>
+        <Style x:Key="LabelTxtStyle" TargetType="TextBox">
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate>
+                        <Grid Height="{TemplateBinding Height}" Width="{TemplateBinding Width}">
+                            <Border BorderBrush="{StaticResource color.field.border.dis}" Background="{StaticResource color.field.bg.dis}" CornerRadius="4">
+                                <Grid>
+                                    <TextBlock Text="{Binding DefaultLabel, Mode=OneWay}" Grid.Column="1" VerticalAlignment="Center" Foreground="#BBB"
+                                           Name="markText" Visibility="Visible" FontSize="14" Margin="8,0,0,0" FontFamily="Segoe UI"/>
+                                </Grid>
+                            </Border>
+                        </Grid>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
+    </UserControl.Resources>
     <Border Background="#F7F8FA" CornerRadius="4"  Height="188">
         <Grid VerticalAlignment="Top">
             <Grid.RowDefinitions>
@@ -31,8 +49,8 @@
 
                 <StackPanel Orientation="Horizontal" Visibility="{Binding PageRangeSettingVisibility, Mode=TwoWay}" Margin="8,8,0,0">
                     <TextBlock Text="Page range:" VerticalAlignment="Center" FontSize="14" Width="80"></TextBlock>
-                    <cus:NumericUpDown x:Name="CustomRatioUpDown" Loaded="CustomRatioUpDown_Loaded" Width="90" Height="32" Margin="16,0,16,0" Text="{Binding TileRatio, Mode=TwoWay}" IsEnabled="{Binding ElementName=CustomRatioBtn, Path=IsChecked}" Minimum="20" Maximum="400"></cus:NumericUpDown>
-                    <TextBlock Text="%" VerticalAlignment="Center" FontSize="14"></TextBlock>
+                    <cus:NumericUpDown x:Name="CustomRatioUpDown" Loaded="CustomRatioUpDown_Loaded" Width="90" Height="32" Margin="16,0,16,0" Text="{Binding TileRatio, Mode=TwoWay}" IsEnabled="{Binding ElementName=CustomRatioBtn, Path=IsChecked}" Minimum="1" Maximum="400"></cus:NumericUpDown>
+                    <TextBlock Text="%" VerticalAlignment="Center" FontSize="14"  FontFamily="Segoe UI" Foreground="{StaticResource color.sys.text.neutral.lv3}"></TextBlock>
                 </StackPanel>
                 <StackPanel Orientation="Horizontal" Visibility="{Binding PagesPerSheetVisibility , Mode=TwoWay}"  Margin="8,8,0,0">
                     <TextBlock Text="Pages per sheet:" VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="14" ></TextBlock>
@@ -44,13 +62,13 @@
                         </i:Interaction.Triggers>
                     </ComboBox>
                     <StackPanel Orientation="Horizontal" IsEnabled="{Binding EnableCustomSheet, Mode=TwoWay}">
-                        <TextBox Height="32" Width="48" Text="{Binding HorizontalSheetNumber}">
+                        <TextBox  Style="{StaticResource Print_normalTxtStyle}" Height="32" Width="48" VerticalContentAlignment="Center" Text="{Binding HorizontalSheetNumber}">
                             <TextBox.InputBindings>
                                 <KeyBinding Command="{Binding SetCustomSheetCommand}" Key="Return"></KeyBinding>
                             </TextBox.InputBindings>
                         </TextBox>
-                        <TextBlock Text="x" VerticalAlignment="Center" Margin="8,0,8,0"></TextBlock>
-                        <TextBox  Height="32" Width="48" Text="{Binding VerticalSheetNumber}">
+                        <TextBlock  Text="x" VerticalAlignment="Center" Margin="8,0,8,0"></TextBlock>
+                        <TextBox  Style="{StaticResource Print_normalTxtStyle}" Height="32" Width="48" VerticalContentAlignment="Center" Text="{Binding VerticalSheetNumber}">
                             <TextBox.InputBindings>
                                 <KeyBinding Command="{Binding SetCustomSheetCommand}" Key="Return"></KeyBinding>
                             </TextBox.InputBindings>
@@ -61,12 +79,12 @@
             <Grid Grid.Row="2"  Margin="8,8,0,0">
                 <StackPanel Orientation="Horizontal" >
                     <TextBlock Text="Overlap:" VerticalAlignment="Center" FontSize="14" Width="80"></TextBlock>
-                    <TextBox Height="32" Width="88" Margin="16,0,16,0" Text="{Binding OverlapNumber,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
+                    <TextBox Style="{StaticResource Print_normalTxtStyle}" VerticalContentAlignment="Center" Height="32" Width="88" Margin="16,0,16,0" Text="{Binding OverlapNumber,UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}">
                         <TextBox.InputBindings>
                             <KeyBinding Command="{Binding SetOverlapCommand}" Key="Return"></KeyBinding>
                         </TextBox.InputBindings>
                     </TextBox>
-                    <TextBlock Text="mm" VerticalAlignment="Center" FontSize="14"></TextBlock>
+                    <TextBlock Text="mm" VerticalAlignment="Center" FontSize="14" FontFamily="Segoe UI" Foreground="{StaticResource color.sys.text.neutral.lv3}"></TextBlock>
                 </StackPanel>
             </Grid>
             <Grid Grid.Row="3"  Margin="8,8,0,0">
@@ -79,27 +97,7 @@
                 <StackPanel Orientation="Horizontal">
                     <CheckBox  Name="SetLabelChk" Margin="0,0,11,0" VerticalAlignment="Center" Command="{Binding SetLabelCommand}" CommandParameter="{Binding ElementName=SetLabelChk}"></CheckBox>
                     <TextBlock Text="Label" VerticalAlignment="Center" Margin="0,0,16,0" FontSize="14"></TextBlock>
-                    <TextBox Height="32" Width="361" Text="{Binding LabelString, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" IsEnabled="{Binding ElementName=SetLabelChk, Path=IsChecked}" IsReadOnly="True">
-                        <TextBox.Resources>
-                            <VisualBrush x:Key="HelpBrush" TileMode ="None" Opacity="0.3" Stretch="None" AlignmentX="Left">
-                                <VisualBrush.Visual>
-                                    <TextBlock Text="{Binding DefaultLabel, Mode=OneWay}"></TextBlock>
-                                </VisualBrush.Visual>
-                            </VisualBrush>
-                        </TextBox.Resources>
-                        <TextBox.Style>
-                            <Style TargetType="TextBox">
-                                <Style.Triggers>
-                                    <Trigger Property="Text" Value="{x:Null}">
-                                        <Setter Property="Background" Value="{StaticResource HelpBrush}"></Setter>
-                                    </Trigger>
-                                    <Trigger Property="Text" Value="">
-                                        <Setter Property="Background" Value="{StaticResource HelpBrush}"></Setter>
-                                    </Trigger>
-                                </Style.Triggers>
-                            </Style>
-                        </TextBox.Style>
-                    </TextBox>
+                    <TextBox Style="{StaticResource LabelTxtStyle}" Height="32" Width="361" Text="{Binding LabelString, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}" IsEnabled="{Binding ElementName=SetLabelChk, Path=IsChecked}" IsReadOnly="True"></TextBox>
                 </StackPanel>
             </Grid>
         </Grid>

+ 170 - 64
PDF Office/Views/Dialog/ToolsDialogs/MergeDialog.xaml

@@ -16,13 +16,68 @@
         <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
         <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
         <dataconvert:UnVisibleToBoolConvert x:Key="UnVisibleToBoolConvert"/>
+        <PathGeometry x:Key="Ic_ClearButtonPath" Figures="M6 1.75H10V0.25H6V1.75ZM1 4.25H2.25V15C2.25 15.4142 2.58579 15.75 3 15.75H13C13.4142 15.75 13.75 15.4142 13.75 15V4.25H15V2.75H1V4.25ZM3.75 14.25V4.25H12.25V14.25H3.75ZM7.25 6.5V11.5H8.75V6.5H7.25Z" />
+        <PathGeometry x:Key="Ic_DeleteButtonPath" Figures="M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.5303 5.53038L9.06069 8L11.5303 10.4696L10.4697 11.5303L8.00002 9.06066L5.53033 11.5303L4.46967 10.4697L6.93936 8L4.46967 5.53033L5.53033 4.46967L8.00002 6.93934L10.4697 4.46971L11.5303 5.53038Z" />
+        <SolidColorBrush x:Key="Item.MouseOver.Background" Color="#1F26A0DA"/>
+        <SolidColorBrush x:Key="Item.MouseOver.Border" Color="#a826A0Da"/>
+        <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3DDADADA"/>
+        <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FFDADADA"/>
+        <SolidColorBrush x:Key="Item.SelectedActive.Background" Color="#3D26A0DA"/>
+        <SolidColorBrush x:Key="Item.SelectedActive.Border" Color="#FF26A0DA"/>
+        <Style x:Key="ListViewItemStyle1" TargetType="{x:Type ListViewItem}">
+            <Setter Property="SnapsToDevicePixels" Value="True"/>
+            <Setter Property="Padding" Value="0,2,0,0"/>
+            <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
+            <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
+            <Setter Property="Background" Value="Transparent"/>
+            <Setter Property="BorderBrush" Value="Transparent"/>
+            <Setter Property="BorderThickness" Value="0"/>
+            <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}"/>
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type ListViewItem}">
+                        <Border Grid.Row="2" CornerRadius="8" x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
+                                <ContentPresenter  HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                            </Border>
+                            <ControlTemplate.Triggers>
+                            <MultiTrigger>
+                                <MultiTrigger.Conditions>
+                                    <Condition Property="IsMouseOver" Value="True"/>
+                                </MultiTrigger.Conditions>
+                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                            </MultiTrigger>
+                            <MultiTrigger>
+                                <MultiTrigger.Conditions>
+                                    <Condition Property="Selector.IsSelectionActive" Value="False"/>
+                                    <Condition Property="IsSelected" Value="True"/>
+                                </MultiTrigger.Conditions>
+                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}"/>
+                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}"/>
+                            </MultiTrigger>
+                            <MultiTrigger>
+                                <MultiTrigger.Conditions>
+                                    <Condition Property="Selector.IsSelectionActive" Value="True"/>
+                                    <Condition Property="IsSelected" Value="True"/>
+                                </MultiTrigger.Conditions>
+                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                            </MultiTrigger>
+                            <Trigger Property="IsEnabled" Value="False">
+                                <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
+                            </Trigger>
+                        </ControlTemplate.Triggers>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+        </Style>
     </UserControl.Resources>
     <Grid Background="{StaticResource color.sys.layout.anti}">
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="16"/>
-            <ColumnDefinition Width="558"/>
-            <ColumnDefinition Width="260"/>
+            <ColumnDefinition Width="526"/>
             <ColumnDefinition Width="16"/>
+            <ColumnDefinition Width="260"/>
         </Grid.ColumnDefinitions>
         <Grid.RowDefinitions>
             <RowDefinition Height="16"/>
@@ -33,6 +88,14 @@
             <RowDefinition Height="50"/>
             <RowDefinition Height="16"/>
         </Grid.RowDefinitions>
+
+        <Border Grid.Column="1" Grid.Row="1"  Grid.RowSpan="2" Padding="50,6,50,6" Visibility="{Binding Visibility, Converter={StaticResource UnVisivleConvert}, ElementName=NoFileStackPanel}">
+            <Grid>
+                <TextBlock Text="File Name" HorizontalAlignment="Left" FontFamily="Segoe UI" FontSize="12" FontWeight="Bold" Foreground="{StaticResource color.sys.text.neutral.lv1}"/>
+                <TextBlock Text="Page Range" HorizontalAlignment="Center" FontFamily="Segoe UI" FontSize="12" FontWeight="Bold" Foreground="{StaticResource color.sys.text.neutral.lv1}"/>
+                <TextBlock Text="Size" HorizontalAlignment="Right" FontFamily="Segoe UI" FontSize="12" FontWeight="Bold" Foreground="{StaticResource color.sys.text.neutral.lv1}"/>
+            </Grid>
+        </Border>
         <Border Grid.Column="1" Grid.Row="3">
             <Grid AllowDrop="True" Background="{StaticResource color.sys.layout.anti}"
                 PreviewDrop="Grid_Drop"
@@ -50,8 +113,10 @@
                     <TextBlock Text="Selected files" FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                     <TextBlock Text="Drop files here or Click Add Files at bottom right button. You can drag files to reorder as you need." FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" TextAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap"/>
                 </StackPanel>
-                <ListView x:Name="MergeView" AllowDrop="True" 
-                Visibility="{Binding ElementName=NoFileStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"          
+                    <ListView x:Name="MergeView" AllowDrop="True"
+                ItemContainerStyle="{StaticResource ListViewItemStyle1}"
+                BorderThickness="0"
+                Visibility="{Binding Visibility, Converter={StaticResource UnVisivleConvert}, ElementName=NoFileStackPanel}"          
                 Drop="MergeView_Drop"
                 DragEnter="MergeView_DragEnter"
                 DragOver="MergeView_DragOver"
@@ -60,107 +125,134 @@
                 ItemsSource="{Binding MergeObjectlist}"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 HorizontalContentAlignment="Stretch">
-                    <ListView.ItemTemplate>
-                        <DataTemplate  >
-                            <Grid x:Name="ContentPanel" >
-                                <Grid.ColumnDefinitions>
-                                    <ColumnDefinition Width="Auto"/>
-                                    <ColumnDefinition Width="*"/>
-                                    <ColumnDefinition Width="*"/>
-                                    <ColumnDefinition Width="*"/>
-                                    <ColumnDefinition Width="*"/>
-                                    <ColumnDefinition Width="*"/>
-                                </Grid.ColumnDefinitions>
-                                <TextBlock Text="{Binding RelativeSource={RelativeSource FindAncestor, 
-                                         AncestorType={x:Type ListViewItem}}, 
-                                         Converter={StaticResource IndexConverter}}"
-                                 VerticalAlignment="Center"  HorizontalAlignment="Center"/>
-                                <Image Grid.Column="1" Width="50" Height="50" HorizontalAlignment="Center" VerticalAlignment="Center" Source="{Binding DocThumbnail}"  Stretch="Uniform"  />
-                                <StackPanel Grid.Column="2" HorizontalAlignment="Center" VerticalAlignment="Center">
-                                    <TextBlock Text="{Binding DocName}" TextTrimming="CharacterEllipsis"/>
-                                    <TextBlock Text="{Binding DocPageCount}" />
-                                </StackPanel>
-                                <StackPanel Grid.Column="3" HorizontalAlignment="Center" VerticalAlignment="Center">
-                                    <customcontrol:WritableComboBox SelectedIndex="0" MaxPageRange="{Binding SDKPageCount}" Text="{Binding SetPageRange,Mode=TwoWay}"/>
-                                </StackPanel>
-                                <TextBlock Grid.Column="4" Text="{Binding DocSize}"  HorizontalAlignment="Center" VerticalAlignment="Center"/>
-                                <StackPanel Grid.Column="5" VerticalAlignment="Center">
-                                    <Button Content="删除" Click="Delete_Click"/>
-                                </StackPanel>
+                        <ListView.ItemTemplate>
+                            <DataTemplate  >
+                                <StackPanel>
+                                    <Line  X1="0"  X2="{Binding ActualWidth, ElementName=ContentPanel}" HorizontalAlignment="Stretch" StrokeThickness="1" Stroke="{StaticResource color.item-state.hov.bg}" VerticalAlignment="Bottom"/>
+                                    <Grid x:Name="ContentPanel" Height="76" >
+                                        <Grid.ColumnDefinitions>
+                                            <ColumnDefinition Width="40"/>
+                                            <ColumnDefinition Width="60"/>
+                                            <ColumnDefinition Width="141"/>
+                                            <ColumnDefinition Width="auto"/>
+                                            <ColumnDefinition Width="*"/>
+                                            <ColumnDefinition Width="16"/>
+                                            <ColumnDefinition Width="16"/>
+                                        </Grid.ColumnDefinitions>
+                                        <Line   Margin="0,0,0,0" Grid.ColumnSpan="6" Visibility="{Binding IsForward, Converter={StaticResource BoolToVisible}}" X1="0"  X2="{Binding ActualWidth, ElementName=ContentPanel}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" StrokeThickness="1" Stroke="{StaticResource color.sys.layout.accent}" />
 
-                                <StackPanel Grid.ColumnSpan="5" Visibility="{Binding IsForward, Converter={StaticResource BoolToVisible}}" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Bottom">
-                                    <Line  Margin="0,0,0,0" X1="0"  X2="{Binding ElementName=ContentPanel,Path=ActualWidth}" HorizontalAlignment="Stretch" StrokeThickness="1.5" Stroke="#FF0078D7" VerticalAlignment="Bottom"/>
-                                </StackPanel>
+                                        <Line Margin="0,0,0,0" Grid.ColumnSpan="6" Visibility="{Binding IsBackwards, Converter={StaticResource BoolToVisible}}"  X1="0"  X2="{Binding ActualWidth, ElementName=ContentPanel}" HorizontalAlignment="Stretch" VerticalAlignment="Top" StrokeThickness="1" Stroke="{StaticResource color.sys.layout.accent}" />
 
-                                <StackPanel Grid.ColumnSpan="5" Visibility="{Binding IsBackwards, Converter={StaticResource BoolToVisible}}" Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Top">
-                                    <Line  X1="0"  X2="{Binding ElementName=ContentPanel,Path=ActualWidth}" HorizontalAlignment="Stretch" StrokeThickness="1.5" Stroke="Red" VerticalAlignment="Bottom"/>
+                                        <TextBlock Text="{Binding Converter={StaticResource IndexConverter}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}}"
+                                 VerticalAlignment="Center"  HorizontalAlignment="Center"/>
+                                        <Image Margin="8" Grid.Column="1"  HorizontalAlignment="Stretch" VerticalAlignment="Center" Source="{Binding DocThumbnail}"  Stretch="Uniform"  />
+                                        <StackPanel Grid.Column="2" Margin="16,0,0,0" HorizontalAlignment="Stretch" VerticalAlignment="Center">
+                                            <TextBlock Text="{Binding DocName}" FontFamily="Segoe UI" FontSize="14" FontWeight="Regular" Foreground="{StaticResource color.sys.text.neutral.lv1}"  TextTrimming="CharacterEllipsis"/>
+                                            <TextBlock Text="{Binding DocPageCount}"  FontFamily="Segoe UI" FontSize="14" FontWeight="Regular" Foreground="{StaticResource color.sys.text.neutral.lv3}"/>
+                                        </StackPanel>
+                                        <StackPanel Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="16,0,0,0">
+                                            <customcontrol:WritableComboBox SelectedIndex="0" Width="150" Height="30" MaxPageRange="{Binding SDKPageCount}" Text="{Binding SetPageRange, Mode=TwoWay}"/>
+                                        </StackPanel>
+                                        <TextBlock Grid.Column="4" Text="{Binding DocSize}"  HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="16,0,0,0"/>
+                                        <StackPanel Grid.Column="5" VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="0,0">
+
+                                            <customcontrol:PathButton
+            Visibility="Collapsed"
+            HorizontalAlignment="Center"
+            VerticalAlignment="Center"
+            VerticalContentAlignment="Center"
+            x:Name="DeleteIcon"
+            Width="16" Height="16"
+           Click="Delete_Click"
+            Icon="{StaticResource Ic_DeleteButtonPath}" IconFill="#616469"
+            IconHeight="16" IconWidth="16"
+            IconMouseOver="{StaticResource Ic_DeleteButtonPath}" IconMouseOverFill="#616469"
+            IconPress="{StaticResource Ic_DeleteButtonPath}" IconPressFill="#616469"
+            CornerRadius="4"  HorizontalContentAlignment="Center"
+            MouseOverBackground="{StaticResource color.item-state.hov.bg}"
+            MouseDownBackground="{StaticResource color.item-state.sel.bg.lv3}"                          
+            MouseDownBorderBrush="{StaticResource color.item-state.sel.border.lv3}"
+                    />
+                                        </StackPanel>
+                                    </Grid>
                                 </StackPanel>
-                            </Grid>
+                            <DataTemplate.Triggers>
+                                <Trigger Property="IsMouseOver" Value="True">
+                                    <Setter TargetName="DeleteIcon" Property="Visibility" Value="Visible" />
+                                </Trigger>
+                            </DataTemplate.Triggers>
                         </DataTemplate>
-                    </ListView.ItemTemplate>
-                </ListView>
+                        </ListView.ItemTemplate>
+                    </ListView>
             </Grid>
         </Border>
-        <Border Grid.Column="2" Grid.Row="3">
+        <Border Grid.Column="3" Grid.RowSpan="7" Background="{StaticResource color.sys.layout.mg}">
             <Grid>
                 <Grid.RowDefinitions>
-                    <RowDefinition Height="20"/>
+                    <RowDefinition Height="14"/>
                     <RowDefinition Height="*"/>
+                    <RowDefinition Height="auto"/>
+                    <RowDefinition Height="16"/>
                 </Grid.RowDefinitions>
-                <TextBlock Text=" Page Size"/>
-                <StackPanel Grid.Row="1">
-                    <RadioButton Content="Original page size" Tag="0">
+                <Grid.ColumnDefinitions>
+                    <ColumnDefinition Width="16"/>
+                    <ColumnDefinition Width="*"/>
+                    <ColumnDefinition Width="16"/>
+                </Grid.ColumnDefinitions>
+                <StackPanel Grid.Row="1" Grid.Column="1">
+                    <TextBlock Text=" Page Size" VerticalAlignment="Center" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
+                    <RadioButton Content="Original page size" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" Tag="0" Margin="0,14,0,0">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
-                    <RadioButton Content="A4" Tag="1">
+                    <RadioButton Content="A4" Tag="1" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" Margin="0,8,0,0">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
-                    <RadioButton Content="A3" Tag="2">
+                    <RadioButton Content="A3" Tag="2" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" Margin="0,8,0,0">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
-                    <RadioButton Content="U.S.Letter" Tag="3">
+                    <RadioButton Content="U.S.Letter" Tag="3" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" Margin="0,8,0,0">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
-                    <RadioButton Content="U.S.Legal" Tag="4">
+                    <RadioButton Content="U.S.Legal" Tag="4" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" Margin="0,8,0,0">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
-                    <RadioButton x:Name="Customized" Content="Customized" Tag="5">
+                    <RadioButton x:Name="Customized" Content="Customized" Tag="5" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" Margin="0,8,0,0">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
-                    <Grid IsEnabled="{Binding ElementName=Customized, Path=IsChecked}">
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="*"/>
-                            <ColumnDefinition Width="20"/>
-                            <ColumnDefinition Width="*"/>
-                        </Grid.ColumnDefinitions>
-                        <customcontrol:TextBoxEx PreviewKeyDown="TextBoxEx_PreviewKeyDown" x:Name="TextWidth" PlaceholderText="595" Text="{Binding InputWidth,Mode=TwoWay}"  PreviewTextInput="TextBox_PreviewTextInput" LostFocus="TextBoxEx_LostFocus"/>
-                        <TextBlock Text="X" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center"/>
-                        <customcontrol:TextBoxEx PreviewKeyDown="TextBoxEx_PreviewKeyDown" x:Name="TextHeight" PlaceholderText="841" Grid.Column="2" Text="{Binding InputHeight,Mode=TwoWay}" PreviewTextInput="TextBox_PreviewTextInput" LostFocus="TextBoxEx_LostFocus"/>
-                    </Grid>
+                    <StackPanel IsEnabled="{Binding ElementName=Customized, Path=IsChecked}" Margin="0,8,0,0" Orientation="Horizontal" HorizontalAlignment="Stretch">
+                        <customcontrol:TextBoxEx Width="85" PreviewKeyDown="TextBoxEx_PreviewKeyDown" x:Name="TextWidth" PlaceholderText="595" Text="{Binding InputWidth,Mode=TwoWay}"  PreviewTextInput="TextBox_PreviewTextInput" LostFocus="TextBoxEx_LostFocus"/>
+                        <TextBlock Text="X" Grid.Column="1" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,0"/>
+                        <customcontrol:TextBoxEx Width="85" PreviewKeyDown="TextBoxEx_PreviewKeyDown" x:Name="TextHeight" PlaceholderText="841" Grid.Column="2" Text="{Binding InputHeight,Mode=TwoWay}" PreviewTextInput="TextBox_PreviewTextInput" LostFocus="TextBoxEx_LostFocus"/>
+                        <TextBlock Text="mm" VerticalAlignment="Center" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" Margin="8,0,0,0"/>
+                    </StackPanel>
+                </StackPanel>
+                <StackPanel Grid.Column="1" Grid.Row="2"  HorizontalAlignment="Center" VerticalAlignment="Bottom">
+                    <Button x:Name="BtnMerge" Width="228" Content="Merge"  Height="32" Style="{StaticResource Btn.cta}" Command="{Binding MergeCommand}" IsEnabled="{Binding ElementName=NoFileStackPanel,Path=Visibility,Converter={StaticResource UnVisibleToBoolConvert}}"/>
+                    <Button Margin="0,16,0,0" Width="228" Content="Cancel" Height="32" Style="{StaticResource btn.sec}" Command="{Binding CancelCommand}"/>
                 </StackPanel>
             </Grid>
         </Border>
@@ -201,10 +293,24 @@
 
             </ComboBoxItem>
         </ComboBox>
-        <Button Grid.Column="1" Grid.Row="5"  Content="Clear"  HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="80" Height="32" Style="{StaticResource btn.sec}" Command="{Binding ClearCommand}"/>
-        <StackPanel Grid.Column="2" Grid.RowSpan="2" Grid.Row="4"  HorizontalAlignment="Center" VerticalAlignment="Bottom">
-            <Button x:Name="BtnMerge" Content="Merge" Width="80" Height="32" Style="{StaticResource Btn.cta}" Command="{Binding MergeCommand}" IsEnabled="{Binding ElementName=NoFileStackPanel,Path=Visibility,Converter={StaticResource UnVisibleToBoolConvert}}"/>
-            <Button Content="Cancel" Width="80" Height="32" Style="{StaticResource btn.sec}" Command="{Binding CancelCommand}"/>
-        </StackPanel>
+        <Border BorderThickness="1" Width="32" Height="32" Grid.Column="1" Grid.Row="5" BorderBrush="{StaticResource color.btn.sec.border-color}" 
+            HorizontalAlignment="Right" VerticalAlignment="Bottom" CornerRadius="4">
+            <customcontrol:PathButton
+            HorizontalAlignment="Center"
+            VerticalAlignment="Center"
+            VerticalContentAlignment="Center"
+            x:Name="BtnAdd"
+            Width="32" Height="32"
+            Command="{Binding ClearCommand}"
+            Icon="{StaticResource Ic_ClearButtonPath}" IconFill="#616469"
+            IconHeight="16" IconWidth="16"
+            IconMouseOver="{StaticResource Ic_ClearButtonPath}" IconMouseOverFill="#616469"
+            IconPress="{StaticResource Ic_ClearButtonPath}" IconPressFill="#616469"
+            CornerRadius="4"  HorizontalContentAlignment="Center"
+            MouseOverBackground="{StaticResource color.item-state.hov.bg}"
+            MouseDownBackground="{StaticResource color.item-state.sel.bg.lv3}"                          
+            MouseDownBorderBrush="{StaticResource color.item-state.sel.border.lv3}"
+                    />
+        </Border>
     </Grid>
 </UserControl>

+ 4 - 3
PDF Office/Views/FillAndSign/PropertyPanel/ShapFillProperty.xaml

@@ -26,6 +26,7 @@
             <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert" />
             <DashConvert:DashStyleConverter x:Key="DashStyleConverter" />
             <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
+            <Convert:UnVisivleConvert x:Key="unVisibleConvert"/>
         </ResourceDictionary>
     </UserControl.Resources>
     <Grid Background="#F3F3F3">
@@ -40,6 +41,7 @@
                 LineHeight="24"
                 Text="{Binding AnnotTypeTitle}" />
             <Border
+                x:Name="shapeBarder"
                 Width="228"
                 Height="100"
                 Margin="0,8,0,0"
@@ -185,14 +187,13 @@
             </Grid>
 
             <Border
-                Visibility="Hidden"
                 Width="228"
                 Height="32"
                 Margin="0,12,0,0"
                 BorderBrush="#FFE2E3E6"
                 BorderThickness="1" 
-               
-                > <!--Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"-->
+               Visibility="{Binding ElementName=shapeBarder,Path=Visibility,Converter={StaticResource unVisibleConvert}}"
+                > 
                 <Grid Name="ToolGrid" >
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="40.5" />

+ 22 - 13
PDF Office/Views/PropertyPanel/AnnotPanel/LinkAnnotProperty.xaml

@@ -35,10 +35,10 @@
         <StackPanel Background="White" Orientation="Vertical">
             <TextBlock
                 Name="AnnotTypeTitle"
-                Margin="0,12,0,12"
+                Margin="16,14,0,16"
                 HorizontalAlignment="Left"
                 FontFamily="Segoe UI"
-                FontSize="18"
+                FontSize="14"
                 FontWeight="Bold"
                 LineHeight="24">
                 Link
@@ -57,7 +57,8 @@
                     GroupName="LinkTab"
                     IsChecked="{Binding BtnLinkPageIsChecked}"
                     Style="{StaticResource PageViewRadioBtn}"
-                    Tag="Page">
+                    Tag="Page"
+                    Visibility="Collapsed">
                     <StackPanel>
                         <Path
                             Margin="8,8,8,8"
@@ -94,7 +95,8 @@
                     GroupName="LinkTab"
                     IsChecked="{Binding BtnLinkWebIsChecked}"
                     Style="{StaticResource PageViewRadioBtn}"
-                    Tag="Web">
+                    Tag="Web"
+                    Visibility="Collapsed">
                     <StackPanel>
                         <Path
                             Margin="8,8,8,8"
@@ -136,7 +138,8 @@
                     GroupName="LinkTab"
                     IsChecked="{Binding BtnLinkMailIsChecked}"
                     Style="{StaticResource PageViewRadioBtn}"
-                    Tag="Mail">
+                    Tag="Mail"
+                    Visibility="Collapsed">
                     <StackPanel>
                         <Path
                             Margin="8,8,8,8"
@@ -163,14 +166,16 @@
             Y1="0"
             Y2="0" />-->
             <Grid MinWidth="260">
-                <StackPanel Name="LinkPagePanel" Visibility="{Binding ElementName=BtnLinkPage, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">
+                <!--<StackPanel Name="LinkPagePanel" Visibility="{Binding ElementName=BtnLinkPage, Path=IsChecked, Converter={StaticResource BoolToVisible}, Mode=OneWay}">-->
+                <StackPanel Name="LinkPagePanel">
                     <TextBlock
                         x:Name="TxtPage"
                         Height="20"
-                        Margin="16,12,0,4"
+                        Margin="16,0,0,4"
                         FontFamily="Segoe UI"
                         FontSize="12"
-                        Foreground="#616469"
+                        FontWeight="Bold"
+                        Foreground="{StaticResource color.sys.text.neutral.lv2}"
                         LineHeight="20"
                         Text="Page" />
                     <StackPanel Orientation="Horizontal">
@@ -195,15 +200,19 @@
                             </i:Interaction.Triggers>
                         </CustomControl:TextBoxWithTip>
                     </StackPanel>
-                    <Button
+                    <ToggleButton
                         Name="BtnLocation"
                         Width="228"
                         Height="32"
                         Margin="16,30,16,0"
+                        Background="Transparent"
+                        BorderBrush="Transparent"
+                        BorderThickness="0"
                         Command="{Binding LocationCommand}"
+                        IsChecked="{Binding BtnLocationIsChecked}"
                         IsEnabled="{Binding BtnLocationIsEnabled, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                        Style="{StaticResource btn.sec-icon}">
-                        <Button.Content>
+                        Style="{StaticResource LinkToolbarTgb}">
+                        <ToggleButton.Content>
                             <StackPanel Orientation="Horizontal">
                                 <Path
                                     Name="PathLocation"
@@ -213,8 +222,8 @@
                                     Fill=" #616469" />
                                 <TextBlock Margin="10,0" Text="定位目标区域" />
                             </StackPanel>
-                        </Button.Content>
-                    </Button>
+                        </ToggleButton.Content>
+                    </ToggleButton>
                     <Image
                         Name="ImagePreview"
                         Width="{Binding ImagePreviewWidth}"

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

@@ -201,7 +201,7 @@
                 </Grid>
             </Border>
 
-            <Grid x:Name="GridFill" Margin="0,18,0,0">
+            <Grid x:Name="GridFill" Margin="0,18,0,0" Visibility="{Binding IsLineAnnot,Converter={StaticResource InvertBoolToVisibleConvert}}">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="auto" />
                     <RowDefinition />

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 155 - 166
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml


+ 15 - 15
PDF Office/Views/TipContent/LinkAnnotTip.xaml

@@ -2,26 +2,24 @@
     x:Class="PDF_Office.Views.TipContent.LinkAnnotTip"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:TipContent="clr-namespace:PDF_Office.ViewModels.TipContent"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Office.Views.TipContent"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
-    prism:ViewModelLocator.AutoWireViewModel="True"
-    xmlns:TipContent="clr-namespace:PDF_Office.ViewModels.TipContent"
     d:DataContext="{d:DesignInstance Type=TipContent:LinkAnnotTipViewModel}"
-    d:DesignHeight="450"
-    d:DesignWidth="800"
+    d:DesignHeight="50"
+    d:DesignWidth="760"
+    prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
-    <Border
-        Name="LinkAnnotTip1"
-        Width="{Binding ElementName=PDFViewerContent, Path=Width}"
-        Margin="0,0,17,0"
-        HorizontalAlignment="Stretch"
-        VerticalAlignment="Top"
-        Background=" #BDDFFD"
-        Visibility="{Binding LinkAnnotTipVisibility}">
-        <WrapPanel Orientation="Horizontal">
+    <Border Margin="0,0,17,0" Background=" #BDDFFD">
+        <Grid>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="35" />
+                <ColumnDefinition Width="*" />
+            </Grid.ColumnDefinitions>
             <Grid
+                Grid.Column="0"
                 Width="16"
                 Height="16"
                 Margin="9,4">
@@ -34,11 +32,13 @@
 
             <TextBlock
                 x:Name="DrawTipsText"
+                Grid.Column="1"
                 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>
+                Text="Please use the scroll bar, thumbnail tool to locate the target page, click or box the area to select the target range"
+                TextWrapping="Wrap" />
+        </Grid>
     </Border>
 </UserControl>

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 67 - 43
PDF Office/Views/Tools/ConverterBarContent.xaml


+ 2 - 1
PDF Office/Views/ViewContent.xaml

@@ -301,7 +301,7 @@
                 </ColumnDefinition>
             </Grid.ColumnDefinitions>
 
-            <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" SizeChanged="ContentControl_SizeChanged"/>
+            <ContentControl prism:RegionManager.RegionName="{Binding BOTARegionName}" SizeChanged="ContentControl_SizeChanged" />
             <GridSplitter
                 Name="BOTASplitter"
                 Grid.Column="1"
@@ -371,6 +371,7 @@
             <ContentControl
                 Grid.Column="2"
                 VerticalAlignment="Top"
+                Width="{Binding ElementName=PDFViewerContent, Path=Width}"
                 prism:RegionManager.RegionName="{Binding TipContentRegionName}"
                 Visibility="{Binding TipVisible}" />
             <!--  阅读页顶部侧面提示区域  -->