Преглед изворни кода

Merge branch 'dev' into beta

# Conflicts:
#	PDF Office/Model/ParameterNames.cs
#	PDF Office/PDF Office.csproj
#	PDF Office/Properties/Settings.Designer.cs
#	PDF Office/Properties/Settings.settings
#	PDF Office/Styles/RadioButtonStyle.xaml
ZhouJieSheng пре 2 година
родитељ
комит
615a505662
100 измењених фајлова са 15337 додато и 553 уклоњено
  1. 1 1
      PDF Office/App.config
  2. 491 8
      PDF Office/App.xaml
  3. 87 8
      PDF Office/App.xaml.cs
  4. BIN
      PDF Office/ComDocumentAIKit.dll
  5. BIN
      PDF Office/ComPDFKit.Desk.dll
  6. 4740 0
      PDF Office/ComPDFKit.Desk.xml
  7. BIN
      PDF Office/ComPDFKit.Viewer.dll
  8. 4267 0
      PDF Office/ComPDFKit.Viewer.xml
  9. 3 3
      PDF Office/CustomControl/AlertsMessage.xaml
  10. 8 8
      PDF Office/CustomControl/AlertsMessage.xaml.cs
  11. 126 48
      PDF Office/CustomControl/ColorDropBoxPop.xaml
  12. 13 4
      PDF Office/CustomControl/CompositeControl/ColorContent.xaml
  13. 37 1
      PDF Office/CustomControl/CompositeControl/ColorContent.xaml.cs
  14. 3 0
      PDF Office/CustomControl/CompositeControl/ColorSubContent.xaml.cs
  15. 53 0
      PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml
  16. 280 0
      PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs
  17. 77 36
      PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml
  18. 52 36
      PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml.cs
  19. 1 12
      PDF Office/CustomControl/DialogContent.cs
  20. 10 2
      PDF Office/CustomControl/Form/FormFieldCombox.xaml.cs
  21. 222 0
      PDF Office/CustomControl/Form/LayoutAglinContent.xaml
  22. 79 0
      PDF Office/CustomControl/Form/LayoutAglinContent.xaml.cs
  23. 258 0
      PDF Office/CustomControl/ImageButton.cs
  24. 253 0
      PDF Office/CustomControl/ImageRadioButton .cs
  25. 3 3
      PDF Office/CustomControl/NumericUpDown.xaml
  26. 19 5
      PDF Office/CustomControl/NumericUpDown.xaml.cs
  27. 58 0
      PDF Office/CustomControl/PaginationControl.xaml
  28. 108 0
      PDF Office/CustomControl/PaginationControl.xaml.cs
  29. 2 2
      PDF Office/CustomControl/PathButton.cs
  30. 385 0
      PDF Office/CustomControl/PathRadioButton.cs
  31. 87 0
      PDF Office/CustomControl/ScanViewControl/CustomDraw.cs
  32. 223 0
      PDF Office/CustomControl/ScanViewControl/CustomPanel.cs
  33. 14 0
      PDF Office/CustomControl/TextBoxEx.cs
  34. 3 2
      PDF Office/CustomControl/TextBoxWithTip.xaml
  35. 1 1
      PDF Office/CustomControl/TextBoxWithTip.xaml.cs
  36. 11 9
      PDF Office/CustomControl/WritableComboBox.xaml
  37. 130 0
      PDF Office/CustomControl/WritableComboBox.xaml.cs
  38. 30 0
      PDF Office/DataConvert/CenterToolTipConverter .cs
  39. 35 0
      PDF Office/DataConvert/ColorBrushConvert.cs
  40. 27 0
      PDF Office/DataConvert/IndexConverter .cs
  41. 17 1
      PDF Office/DataConvert/InvertBoolConvert.cs
  42. 38 0
      PDF Office/DataConvert/ListCountToVisible.cs.cs
  43. 26 0
      PDF Office/EventAggregators/RedactionCommandEvent.cs
  44. 94 0
      PDF Office/EventAggregators/ScanEvent.cs
  45. 50 2
      PDF Office/EventAggregators/SendPrintInfoEvent.cs
  46. 39 0
      PDF Office/EventAggregators/SplitEvent.cs
  47. 51 2
      PDF Office/Helper/CacheFilePath.cs
  48. 110 2
      PDF Office/Helper/ConverterHelper.cs
  49. 1 1
      PDF Office/Helper/DpiHelpers.cs
  50. 62 0
      PDF Office/Helper/HomePageEditHelper.cs
  51. 645 0
      PDF Office/Helper/PageEditTool.cs
  52. 11 0
      PDF Office/Helper/UpdateAttributeHelper.cs
  53. 2 1
      PDF Office/Model/Dialog/ConverterDialogs/ConverterImgDialogModel.cs
  54. 1 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgModel.cs
  55. 87 33
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogModel.cs
  56. 26 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HtmlModel.cs
  57. 154 0
      PDF Office/Model/Dialog/ToolsDialogs/MergeObject.cs
  58. 106 85
      PDF Office/Model/DialogNames.cs
  59. 35 0
      PDF Office/Model/ParameterNames.cs
  60. 31 0
      PDF Office/Model/RegionNames.cs
  61. 460 22
      PDF Office/PDF Office.csproj
  62. 63 9
      PDF Office/Properties/Resources.Designer.cs
  63. 23 0
      PDF Office/Properties/Resources.resx
  64. 15 4
      PDF Office/Properties/Settings.Designer.cs
  65. 8 5
      PDF Office/Properties/Settings.settings
  66. BIN
      PDF Office/Resources/BOTA/no_outline.png
  67. BIN
      PDF Office/Resources/Dialog/AddImage.png
  68. BIN
      PDF Office/Resources/Dialog/AddImageSuspend.png
  69. BIN
      PDF Office/Resources/Dialog/help.png
  70. BIN
      PDF Office/Resources/PropertyPanel/EmptyAnnot.png
  71. BIN
      PDF Office/Resources/PropertyPanel/nosign.png
  72. BIN
      PDF Office/Resources/PropertyPanel/nostamp.png
  73. BIN
      PDF Office/Resources/ToolBarIcon/Scan/batch.png
  74. BIN
      PDF Office/Resources/ToolBarIcon/Scan/enhance.png
  75. BIN
      PDF Office/Resources/ToolBarIcon/Scan/ocr.png
  76. 4 5
      PDF Office/SDKLisence.xml
  77. 60 32
      PDF Office/Styles/ButtonStyle.xaml
  78. 5 5
      PDF Office/Styles/CheckBoxStyle.xaml
  79. 91 1
      PDF Office/Styles/ContextMenuStyle.xaml
  80. 97 12
      PDF Office/Styles/CustomBtnStyle.xaml
  81. 98 0
      PDF Office/Styles/ImageButtonStyle.xaml
  82. 116 0
      PDF Office/Styles/ImageRadioButtonDictionary.xaml
  83. 1 0
      PDF Office/Styles/OutLineItemStyle.xaml
  84. 7 0
      PDF Office/Styles/PathButtonStyle.xaml
  85. 137 0
      PDF Office/Styles/PathRadioButtonDictionary.xaml
  86. 106 27
      PDF Office/Styles/RadioButtonStyle.xaml
  87. 23 0
      PDF Office/Styles/SeparatorStyle.xaml
  88. 12 6
      PDF Office/Styles/TabControlStyle.xaml
  89. 49 0
      PDF Office/Styles/ToggleButton.xaml
  90. 13 4
      PDF Office/Styles/WindowsStyle.xaml
  91. 17 13
      PDF Office/Themes/Generic.xaml
  92. 1 1
      PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs
  93. 1 0
      PDF Office/ViewModels/BOTA/BOTAContentViewModel.cs
  94. 3 3
      PDF Office/ViewModels/BOTA/OutLineControlViewModel.cs
  95. 15 10
      PDF Office/ViewModels/BottomToolContentViewModel.cs
  96. 71 68
      PDF Office/ViewModels/Dialog/BOTA/ScreenAnnotationDialogViewModel.cs
  97. 24 9
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs
  98. 34 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs
  99. 0 0
      PDF Office/ViewModels/Dialog/CustomCreateDialogViewModel.cs
  100. 0 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/DynamicPropertyDialogViewModel.cs

+ 1 - 1
PDF Office/App.config

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <configuration>
     <configSections>
-        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
+        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
             <section name="PDF_Office.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
         </sectionGroup>
     </configSections>

+ 491 - 8
PDF Office/App.xaml

@@ -2,15 +2,19 @@
     x:Class="PDF_Office.App"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
     xmlns:local="clr-namespace:PDF_Office"
-    xmlns:prism="http://prismlibrary.com/">
+    xmlns:prism="http://prismlibrary.com/"
+    xmlns:sys="clr-namespace:System;assembly=mscorlib">
     <Application.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Alias_Light.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Themes/Global.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/TabControlStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/SeparatorStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ButtonStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ToggleButton.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/TextBoxStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ComboxStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ListBoxStyle.xaml" />
@@ -19,6 +23,9 @@
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContainerStyles/ComboxStyle/ComboxItemStyle.xaml" />
 
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathButtonStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ImageButtonStyle.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/PathRadioButtonDictionary.xaml" />
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ImageRadioButtonDictionary.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuTextEditStyle.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/ContextMenuStyle.xaml" />
                 <!--  Enable show customctrol's correctly UI in Xaml Designer  -->
@@ -123,7 +130,7 @@
                                         <Border
                                             x:Name="SubMenuBorder"
                                             Padding="2,2,2,2"
-                                            Background="#1D1D1D"
+                                            Background="{StaticResource color.sys.layout.mg}"
                                             BorderBrush="#999999"
                                             BorderThickness="0"
                                             CornerRadius="7">
@@ -224,7 +231,6 @@
             </Style>
 
             <!--  Design Token CheckBox  -->
-
             <Style TargetType="{x:Type CheckBox}">
                 <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                 <Setter Property="Background" Value="{StaticResource color.icon.checkbox-radio.norm.bg}" />
@@ -320,10 +326,10 @@
                                     </MultiTrigger.Setters>
                                 </MultiTrigger>
                                 <!--<Trigger Property="IsPressed" Value="true">
-                                    <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Pressed.Background}" />
-                                    <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Pressed.Border}" />
-                                    <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
-                                    <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
+                                <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Pressed.Background}" />
+                                <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Pressed.Border}" />
+                                <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
+                                <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
                                 </Trigger>-->
                                 <Trigger Property="IsChecked" Value="true">
                                     <Setter TargetName="optionMark" Property="Opacity" Value="1" />
@@ -341,6 +347,483 @@
                 </Setter>
             </Style>
 
+            <!--  Design Token ComboboxItem  -->
+            <Style TargetType="{x:Type ComboBoxItem}">
+                <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
+                <Setter Property="BorderThickness" Value="0" />
+                <Setter Property="Padding" Value="8,0" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type ComboBoxItem}">
+                            <Border
+                                Name="Bd"
+                                Padding="{TemplateBinding Control.Padding}"
+                                Background="{TemplateBinding Panel.Background}"
+                                BorderBrush="{TemplateBinding Border.BorderBrush}"
+                                BorderThickness="{TemplateBinding Border.BorderThickness}"
+                                CornerRadius="{StaticResource border-radius.4}"
+                                SnapsToDevicePixels="True">
+                                <ContentPresenter
+                                    HorizontalAlignment="{TemplateBinding Control.HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding Control.VerticalContentAlignment}"
+                                    Content="{TemplateBinding ContentControl.Content}"
+                                    ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}"
+                                    ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}"
+                                    SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
+                            </Border>
+                            <ControlTemplate.Triggers>
+                                <Trigger Property="UIElement.IsEnabled" Value="False">
+                                    <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
+                                </Trigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="False" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="True" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="False" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#A826A0DA" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="True" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="False" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#26A0DA" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="True" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="True" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A477EDE" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="True" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="False" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="False" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#DADADA" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="False" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="False" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#26A0DA" />
+                                </MultiTrigger>
+                                <MultiTrigger>
+                                    <MultiTrigger.Conditions>
+                                        <Condition Property="Selector.IsSelected" Value="False" />
+                                        <Condition Property="UIElement.IsMouseOver" Value="True" />
+                                        <Condition Property="UIElement.IsKeyboardFocused" Value="True" />
+                                    </MultiTrigger.Conditions>
+                                    <Setter TargetName="Bd" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
+                                    <Setter TargetName="Bd" Property="Border.BorderBrush" Value="#1A000000" />
+                                </MultiTrigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+
+            <Style x:Key="ComboBoxToggleButton" TargetType="{x:Type ToggleButton}">
+                <Setter Property="OverridesDefaultStyle" Value="true" />
+                <Setter Property="IsTabStop" Value="false" />
+                <Setter Property="Focusable" Value="false" />
+                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+                <Setter Property="ClickMode" Value="Press" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type ToggleButton}">
+                            <Border
+                                x:Name="templateRoot"
+                                Background="{TemplateBinding Background}"
+                                BorderBrush="{StaticResource color.field.border.norm}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                CornerRadius="{StaticResource border-radius.4}"
+                                SnapsToDevicePixels="true">
+                                <Border
+                                    x:Name="splitBorder"
+                                    Width="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}"
+                                    Margin="8,0"
+                                    HorizontalAlignment="Right"
+                                    BorderBrush="Transparent"
+                                    BorderThickness="0"
+                                    SnapsToDevicePixels="true">
+                                    <Path
+                                        x:Name="arrow"
+                                        Width="12"
+                                        Height="12"
+                                        Margin="0"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        Data="M6 7.56434L2.03039 3.59473L0.969727 4.65539L5.46967 9.15533C5.76256 9.44822 6.23743 9.44822 6.53033 9.15533L11.0303 4.65539L9.9696 3.59473L6 7.56434Z"
+                                        Fill="{StaticResource color.icon.arrow.gray.def}" />
+                                </Border>
+                            </Border>
+                            <ControlTemplate.Triggers>
+                                <MultiDataTrigger>
+                                    <MultiDataTrigger.Conditions>
+                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" />
+                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="false" />
+                                        <Condition Binding="{Binding IsPressed, RelativeSource={RelativeSource Self}}" Value="false" />
+                                        <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="true" />
+                                    </MultiDataTrigger.Conditions>
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
+                                </MultiDataTrigger>
+                                <Trigger Property="IsMouseOver" Value="true">
+                                    <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.accent.hov}" />
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
+                                </Trigger>
+                                <MultiDataTrigger>
+                                    <MultiDataTrigger.Conditions>
+                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
+                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="false" />
+                                    </MultiDataTrigger.Conditions>
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
+                                </MultiDataTrigger>
+                                <MultiDataTrigger>
+                                    <MultiDataTrigger.Conditions>
+                                        <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
+                                        <Condition Binding="{Binding IsEditable, RelativeSource={RelativeSource AncestorType={x:Type ComboBox}}}" Value="true" />
+                                    </MultiDataTrigger.Conditions>
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.hov}" />
+                                </MultiDataTrigger>
+                                <Trigger Property="IsPressed" Value="true">
+                                    <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.accent.hov}" />
+                                </Trigger>
+                                <Trigger Property="IsFocused" Value="True">
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
+                                    <Setter TargetName="templateRoot" Property="Effect" Value="{StaticResource shadow.blue-0-4}" />
+                                </Trigger>
+                                <Trigger Property="IsChecked" Value="True">
+                                    <Setter TargetName="arrow" Property="LayoutTransform">
+                                        <Setter.Value>
+                                            <RotateTransform Angle="180" />
+                                        </Setter.Value>
+                                    </Setter>
+                                </Trigger>
+                                <Trigger Property="IsEnabled" Value="false">
+                                    <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.gray.dis}" />
+                                    <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.field.bg.dis}" />
+                                    <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.dis}" />
+                                </Trigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+            <ControlTemplate x:Key="ComboBoxTemplate" TargetType="{x:Type ComboBox}">
+                <Grid
+                    x:Name="templateRoot"
+                    Background="Transparent"
+                    SnapsToDevicePixels="true">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="*" />
+                        <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
+                    </Grid.ColumnDefinitions>
+                    <Popup
+                        x:Name="PART_Popup"
+                        Grid.ColumnSpan="2"
+                        Margin="1"
+                        AllowsTransparency="true"
+                        IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
+                        Placement="Bottom"
+                        PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
+                        <Themes:SystemDropShadowChrome
+                            x:Name="shadow"
+                            MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
+                            MaxHeight="{TemplateBinding MaxDropDownHeight}"
+                            Color="Transparent">
+                            <Border
+                                x:Name="dropDownBorder"
+                                Margin="0,4,0,0"
+                                Background="{StaticResource color.sys.layout.anti}"
+                                BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
+                                BorderThickness="0"
+                                CornerRadius="{StaticResource radius.base.m}"
+                                Effect="{StaticResource shadow.neutral.m}">
+                                <ScrollViewer x:Name="DropDownScrollViewer">
+                                    <Grid HorizontalAlignment="Stretch" SnapsToDevicePixels="True">
+                                        <!--  圆角背景  -->
+                                        <Border
+                                            x:Name="Bd"
+                                            HorizontalAlignment="Stretch"
+                                            Background="{StaticResource color.sys.layout.anti}"
+                                            BorderThickness="1"
+                                            CornerRadius="7">
+                                            <!--  面板内容  -->
+                                            <StackPanel
+                                                Margin="4"
+                                                HorizontalAlignment="Stretch"
+                                                IsItemsHost="True"
+                                                KeyboardNavigation.DirectionalNavigation="Contained" />
+                                        </Border>
+                                    </Grid>
+                                </ScrollViewer>
+                            </Border>
+                        </Themes:SystemDropShadowChrome>
+                    </Popup>
+                    <ToggleButton
+                        x:Name="toggleButton"
+                        Grid.ColumnSpan="2"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
+                        Style="{StaticResource ComboBoxToggleButton}" />
+                    <ContentPresenter
+                        x:Name="contentPresenter"
+                        Margin="{TemplateBinding Padding}"
+                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                        Content="{TemplateBinding SelectionBoxItem}"
+                        ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
+                        ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
+                        ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
+                        IsHitTestVisible="false"
+                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                </Grid>
+                <ControlTemplate.Triggers>
+                    <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
+                        <Setter TargetName="shadow" Property="Margin" Value="5" />
+                    </Trigger>
+                    <Trigger Property="HasItems" Value="false">
+                        <Setter TargetName="dropDownBorder" Property="Height" Value="95" />
+                    </Trigger>
+                    <MultiTrigger>
+                        <MultiTrigger.Conditions>
+                            <Condition Property="IsGrouping" Value="true" />
+                            <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
+                        </MultiTrigger.Conditions>
+                        <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
+                    </MultiTrigger>
+                </ControlTemplate.Triggers>
+            </ControlTemplate>
+            <SolidColorBrush x:Key="TextBox.Static.Background" Color="#FFFFFFFF" />
+            <Style x:Key="ComboBoxEditableTextBox" TargetType="{x:Type TextBox}">
+                <Setter Property="OverridesDefaultStyle" Value="true" />
+                <Setter Property="AllowDrop" Value="true" />
+                <Setter Property="MinWidth" Value="0" />
+                <Setter Property="MinHeight" Value="0" />
+                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+                <Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst" />
+                <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type TextBox}">
+                            <ScrollViewer
+                                x:Name="PART_ContentHost"
+                                Background="Transparent"
+                                Focusable="false"
+                                HorizontalScrollBarVisibility="Hidden"
+                                VerticalScrollBarVisibility="Hidden" />
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
+            <ControlTemplate x:Key="ComboBoxEditableTemplate" TargetType="{x:Type ComboBox}">
+                <Grid x:Name="templateRoot" SnapsToDevicePixels="true">
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition Width="*" />
+                        <ColumnDefinition Width="0" MinWidth="{DynamicResource {x:Static SystemParameters.VerticalScrollBarWidthKey}}" />
+                    </Grid.ColumnDefinitions>
+                    <Popup
+                        x:Name="PART_Popup"
+                        Grid.ColumnSpan="2"
+                        AllowsTransparency="true"
+                        IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}"
+                        Placement="Bottom"
+                        PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
+                        <Themes:SystemDropShadowChrome
+                            x:Name="shadow"
+                            MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
+                            MaxHeight="{TemplateBinding MaxDropDownHeight}"
+                            Color="Transparent">
+                            <Border
+                                x:Name="dropDownBorder"
+                                Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"
+                                BorderBrush="{DynamicResource {x:Static SystemColors.WindowFrameBrushKey}}"
+                                BorderThickness="1">
+                                <ScrollViewer x:Name="DropDownScrollViewer">
+                                    <Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
+                                        <Canvas
+                                            x:Name="canvas"
+                                            Width="0"
+                                            Height="0"
+                                            HorizontalAlignment="Left"
+                                            VerticalAlignment="Top">
+                                            <Rectangle
+                                                x:Name="opaqueRect"
+                                                Width="{Binding ActualWidth, ElementName=dropDownBorder}"
+                                                Height="{Binding ActualHeight, ElementName=dropDownBorder}"
+                                                Fill="{Binding Background, ElementName=dropDownBorder}" />
+                                        </Canvas>
+                                        <ItemsPresenter
+                                            x:Name="ItemsPresenter"
+                                            KeyboardNavigation.DirectionalNavigation="Contained"
+                                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                                    </Grid>
+                                </ScrollViewer>
+                            </Border>
+                        </Themes:SystemDropShadowChrome>
+                    </Popup>
+                    <ToggleButton
+                        x:Name="toggleButton"
+                        Grid.ColumnSpan="2"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
+                        Style="{StaticResource ComboBoxToggleButton}" />
+                    <Border
+                        x:Name="border"
+                        Margin="{TemplateBinding BorderThickness}"
+                        Background="{StaticResource TextBox.Static.Background}">
+                        <TextBox
+                            x:Name="PART_EditableTextBox"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
+                            IsReadOnly="{Binding IsReadOnly, RelativeSource={RelativeSource TemplatedParent}}"
+                            Style="{StaticResource ComboBoxEditableTextBox}" />
+                    </Border>
+                </Grid>
+                <ControlTemplate.Triggers>
+                    <Trigger Property="IsEnabled" Value="false">
+                        <Setter TargetName="border" Property="Opacity" Value="0.56" />
+                    </Trigger>
+                    <Trigger Property="IsKeyboardFocusWithin" Value="true">
+                        <Setter Property="Foreground" Value="Black" />
+                    </Trigger>
+                    <Trigger SourceName="PART_Popup" Property="HasDropShadow" Value="true">
+                        <Setter TargetName="shadow" Property="Margin" Value="0,0,5,5" />
+                        <Setter TargetName="shadow" Property="Color" Value="#71000000" />
+                    </Trigger>
+                    <Trigger Property="HasItems" Value="false">
+                        <Setter TargetName="dropDownBorder" Property="Height" Value="95" />
+                    </Trigger>
+                    <MultiTrigger>
+                        <MultiTrigger.Conditions>
+                            <Condition Property="IsGrouping" Value="true" />
+                            <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
+                        </MultiTrigger.Conditions>
+                        <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
+                    </MultiTrigger>
+                    <Trigger SourceName="DropDownScrollViewer" Property="ScrollViewer.CanContentScroll" Value="false">
+                        <Setter TargetName="opaqueRect" Property="Canvas.Top" Value="{Binding VerticalOffset, ElementName=DropDownScrollViewer}" />
+                        <Setter TargetName="opaqueRect" Property="Canvas.Left" Value="{Binding HorizontalOffset, ElementName=DropDownScrollViewer}" />
+                    </Trigger>
+                </ControlTemplate.Triggers>
+            </ControlTemplate>
+            <!--  Design Token ComBobox  -->
+            <Style TargetType="{x:Type ComboBox}">
+                <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+                <Setter Property="Background" Value="{StaticResource color.field.bg.def}" />
+                <Setter Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
+                <Setter Property="Foreground" Value="{StaticResource color.field.text.act}" />
+                <Setter Property="BorderThickness" Value="{StaticResource border-width.1}" />
+                <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
+                <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
+                <Setter Property="VerticalContentAlignment" Value="Center" />
+                <Setter Property="Padding" Value="8,3,5,3" />
+                <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
+                <Setter Property="ScrollViewer.PanningMode" Value="Both" />
+                <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
+                <Setter Property="Template" Value="{StaticResource ComboBoxTemplate}" />
+                <Style.Triggers>
+                    <Trigger Property="IsEditable" Value="true">
+                        <Setter Property="IsTabStop" Value="false" />
+                        <Setter Property="Padding" Value="2" />
+                        <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
+                    </Trigger>
+                </Style.Triggers>
+            </Style>
+
+            <!--  Design Token RadionButton  -->
+            <Style TargetType="{x:Type RadioButton}">
+                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+                <Setter Property="Background" Value="{StaticResource color.icon.checkbox-radio.norm.bg}" />
+                <Setter Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.norm.border}" />
+                <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+                <Setter Property="BorderThickness" Value="1" />
+                <Setter Property="Padding" Value="8,0,0,0" />
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type RadioButton}">
+                            <Grid
+                                x:Name="templateRoot"
+                                Background="Transparent"
+                                SnapsToDevicePixels="True">
+                                <Grid.ColumnDefinitions>
+                                    <ColumnDefinition Width="Auto" />
+                                    <ColumnDefinition Width="*" />
+                                </Grid.ColumnDefinitions>
+                                <Border
+                                    x:Name="radioButtonBorder"
+                                    Width="14"
+                                    Height="14"
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Background="{TemplateBinding Background}"
+                                    BorderBrush="{TemplateBinding BorderBrush}"
+                                    BorderThickness="{TemplateBinding BorderThickness}"
+                                    CornerRadius="100">
+                                    <Grid x:Name="markGrid" Margin="1.8">
+                                        <Ellipse
+                                            x:Name="optionMark"
+                                            MinWidth="6"
+                                            MinHeight="6"
+                                            Fill="{StaticResource color.icon.checkbox-radio.sel.bg}"
+                                            Opacity="0" />
+                                    </Grid>
+                                </Border>
+                                <ContentPresenter
+                                    x:Name="contentPresenter"
+                                    Grid.Column="1"
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Focusable="False"
+                                    RecognizesAccessKey="True"
+                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                            </Grid>
+                            <ControlTemplate.Triggers>
+                                <!--<Trigger Property="HasContent" Value="true">
+                                <Setter Property="Padding" Value="4,-1,0,0" />
+                                </Trigger>-->
+                                <Trigger Property="IsMouseOver" Value="true">
+                                    <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
+                                </Trigger>
+                                <Trigger Property="IsEnabled" Value="false">
+                                    <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource color.icon.checkbox-radio.dis.bg}" />
+                                    <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.dis.border}" />
+                                    <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource color.icon.checkbox-radio.dis.fill}" />
+                                </Trigger>
+                                <!--<Trigger Property="IsPressed" Value="true">
+                                <Setter Property="Background" TargetName="radioButtonBorder" Value="{StaticResource RadioButton.Pressed.Background2}" />
+                                <Setter Property="BorderBrush" TargetName="radioButtonBorder" Value="{StaticResource RadioButton.Pressed.Border}" />
+                                <Setter Property="Fill" TargetName="optionMark" Value="{StaticResource RadioButton.Pressed.Glyph2}" />
+                                </Trigger>-->
+                                <Trigger Property="IsChecked" Value="true">
+                                    <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                                    <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource color.icon.checkbox-radio.hov.border}" />
+                                </Trigger>
+                                <Trigger Property="IsChecked" Value="{x:Null}">
+                                    <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
+                                </Trigger>
+                            </ControlTemplate.Triggers>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
         </ResourceDictionary>
     </Application.Resources>
-</prism:PrismApplication>
+</prism:PrismApplication>

Разлика између датотеке није приказан због своје велике величине
+ 87 - 8
PDF Office/App.xaml.cs


BIN
PDF Office/ComDocumentAIKit.dll


BIN
PDF Office/ComPDFKit.Desk.dll


Разлика између датотеке није приказан због своје велике величине
+ 4740 - 0
PDF Office/ComPDFKit.Desk.xml


BIN
PDF Office/ComPDFKit.Viewer.dll


Разлика између датотеке није приказан због своје велике величине
+ 4267 - 0
PDF Office/ComPDFKit.Viewer.xml


+ 3 - 3
PDF Office/CustomControl/AlertsMessage.xaml

@@ -18,9 +18,9 @@
     <Border
         Height="auto"
         Background="White"
+        BorderBrush="Gray"
         BorderThickness="1"
         CornerRadius="6"
-        BorderBrush="Gray"
         MouseLeftButtonDown="Border_PreviewMouseLeftButtonDown">
         <Grid Margin="20,24,20,0">
             <Grid.RowDefinitions>
@@ -60,7 +60,7 @@
                 </Grid.ColumnDefinitions>
                 <Button
                     x:Name="CancelBtn"
-                    Grid.Column="0"
+                    Grid.Column="2"
                     Height="28"
                     Margin="0,0,0,0"
                     BorderThickness="0"
@@ -80,7 +80,7 @@
                     FontWeight="SemiBold" />
                 <Button
                     x:Name="OkBtn"
-                    Grid.Column="2"
+                    Grid.Column="0"
                     Height="28"
                     Margin="8,0,0,0"
                     BorderThickness="0"

+ 8 - 8
PDF Office/CustomControl/AlertsMessage.xaml.cs

@@ -77,8 +77,8 @@ namespace PDF_Office.CustomControl
             OkBtn.Content = okBtn;
             Width = 408;
 
-            Grid.SetColumn(MiddleCancelBtn, 0);
-            Grid.SetColumn(OkBtn, 1);
+            Grid.SetColumn(MiddleCancelBtn, 1);
+            Grid.SetColumn(OkBtn, 0);
 
             BtnGrid.ColumnDefinitions.Clear();
             var column = new ColumnDefinition();
@@ -103,9 +103,9 @@ namespace PDF_Office.CustomControl
             MiddleCancelBtn.Content = cancelBtn2;
             OkBtn.Content = okBtn;
 
-            Grid.SetColumn(CancelBtn, 0);
+            Grid.SetColumn(CancelBtn, 2);
             Grid.SetColumn(MiddleCancelBtn, 1);
-            Grid.SetColumn(OkBtn, 2);
+            Grid.SetColumn(OkBtn, 0);
 
             BtnGrid.ColumnDefinitions.Clear();
             var column = new ColumnDefinition();
@@ -161,8 +161,8 @@ namespace PDF_Office.CustomControl
             OkBtn.Content = okBtn;
             Width = 408;
 
-            Grid.SetColumn(MiddleCancelBtn, 0);
-            Grid.SetColumn(OkBtn, 1);
+            Grid.SetColumn(MiddleCancelBtn, 1);
+            Grid.SetColumn(OkBtn, 0);
 
             BtnGrid.ColumnDefinitions.Clear();
             var column = new ColumnDefinition();
@@ -191,9 +191,9 @@ namespace PDF_Office.CustomControl
             MiddleCancelBtn.Content = cancelBtn2;
             OkBtn.Content = okBtn;
 
-            Grid.SetColumn(CancelBtn, 0);
+            Grid.SetColumn(CancelBtn, 2);
             Grid.SetColumn(MiddleCancelBtn, 1);
-            Grid.SetColumn(OkBtn, 2);
+            Grid.SetColumn(OkBtn, 0);
 
             BtnGrid.ColumnDefinitions.Clear();
             var column = new ColumnDefinition();

+ 126 - 48
PDF Office/CustomControl/ColorDropBoxPop.xaml

@@ -1,88 +1,146 @@
-<UserControl x:Class="PDF_Office.CustomControl.ColorDropBoxPop"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:PDF_Office.CustomControl"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800" Width="194" Height="auto">
+<UserControl
+    x:Class="PDF_Office.CustomControl.ColorDropBoxPop"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    Width="194"
+    Height="auto"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    mc:Ignorable="d">
     <UserControl.Resources>
-        <local:ColorToBrushConverter x:Key="ColorToBrushConverter"></local:ColorToBrushConverter>
+        <local:ColorToBrushConverter x:Key="ColorToBrushConverter" />
         <Style TargetType="ListViewItem">
-            <Setter Property="Width" Value="15" ></Setter>
-            <Setter Property="Height" Value="15" ></Setter>
-            <Setter Property="Padding" Value="0"></Setter>
-            <Setter Property="BorderThickness" Value="1"></Setter>
-            <Setter Property="BorderBrush" Value="#33000000"></Setter>
-            <Setter Property="Margin" Value="1"></Setter>
+            <Setter Property="Width" Value="15" />
+            <Setter Property="Height" Value="15" />
+            <Setter Property="Padding" Value="0" />
+            <Setter Property="BorderThickness" Value="1" />
+            <Setter Property="BorderBrush" Value="#33000000" />
+            <Setter Property="Margin" Value="1" />
         </Style>
     </UserControl.Resources>
     <Grid>
-        <Border Background="White" Name="ContainerBorder" BorderThickness="1">
+        <Border
+            Name="ContainerBorder"
+            Background="White"
+            BorderThickness="1">
             <Border.Effect>
-                <DropShadowEffect Color="#000000" ShadowDepth="0" BlurRadius="24" Opacity="0.22">
-                </DropShadowEffect>
+                <DropShadowEffect
+                    BlurRadius="24"
+                    Opacity="0.22"
+                    ShadowDepth="0"
+                    Color="#000000" />
             </Border.Effect>
             <Grid>
                 <Grid.RowDefinitions>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
-                    <RowDefinition Height="auto"></RowDefinition>
+                    <RowDefinition Height="auto" />
+                    <RowDefinition Height="auto" />
+                    <RowDefinition Height="auto" />
+                    <RowDefinition Height="auto" />
+                    <RowDefinition Height="auto" />
+                    <RowDefinition Height="auto" />
+                    <RowDefinition Height="auto" />
+                    <RowDefinition Height="auto" />
                 </Grid.RowDefinitions>
-                <TextBlock x:Name="RecentlyColorText" VerticalAlignment="Bottom" LineHeight="20" FontFamily="Segoe UI" FontSize="14" Margin="8,8,0,3">Recently used color</TextBlock>
-                <ListView Grid.Row="1" BorderThickness="0" Name="RecentlyColorList" Margin="9,0,9,0" ScrollViewer.HorizontalScrollBarVisibility="Hidden">
+                <TextBlock
+                    x:Name="RecentlyColorText"
+                    Margin="8,8,0,3"
+                    VerticalAlignment="Bottom"
+                    FontFamily="Segoe UI"
+                    FontSize="14"
+                    LineHeight="20">
+                    Recently used color
+                </TextBlock>
+                <ListView
+                    Name="RecentlyColorList"
+                    Grid.Row="1"
+                    Margin="9,0,9,0"
+                    BorderThickness="0"
+                    ScrollViewer.HorizontalScrollBarVisibility="Hidden">
                     <ListView.ItemsPanel>
                         <ItemsPanelTemplate>
-                            <WrapPanel Width="{Binding ElementName=ThemeColorList,Path=ActualWidth}">
-                            </WrapPanel>
+                            <WrapPanel Width="{Binding ElementName=ThemeColorList, Path=ActualWidth}" />
                         </ItemsPanelTemplate>
                     </ListView.ItemsPanel>
                     <ListView.ItemTemplate>
                         <DataTemplate>
-                            <Rectangle Width="14" Height="14" Fill="{Binding Converter={StaticResource ColorToBrushConverter}}" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"></Rectangle>
+                            <Rectangle
+                                Width="14"
+                                Height="14"
+                                Fill="{Binding Converter={StaticResource ColorToBrushConverter}}"
+                                MouseLeftButtonDown="Rectangle_MouseLeftButtonDown" />
                         </DataTemplate>
                     </ListView.ItemTemplate>
                 </ListView>
-                <TextBlock x:Name="ThemeColorsText" Grid.Row="2" FontFamily="SegoeUI" FontSize="14" LineHeight="20" Margin="8,5,0,1">Theme colors</TextBlock>
-                <ListView Grid.Row="3" BorderThickness="0" Name="ThemeColorList"  Margin="9,0,9,0" ScrollViewer.HorizontalScrollBarVisibility="Hidden" SelectionMode="Single">
+                <TextBlock
+                    x:Name="ThemeColorsText"
+                    Grid.Row="2"
+                    Margin="8,5,0,1"
+                    FontFamily="SegoeUI"
+                    FontSize="14"
+                    LineHeight="20">
+                    Theme colors
+                </TextBlock>
+                <ListView
+                    Name="ThemeColorList"
+                    Grid.Row="3"
+                    Margin="9,0,9,0"
+                    BorderThickness="0"
+                    ScrollViewer.HorizontalScrollBarVisibility="Hidden"
+                    SelectionMode="Single">
                     <ListView.ItemsPanel>
                         <ItemsPanelTemplate>
-                            <WrapPanel Width="{Binding ElementName=ThemeColorList,Path=ActualWidth}">
-                            </WrapPanel>
+                            <WrapPanel Width="{Binding ElementName=ThemeColorList, Path=ActualWidth}" />
                         </ItemsPanelTemplate>
                     </ListView.ItemsPanel>
                     <ListView.ItemTemplate>
                         <DataTemplate>
-                            <Rectangle Width="14" Height="14" Fill="{Binding Converter={StaticResource ColorToBrushConverter}}" MouseLeftButtonDown="Rectangle_MouseLeftButtonDown"></Rectangle>
+                            <Rectangle
+                                Width="14"
+                                Height="14"
+                                Fill="{Binding Converter={StaticResource ColorToBrushConverter}}"
+                                MouseLeftButtonDown="Rectangle_MouseLeftButtonDown" />
                         </DataTemplate>
                     </ListView.ItemTemplate>
                 </ListView>
-                <Separator Grid.Row="4" Width="190" Height="1"  Background="#26000000" HorizontalAlignment="Center" Margin="2,9,2,8"></Separator>
-                <StackPanel Orientation="Horizontal" Grid.Row="5" Name="TransparentPanel" Margin="0 0 0 8" Visibility="Collapsed">
-                    <Rectangle Width="16" Height="16" Margin="8,0,2,0" MouseLeftButtonDown="TransparentColor_MouseLeftButtonDown">
+                <Separator
+                    Grid.Row="4"
+                    Width="190"
+                    Height="1"
+                    Margin="2,9,2,8"
+                    HorizontalAlignment="Center"
+                    Background="#26000000" />
+                <StackPanel
+                    Name="TransparentPanel"
+                    Grid.Row="5"
+                    Margin="0,0,0,8"
+                    Orientation="Horizontal"
+                    Visibility="Collapsed">
+                    <Rectangle
+                        Width="16"
+                        Height="16"
+                        Margin="8,0,2,0"
+                        MouseLeftButtonDown="TransparentColor_MouseLeftButtonDown">
                         <Rectangle.Fill>
                             <DrawingBrush>
                                 <DrawingBrush.Drawing>
                                     <DrawingGroup>
                                         <GeometryDrawing Brush="White">
                                             <GeometryDrawing.Pen>
-                                                <Pen Thickness="1" Brush="#E2E3E6"></Pen>
+                                                <Pen Brush="#E2E3E6" Thickness="1" />
                                             </GeometryDrawing.Pen>
                                             <GeometryDrawing.Geometry>
-                                                <RectangleGeometry Rect="0,0,16,16"></RectangleGeometry>
+                                                <RectangleGeometry Rect="0,0,16,16" />
                                             </GeometryDrawing.Geometry>
                                         </GeometryDrawing>
                                         <GeometryDrawing>
                                             <GeometryDrawing.Pen>
-                                                <Pen Thickness="2" Brush="#FF3B30"></Pen>
+                                                <Pen Brush="#FF3B30" Thickness="2" />
                                             </GeometryDrawing.Pen>
                                             <GeometryDrawing.Geometry>
-                                                <LineGeometry StartPoint="16,0" EndPoint="0,16"></LineGeometry>
+                                                <LineGeometry StartPoint="16,0" EndPoint="0,16" />
                                             </GeometryDrawing.Geometry>
                                         </GeometryDrawing>
                                     </DrawingGroup>
@@ -90,23 +148,43 @@
                             </DrawingBrush>
                         </Rectangle.Fill>
                     </Rectangle>
-                    <TextBlock x:Name="TransparentText" FontFamily="Segoe UI" FontSize="14" VerticalAlignment="Center">Transparent</TextBlock>
+                    <TextBlock
+                        x:Name="TransparentText"
+                        VerticalAlignment="Center"
+                        FontFamily="Segoe UI"
+                        FontSize="14">
+                        Transparent
+                    </TextBlock>
                 </StackPanel>
-                <StackPanel Orientation="Horizontal" Grid.Row="6" MouseDown="SystemColorPicker_ClickPop">
-                    <Ellipse Width="16" Height="16" Margin="8,0,2,10"  VerticalAlignment="Center">
+                <StackPanel
+                    Grid.Row="6"
+                    MouseDown="SystemColorPicker_ClickPop"
+                    Orientation="Horizontal">
+                    <Ellipse
+                        Width="16"
+                        Height="16"
+                        Margin="8,0,2,10"
+                        VerticalAlignment="Center">
                         <Ellipse.Fill>
                             <DrawingBrush>
                                 <DrawingBrush.Drawing>
                                     <ImageDrawing ImageSource="../Resources/PropertyPanel/colorIcon.png">
                                         <ImageDrawing.Rect>
-                                            <Rect Width="16" Height="16"></Rect>
+                                            <Rect Width="16" Height="16" />
                                         </ImageDrawing.Rect>
                                     </ImageDrawing>
                                 </DrawingBrush.Drawing>
                             </DrawingBrush>
                         </Ellipse.Fill>
                     </Ellipse>
-                    <TextBlock x:Name="OtherColorsText" VerticalAlignment="Center" FontFamily="Segoe UI" FontSize="14" Margin="0 0 0 8">Other Colors</TextBlock>
+                    <TextBlock
+                        x:Name="OtherColorsText"
+                        Margin="0,0,0,8"
+                        VerticalAlignment="Center"
+                        FontFamily="Segoe UI"
+                        FontSize="14">
+                        Other Colors
+                    </TextBlock>
                 </StackPanel>
             </Grid>
         </Border>

+ 13 - 4
PDF Office/CustomControl/CompositeControl/ColorContent.xaml

@@ -2,6 +2,7 @@
     x:Class="PDF_Office.CustomControl.CompositeControl.ColorContent"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:convert="clr-namespace:PDF_Office.DataConvert"
     xmlns:cus="clr-namespace:PDF_Office.CustomControl"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Office.CustomControl.CompositeControl"
@@ -14,6 +15,8 @@
             <ResourceDictionary.MergedDictionaries>
                 <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
+
+            <convert:ColorBrushConvert x:Key="colorBrushConvert" />
             <DataTemplate x:Key="listboxData">
                 <Ellipse
                     Width="20"
@@ -69,15 +72,20 @@
                     x:Name="ElcustomColor"
                     Width="20"
                     Height="20"
-                    Fill="Transparent"
+                    Margin="4,0"
+                    Fill="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorContent}, Path=SelectedColor, Converter={StaticResource colorBrushConvert}}"
                     PreviewMouseLeftButtonDown="ElcustomColor_PreviewMouseLeftButtonDown" />
-                <cus:ColorDropBox x:Name="ColorDropPicker" SelectedColorChanged="ColorDropPicker_SelectedColorChanged" />
+                <cus:ColorDropBox
+                    x:Name="ColorDropPicker"
+                    Margin="4,0"
+                    SelectedColorChanged="ColorDropPicker_SelectedColorChanged" />
             </StackPanel>
         </Border>
         <cus:ColorDropBox
             x:Name="PnlColor"
             Opacity="0"
-            SelectedColorChanged="PnlColor_SelectedColorChanged" />
+            SelectedColorChanged="PnlColor_SelectedColorChanged"
+            Visibility="{Binding ElementName=ListColor, Path=Visibility}" />
 
         <ListBox
             x:Name="ListColor"
@@ -85,7 +93,8 @@
             BorderThickness="0"
             ItemContainerStyle="{StaticResource listboxItemStyle}"
             ItemTemplate="{StaticResource listboxData}"
-            SelectionChanged="ListColor_SelectionChanged">
+            SelectionChanged="ListColor_SelectionChanged"
+            Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ColorContent}, Path=ShowColorList}">
             <ListBox.ItemsPanel>
                 <ItemsPanelTemplate>
                     <WrapPanel Orientation="Horizontal" />

+ 37 - 1
PDF Office/CustomControl/CompositeControl/ColorContent.xaml.cs

@@ -54,7 +54,17 @@ namespace PDF_Office.CustomControl.CompositeControl
         {
             Color = defaultColor;
         }
+
+
+
+
+
+
     }
+
+    //类说明:
+    //复合控件:调色板
+    //组合而成的控件:颜色圆形UI的列表容器、调色板选择的颜色圆形按钮UI,弹出调色版的按钮
     /// <summary>
     /// ColorContent.xaml 的交互逻辑
     /// </summary>
@@ -63,6 +73,31 @@ namespace PDF_Office.CustomControl.CompositeControl
         private ObservableCollection<ColorItem> colors = new ObservableCollection<ColorItem>();
         public event EventHandler<Color> SelectedColorHandler;
         private ColorItem ChangedColorItem;
+
+        /// <summary>
+        /// 选中项的颜色
+        /// </summary>
+        public Color SelectedColor
+        {
+            get { return (Color)GetValue(SelectedColorProperty); }
+            set { SetValue(SelectedColorProperty, value); }
+        }
+
+        public static readonly DependencyProperty SelectedColorProperty =
+            DependencyProperty.Register("SelectedColor", typeof(Color), typeof(ColorContent), new PropertyMetadata((Color)ColorConverter.ConvertFromString("#6C33F8CC")));
+
+
+        public Visibility ShowColorList
+        {
+            get { return (Visibility)GetValue(ShowColorListProperty); }
+            set { SetValue(ShowColorListProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for ShowColorList.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty ShowColorListProperty =
+            DependencyProperty.Register("ShowColorList", typeof(Visibility), typeof(ColorContent), new PropertyMetadata(Visibility.Visible));
+
+
         public ColorContent()
         {
             InitializeComponent();
@@ -77,7 +112,8 @@ namespace PDF_Office.CustomControl.CompositeControl
         {
             IsExistForContainer((ElcustomColor.Fill as SolidColorBrush).Color);
             SelectedColorHandler?.Invoke(this, e.Value);
-            ElcustomColor.Fill = new SolidColorBrush(e.Value);
+            //ElcustomColor.Fill = new SolidColorBrush(e.Value);
+            SelectedColor = e.Value;
         }
 
         private void ListColor_SelectionChanged(object sender, SelectionChangedEventArgs e)

+ 3 - 0
PDF Office/CustomControl/CompositeControl/ColorSubContent.xaml.cs

@@ -15,6 +15,9 @@ using System.Windows.Shapes;
 
 namespace PDF_Office.CustomControl.CompositeControl
 {
+    //类的说明:
+    //复合控件:调色版
+    //组合而成的控件:调色板选择的颜色圆形按钮UI,弹出调色版的按钮
     /// <summary>
     /// ColorSubContent.xaml 的交互逻辑
     /// </summary>

+ 53 - 0
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml

@@ -0,0 +1,53 @@
+<UserControl x:Class="PDF_Office.CustomControl.CompositeControl.CustomComboControl"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800"
+             x:Name="usercontrol"
+             Loaded="UserControl_Loaded"
+             >
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Styles/SliderStyle.xaml"></ResourceDictionary>
+                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+
+            <DataTemplate x:Key="numberData">
+                <Grid>
+                    <TextBlock Text="{Binding Content}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                </Grid>
+            </DataTemplate>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Grid>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*"></ColumnDefinition>
+                <ColumnDefinition Width="auto"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+
+            <Border  BorderBrush="#E2E3E6"  HorizontalAlignment="Stretch" Height="32" Margin="0,0,11,0"  BorderThickness="0">
+                <Grid>
+                    <ComboBox Name="comBox" BorderThickness="1" Padding="10" Background="Transparent" BorderBrush="#FFE2E3E6" 
+                                  MaxDropDownHeight="200"
+                            ItemTemplate="{StaticResource numberData}"
+                              >
+                        <ComboBox.ItemContainerStyle>
+                            <Style TargetType="{x:Type ComboBoxItem}">
+                                <Setter Property="Padding" Value="10 0 0 0"/>
+                            </Style>
+                        </ComboBox.ItemContainerStyle>
+                    </ComboBox>
+                    <TextBox Name="title" Background="White" FontFamily="Segoe UI" FontSize="14"  Height="20" Margin="10,0,35,0" IsReadOnly="True"
+                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" >
+                    </TextBox>
+                </Grid>
+            </Border>
+        </Grid>
+    </Grid>
+
+</UserControl>

+ 280 - 0
PDF Office/CustomControl/CompositeControl/CustomComboControl.xaml.cs

@@ -0,0 +1,280 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl.CompositeControl
+{
+    //用法:
+    // IsValueContent为ture时,使用ValueStr作为集合某项的值
+    //IsValueContent为false时,使用Value作为集合某项的值
+    //SetItemSource(List<ComboDataItem> items)更换集合List
+    //默认:字体集合、IsValueContent为false、Value作为集合某项的值
+
+
+    public class ComboDataItem
+    {
+        //字符串类型的值
+        public string ValueStr { get; private set; }
+        //数字类型的值
+        public double Value { get; private set; }
+        //下拉框显示的内容
+        public string Content { get; private set; }
+        //下拉框显示的内容+单位:限数字值的单位
+        public string Unit { get; private set; }
+        //数字类型
+        public ComboDataItem(double value, string unitStr = "")
+        {
+            Content = value + unitStr;
+            Value = value;
+        }
+        //字符串类型
+        public ComboDataItem(string valueStr, string contentStr = "")
+        {
+            Content = contentStr;
+            ValueStr = valueStr;
+        }
+
+    }
+    /// <summary>
+    /// CustomComboControl.xaml 的交互逻辑
+    /// </summary>
+    public partial class CustomComboControl : UserControl
+    {
+        public List<ComboDataItem> Items { get; private set; }
+        public event RoutedEventHandler ValueChanged;
+
+        public CustomComboControl()
+        {
+            InitializeComponent();
+            Items = new List<ComboDataItem>();
+            DefaultItems();
+        }
+        private void UserControl_Loaded(object sender, RoutedEventArgs e)
+        {
+            comBox.SelectionChanged -= comBox_SelectionChanged;
+            comBox.SelectionChanged += comBox_SelectionChanged;
+        }
+
+        //更换集合
+        public void SetItemSource(List<ComboDataItem> items)
+        {
+            SelectedIndex = - 1;//为了触发SelectedIndex
+            Items = items;
+            ItemSource = Items;
+        }
+
+        /// <summary>
+        /// 默认集合(字体集合)
+        /// </summary>
+        private void DefaultItems()
+        {
+            Items.Clear();
+            SelectedIndex = -1;
+
+            var item = new ComboDataItem(3);
+            Items.Add(item);
+            item = new ComboDataItem(6);
+            Items.Add(item);
+            item = new ComboDataItem(9);
+            Items.Add(item);
+            item = new ComboDataItem(12);
+            Items.Add(item);
+            item = new ComboDataItem(15);
+            Items.Add(item);
+            item = new ComboDataItem(18);
+            Items.Add(item);
+            item = new ComboDataItem(21);
+            Items.Add(item);
+            item = new ComboDataItem(24);
+            Items.Add(item);
+            ItemSource = Items;
+        }
+ 
+        //下拉框选中项
+        private void comBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var item = comBox.SelectedItem as ComboDataItem;
+            if (item != null)
+            {
+                title.Text = item.Content;
+                SelectedIndex = comBox.SelectedIndex;
+
+                if (IsValueContent == false)
+                {
+                    Value = item.Value;
+                    ValueChanged?.Invoke(Value, null);
+                }
+                    
+                else
+                {
+                    ValueStr = item.ValueStr;
+                    ValueChanged?.Invoke(ValueStr, null);
+                }
+
+            }
+
+
+        }
+
+        public double Value
+        {
+            get { return (double)GetValue(ValueProperty); }
+            set { SetValue(ValueProperty, value); }
+        }
+
+        public string ValueStr
+        {
+            get { return (string)GetValue(ValueStrProperty); }
+            set { SetValue(ValueStrProperty, value); }
+        }
+
+        //下拉框每项的值是否为字符串类型
+        public bool IsValueContent
+        {
+            get { return (bool)GetValue(IsValueContentProperty); }
+            set { SetValue(IsValueContentProperty, value); }
+        }
+
+        public List<ComboDataItem> ItemSource
+        {
+            get { return (List<ComboDataItem>)GetValue(ItemSourceProperty); }
+            set { SetValue(ItemSourceProperty, value); }
+        }
+
+        public int SelectedIndex
+        {
+            get { return (int)GetValue(SelectedIndexProperty); }
+            set { SetValue(SelectedIndexProperty, value); }
+        }
+
+        public ComboDataItem SelectedItems
+        {
+            get { return (ComboDataItem)GetValue(SelectedItemsProperty); }
+            set { SetValue(SelectedItemsProperty, value); }
+        }
+
+        public static readonly DependencyProperty SelectedItemsProperty =
+         DependencyProperty.Register("SelectedItems", typeof(ComboDataItem), typeof(CustomComboControl), new PropertyMetadata(null, SelectedItemsPropertyChanged));
+
+
+        public static readonly DependencyProperty ValueProperty =
+           DependencyProperty.Register("Value", typeof(double), typeof(CustomComboControl), new PropertyMetadata(1.0));
+
+        public static readonly DependencyProperty ValueStrProperty =
+         DependencyProperty.Register("ValueStr", typeof(string), typeof(CustomComboControl), new PropertyMetadata(""));
+
+        public static readonly DependencyProperty ItemSourceProperty =
+          DependencyProperty.Register("ItemSource", typeof(List<ComboDataItem>), typeof(CustomComboControl), new PropertyMetadata(null, SelectedItemSourcePropertyChanged));
+
+        public static readonly DependencyProperty SelectedIndexProperty =
+        DependencyProperty.Register("SelectedIndex", typeof(int), typeof(CustomComboControl), new PropertyMetadata(-1, SelectedIndexPropertyChanged));
+
+        public static readonly DependencyProperty IsValueContentProperty =
+          DependencyProperty.Register("IsValueContent", typeof(bool), typeof(CustomComboControl), new PropertyMetadata(false));
+
+        //集合绑定下拉框 SelectedItems触发属性
+        private static void SelectedItemsPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as CustomComboControl;
+            var selectedItems = (ComboDataItem)e.NewValue;
+            if (control != null & selectedItems != null)
+            {
+                if(control.comBox.Items != null && control.comBox.Items.Count > 0)
+                {
+                    if(control.IsValueContent)
+                    {
+                        control.ValueStr = selectedItems.ValueStr;
+                    }
+                    else
+                    {
+                        control.Value = selectedItems.Value;
+                    }
+                }
+
+                if(control.comBox.Items == null || control.comBox.Items.Count == 0)
+                {
+                    control.title.Text = selectedItems.Content;
+                }
+                else
+                {
+                    int index = -1;
+                    ComboDataItem temp;
+                    if (control.IsValueContent)
+                        temp = control.Items.FirstOrDefault(inlineItem => inlineItem.ValueStr == selectedItems.ValueStr);
+                   else
+                        temp = control.Items.FirstOrDefault(inlineItem => inlineItem.Value == selectedItems.Value);
+
+                    if (temp != null)
+                        index = control.Items.IndexOf(temp);
+
+
+                    if (index >= 0)
+                    {
+                        control.SelectedIndex = -1;
+                        control.SelectedIndex = index;
+                    }
+                    else
+                        control.title.Text = selectedItems.Content;
+
+                }
+
+            }
+        }
+
+        //集合绑定下拉框Itemsource触发属性
+        private static void SelectedItemSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as CustomComboControl;
+            var itemsource = (List<ComboDataItem>)e.NewValue;
+            if (control != null)
+            {
+                control.SelectedIndex = -1;
+                control.comBox.ItemsSource = itemsource;
+                control.Items = itemsource;
+                control.SelectedIndex = ((itemsource == null || itemsource.Count == 0) ? -1 : 0);
+            }
+        }
+
+        //选中项触发属性
+        private static void SelectedIndexPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as CustomComboControl;
+            var selectedIndex = (int)e.NewValue;
+            if (control != null)
+            {
+                if(control.comBox.Items != null && control.comBox.Items.Count > 0 && selectedIndex != -1)
+                {
+                    control.comBox.SelectedIndex = selectedIndex;
+                    if (control.comBox.SelectedItem != null)
+                        control.SelectedItems = (ComboDataItem)control.comBox.SelectedItem;
+                    else
+                        control.SelectedItems = null;
+                }
+                control.UpdateSelectedIndex();
+            }
+        }
+        //选中项后,更新控件选中的显示内容
+        public void UpdateSelectedIndex()
+        {
+            if(SelectedIndex < 0  || comBox.Items == null || comBox.Items.Count <= SelectedIndex)
+            {
+                title.Text = "";
+            }
+            else
+            {
+                title.Text = Items[SelectedIndex].Content;
+            }
+        }
+    }
+}

+ 77 - 36
PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml

@@ -1,69 +1,110 @@
-<UserControl x:Class="PDF_Office.CustomControl.CompositeControl.SlidComboControl"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:PDF_Office.CustomControl.CompositeControl"
-             mc:Ignorable="d" 
-             x:Name="usercontrol"
-             d:DesignHeight="450" d:DesignWidth="800"
-             Loaded="UserControl_Loaded"
-             >
+<UserControl
+    x:Class="PDF_Office.CustomControl.CompositeControl.SlidComboControl"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    x:Name="usercontrol"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    Loaded="UserControl_Loaded"
+    mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../Styles/SliderStyle.xaml"></ResourceDictionary>
-                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml"/>
+                <ResourceDictionary Source="../../Styles/SliderStyle.xaml" />
+                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
 
+            <DataTemplate x:Key="numberData">
+                <Grid>
+                    <TextBlock
+                        HorizontalAlignment="Center"
+                        VerticalAlignment="Center"
+                        Text="{Binding Content}" />
+                </Grid>
+            </DataTemplate>
         </ResourceDictionary>
     </UserControl.Resources>
     <Grid>
         <Grid.RowDefinitions>
-            <RowDefinition Height="Auto"/>
+            <RowDefinition Height="Auto" />
             <RowDefinition />
         </Grid.RowDefinitions>
-        <TextBlock x:Name="thicknessText" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
+        <TextBlock
+            x:Name="thicknessText"
+            Margin="12,14,0,0"
+            FontFamily="Segoe UI Semibold"
+            FontSize="14"
+            FontWeight="SemiBold"
+            LineHeight="20">
+            Thickness
+        </TextBlock>
 
         <Grid Grid.Row="1">
             <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="*"></ColumnDefinition>
-                <ColumnDefinition Width="auto"></ColumnDefinition>
+                <ColumnDefinition Width="*" />
+                <ColumnDefinition Width="auto" />
             </Grid.ColumnDefinitions>
 
-            <Slider Name="ThicknessSlider" VerticalAlignment="Center" Margin="12,0,0,0" Width="148"  Minimum="0" Maximum="24" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True" 
-                    Style="{StaticResource RoundThumbSlider}"  TickFrequency="1" IsSnapToTickEnabled="True" Value="{Binding ElementName=usercontrol,Path=Value}" >
+            <Slider
+                Name="ThicknessSlider"
+                Width="148"
+                Margin="12,0,0,0"
+                VerticalAlignment="Center"
+                IsMoveToPointEnabled="True"
+                IsSelectionRangeEnabled="True"
+                IsSnapToTickEnabled="True"
+                Maximum="24"
+                Minimum="0"
+                Style="{StaticResource RoundThumbSlider}"
+                TickFrequency="1"
+                Value="{Binding ElementName=usercontrol, Path=Value}">
                 <Slider.Resources>
                     <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
                     <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
                 </Slider.Resources>
             </Slider>
 
-            <Border Grid.Column="1" BorderBrush="#E2E3E6"  Width="80" Height="32" Margin="0,0,11,0"  BorderThickness="0">
+            <Border
+                Grid.Column="1"
+                Width="80"
+                Height="32"
+                Margin="0,0,11,0"
+                BorderBrush="#E2E3E6"
+                BorderThickness="0">
                 <Grid>
-                    <ComboBox Name="ThicknessBox" BorderThickness="1" Padding="10" Background="Transparent" BorderBrush="#FFE2E3E6" 
-                                  MaxDropDownHeight="200">
+                    <ComboBox
+                        Name="ThicknessBox"
+                        Padding="10"
+                        Background="Transparent"
+                        BorderBrush="#FFE2E3E6"
+                        BorderThickness="1"
+                        ItemTemplate="{StaticResource numberData}"
+                        MaxDropDownHeight="200">
                         <ComboBox.ItemContainerStyle>
                             <Style TargetType="{x:Type ComboBoxItem}">
-                                <Setter Property="Padding" Value="10 0 0 0"/>
+                                <Setter Property="Padding" Value="10,0,0,0" />
                             </Style>
                         </ComboBox.ItemContainerStyle>
-                        <ComboBoxItem Content="1" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                        <ComboBoxItem Content="3" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                        <ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                        <ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                        <ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                        <ComboBoxItem Content="15" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                        <ComboBoxItem Content="18" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                        <ComboBoxItem Content="21" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                        <ComboBoxItem Content="24" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
                     </ComboBox>
-                    <TextBox Name="ThicknessText" Background="White" FontFamily="Segoe UI" FontSize="14"  Height="20" Margin="10,0,35,0" IsReadOnly="True"
-                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" >
-                    </TextBox>
+                    <TextBox
+                        Name="ThicknessText"
+                        Height="20"
+                        Margin="10,0,35,0"
+                        VerticalAlignment="Center"
+                        Background="White"
+                        BorderThickness="0"
+                        FontFamily="Segoe UI"
+                        FontSize="14"
+                        IsReadOnly="True"
+                        TextAlignment="Left" />
                 </Grid>
             </Border>
+            <local:CustomComboControl x:Name="combox" Grid.Column="1" Width="80" Height="32"  />
+   
         </Grid>
     </Grid>
-   
+
 </UserControl>

+ 52 - 36
PDF Office/CustomControl/CompositeControl/SlidComboControl.xaml.cs

@@ -1,4 +1,5 @@
-using System;
+using Prism.Commands;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -15,62 +16,73 @@ using System.Windows.Shapes;
 
 namespace PDF_Office.CustomControl.CompositeControl
 {
+
     /// <summary>
     /// SlidComboControl.xaml 的交互逻辑
     /// </summary>
     public partial class SlidComboControl : UserControl
     {
-        public event EventHandler<double> ValueChanged;
+        public List<ComboDataItem> Items { get;private set; }    
+        public event RoutedEventHandler ValueChanged;
+        
         public SlidComboControl()
         {
             InitializeComponent();
+           
+            Items = new List<ComboDataItem>();
+            DefaultItems();
+        }
+
+        public void SetItemSource(List<ComboDataItem> items)
+        {
+            Items = items;
+            combox.ItemSource = Items;
+        }
+
+        private void DefaultItems()
+        {
+            var item = new ComboDataItem(3);
+            Items.Add(item);
+            item = new ComboDataItem(6);
+            Items.Add(item);
+            item = new ComboDataItem(9);
+            Items.Add(item);
+            item = new ComboDataItem(12);
+            Items.Add(item);
+            item = new ComboDataItem(15);
+            Items.Add(item);
+            item = new ComboDataItem(18);
+            Items.Add(item);
+            item = new ComboDataItem(21);
+            Items.Add(item);
+            item = new ComboDataItem(24);
+            Items.Add(item);
+
+            combox.ItemSource = Items;
         }
 
         private void UserControl_Loaded(object sender, RoutedEventArgs e)
         {
-            ThicknessBox.SelectionChanged -= ThicknessBox_SelectionChanged;
-            ThicknessBox.SelectionChanged += ThicknessBox_SelectionChanged;
             ThicknessSlider.ValueChanged += ThicknessSlider_ValueChanged;
-            ThicknessBox.SelectedIndex = 0;
+            combox.ValueChanged -= combox_ValueChanged;
+            combox.ValueChanged += combox_ValueChanged;
         }
 
-        private void ThicknessSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
+        private void combox_ValueChanged(object sender, RoutedEventArgs e)
         {
-            foreach(var item in ThicknessBox.Items)
+            if (sender is double == true)
             {
-                var itemData = item as ComboBoxItem;
-                if(itemData != null)
-                {
-                   var doubleItem = double.Parse(itemData.Content.ToString());
-                    if(doubleItem == Value)
-                    {
-                        ThicknessBox.SelectedItem = itemData;
-                        break;
-                    }
-                }
+                if ((double)sender != Value)
+                    Value = (double)sender;
             }
-            ThicknessText.Text = Value.ToString();
         }
 
-        private void ThicknessBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        private void ThicknessSlider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
         {
-            var listItem = ThicknessBox.ItemContainerGenerator.ContainerFromItem(ThicknessBox.SelectedItem) as ComboBoxItem;
-            if (listItem != null)
-            {
-                Value = double.Parse(listItem.Content.ToString());
-                ThicknessText.Text = listItem.Content.ToString();
-            }
-            else
-            {
-                ThicknessText.Text = "1";
-                Value = 1.0;
-            }
-                
-
-            
-
+            combox.SelectedItems = new ComboDataItem(Value);
         }
 
+
         public double Value
         {
             get { return (double)GetValue(ValueProperty); }
@@ -78,15 +90,19 @@ namespace PDF_Office.CustomControl.CompositeControl
         }
         public static readonly DependencyProperty ValueProperty =
            DependencyProperty.Register("Value", typeof(double), typeof(SlidComboControl), new PropertyMetadata(1.0, SelectedValuePropertyChanged));
-
+       
         private static void SelectedValuePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
         {
             var control = d as SlidComboControl;
             var value = (double)e.NewValue;
             if (control != null)
             {
-                control.ValueChanged?.Invoke(control, value);
+
+                control.combox.SelectedItems = new ComboDataItem(value);
+                control.ValueChanged?.Invoke(value, null);
+
             }
         }
+
     }
 }

+ 1 - 12
PDF Office/CustomControl/DialogContent.cs

@@ -21,7 +21,7 @@ namespace PDF_Office.CustomControl
     /// 
     /// Content里暂时不能包含region 会注册不上,需要留意
     /// </summary>
-    public class DialogContent : Control
+    public class DialogContent : ContentControl
     {
         static DialogContent()
         {
@@ -53,16 +53,5 @@ namespace PDF_Office.CustomControl
         public static readonly DependencyProperty BottmBarProperty =
             DependencyProperty.Register("BottmBar", typeof(object), typeof(DialogContent), new PropertyMetadata(null));
 
-
-
-        public object Content
-        {
-            get { return (object)GetValue(ContentProperty); }
-            set { SetValue(ContentProperty, value); }
-        }
-
-        // Using a DependencyProperty as the backing store for Content.  This enables animation, styling, binding, etc...
-        public static readonly DependencyProperty ContentProperty =
-            DependencyProperty.Register("Content", typeof(object), typeof(DialogContent), new PropertyMetadata(null));
     }
 }

+ 10 - 2
PDF Office/CustomControl/Form/FormFieldCombox.xaml.cs

@@ -38,9 +38,17 @@ namespace PDF_Office.CustomControl.Form
 
         // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty TypeProperty =
-            DependencyProperty.Register("MyProperty", typeof(FormFieldType), typeof(FormFieldCombox), new PropertyMetadata(FormFieldType.visible));
-
+            DependencyProperty.Register("Type", typeof(FormFieldType), typeof(FormFieldCombox), new PropertyMetadata(FormFieldType.visible, FormFieldTypePropertyChanged));
 
+        private static void FormFieldTypePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as FormFieldCombox;
+            var type = (FormFieldType)e.NewValue;
+            if (control != null)
+            {
+                control.Combox.SelectedIndex = (int)type;
+            }
+        }
 
         public FormFieldType SetType
         {

+ 222 - 0
PDF Office/CustomControl/Form/LayoutAglinContent.xaml

@@ -0,0 +1,222 @@
+<UserControl x:Class="PDF_Office.CustomControl.Form.LayoutAglinContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+             xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:local="clr-namespace:PDF_Office.CustomControl.Form"
+             mc:Ignorable="d" 
+             x:Name="usercontrol"
+             d:DesignHeight="450" d:DesignWidth="800">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../Styles/SliderStyle.xaml" />
+                <ResourceDictionary Source="../../Styles/CustomBtnStyle.xaml" />
+                <ResourceDictionary Source="../../Styles/RadioButtonStyle.xaml" />
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid
+            x:Name="LayoutAlignGrid"
+            Grid.Row="1"
+            Width="150"
+            Margin="0,10,0,0"
+            HorizontalAlignment="Left">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="*" />
+            <RowDefinition Height="*" />
+        </Grid.RowDefinitions>
+
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="*" />
+        </Grid.ColumnDefinitions>
+
+        <RadioButton
+                x:Name="LayoutAlignLeft"
+                Grid.Row="0"
+                Grid.Column="0"
+                Width="32"
+                Height="32"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                Foreground="#616469"
+                GroupName="ImgAlign"
+                Checked="Align_Checked"
+                IsEnabled="{Binding ElementName=usercontrol,Path=IsLayoutAlign}"
+                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                Tag="AlignLeft">
+            <RadioButton.Content>
+                <Path
+                        Margin="5,0,0,0"
+                        Data="M2.01367 15V1H3.51367V15H2.01367ZM5 4H11V7H5V4ZM14 9H5V12H14V9Z"
+                        Fill="{Binding ElementName=LayoutAlignLeft, Path=Foreground}" />
+            </RadioButton.Content>
+        </RadioButton>
+
+        <RadioButton
+                x:Name="LayoutAlignHorizonCenter"
+                Grid.Row="0"
+                Grid.Column="1"
+                Width="32"
+                Height="32"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                Foreground="#616469"
+                GroupName="ImgAlign"
+                Checked="Align_Checked"
+                IsEnabled="{Binding ElementName=usercontrol,Path=IsLayoutAlign}"
+                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                Tag="AlignHorizonCenter">
+            <RadioButton.Content>
+                <Path
+                        Margin="5,0,0,0"
+                        Data="M8.75 7L8.75 9L12 9L12 12L8.75 12L8.75 15L7.25 15L7.25 12L4 12L4 9L7.25 9L7.25 7L2 7L2 4L7.25 4L7.25 0.999999L8.75 1L8.75 4L14 4L14 7L8.75 7Z"
+                        Fill="{Binding ElementName=LayoutAlignHorizonCenter, Path=Foreground}" />
+            </RadioButton.Content>
+        </RadioButton>
+
+        <RadioButton
+                x:Name="LayoutAlignRight"
+                Grid.Row="0"
+                Grid.Column="2"
+                Width="32"
+                Height="32"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                Foreground="#616469"
+                GroupName="ImgAlign"
+                Checked="Align_Checked"
+                IsEnabled="{Binding ElementName=usercontrol,Path=IsLayoutAlign}"
+                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                Tag="AlignRight">
+            <RadioButton.Content>
+                <Path
+                        Margin="5,0,0,0"
+                        Data="M14 1L14 15L12.5 15L12.5 1L14 1ZM11 12L2 12L2 9L11 9L11 12ZM4 7L11 7L11 4L4 4L4 7Z"
+                        Fill="{Binding ElementName=LayoutAlignRight, Path=Foreground}" />
+            </RadioButton.Content>
+        </RadioButton>
+
+        <RadioButton
+                x:Name="LayoutAlignDistributeHorizontal"
+                Grid.Row="0"
+                Grid.Column="3"
+                Width="32"
+                Height="32"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                Foreground="#616469"
+                GroupName="ImgAlign"
+                Checked="Align_Checked"
+                IsEnabled="{Binding ElementName=usercontrol,Path=IsLayoutAvgAlign}"
+                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                Tag="DistributeHorizontal">
+            <RadioButton.Content>
+                <Path
+                        Margin="5,0,0,0"
+                        Data="M15 12.5L1 12.5L1 14L15 14L15 12.5ZM12 9.5L4 9.5L4 6.5L12 6.5L12 9.5ZM1 2L15 2L15 3.5L1 3.5L1 2Z"
+                        Fill="{Binding ElementName=LayoutAlignDistributeHorizontal, Path=Foreground}" />
+            </RadioButton.Content>
+           
+        </RadioButton>
+
+        <RadioButton
+                x:Name="LayoutAlignTop"
+                Grid.Row="1"
+                Grid.Column="0"
+                Width="32"
+                Height="32"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                Foreground="#616469"
+                GroupName="ImgAlign"
+                Checked="Align_Checked"
+                IsEnabled="{Binding ElementName=usercontrol,Path=IsLayoutAlign}"
+                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                Tag="AlignTop">
+            <RadioButton.Content>
+                <Path
+                        Margin="5,0,0,0"
+                        Data="M15 2L1 2L1 3.5L15 3.5L15 2ZM12 5L12 11L9 11L9 5L12 5ZM7 5L7 14L4 14L4 5L7 5Z"
+                        Fill="{Binding ElementName=LayoutAlignTop, Path=Foreground}" />
+            </RadioButton.Content>
+           
+        </RadioButton>
+
+        <RadioButton
+                x:Name="LayoutAlignVerticalCenter"
+                Grid.Row="1"
+                Grid.Column="1"
+                Width="32"
+                Height="32"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                Foreground="#616469"
+                GroupName="ImgAlign"
+                Checked="Align_Checked"
+                IsEnabled="{Binding ElementName=usercontrol,Path=IsLayoutAlign}"
+                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                Tag="AlignVerticalCenter">
+            <RadioButton.Content>
+                <Path
+                        Margin="5,0,0,0"
+                        Data="M7 7.25L9 7.25L9 4L12 4L12 7.25L15 7.25L15 8.75L12 8.75L12 12L9 12L9 8.75L7 8.75L7 14L4 14L4 8.75L1 8.75L1 7.25L4 7.25L4 2L7 2L7 7.25Z"
+                        Fill="{Binding ElementName=LayoutAlignVerticalCenter, Path=Foreground}" />
+            </RadioButton.Content>
+           
+        </RadioButton>
+
+        <RadioButton
+                x:Name="LayoutAlignBottom"
+                Grid.Row="1"
+                Grid.Column="2"
+                Width="32"
+                Height="32"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                Foreground="#616469"
+                GroupName="ImgAlign"
+                Checked="Align_Checked"
+                IsEnabled="{Binding ElementName=usercontrol,Path=IsLayoutAlign}"
+                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                Tag="AlignBottom">
+            <RadioButton.Content>
+                <Path
+                        Margin="5,0,0,0"
+                        Data="M9 2H12V11H9V2ZM4 5H7V11H4V5ZM1 14H15V12.5H1V14Z"
+                        Fill="{Binding ElementName=LayoutAlignBottom, Path=Foreground}" />
+            </RadioButton.Content>
+           
+        </RadioButton>
+
+        <RadioButton
+                x:Name="LayoutDistributeVertical"
+                Grid.Row="1"
+                Grid.Column="3"
+                Width="32"
+                Height="32"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                Foreground="#616469"
+                GroupName="ImgAlign"
+                Checked="Align_Checked"
+                IsEnabled="{Binding ElementName=usercontrol,Path=IsLayoutAvgAlign}"
+                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                Tag="DistributeVertical">
+            <RadioButton.Content>
+                <Path
+                        Margin="5,0,0,0"
+                        Data="M2 15V1H3.5V15H2ZM6.5 4H9.5V12H6.5V4ZM12.5 1V15H14V1H12.5Z"
+                        Fill="{Binding ElementName=LayoutDistributeVertical, Path=Foreground}" />
+            </RadioButton.Content>
+        </RadioButton>
+
+    </Grid>
+</UserControl>

+ 79 - 0
PDF Office/CustomControl/Form/LayoutAglinContent.xaml.cs

@@ -0,0 +1,79 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl.Form
+{
+    /// <summary>
+    /// LayoutAglinContent.xaml 的交互逻辑
+    /// </summary>
+    public partial class LayoutAglinContent : UserControl
+    {
+        public event RoutedEventHandler ValueChanged;
+        public LayoutAglinContent()
+        {
+            InitializeComponent();
+        }
+
+        public void ClearCheckedBtn()
+        {
+            foreach (var item in LayoutAlignGrid.Children)
+            {
+                var radioBtn = item as RadioButton;
+                if (radioBtn != null)
+                {
+                    radioBtn.IsChecked = false;
+                }
+            }
+        }
+
+        public bool IsLayoutAvgAlign
+        {
+            get { return (bool)GetValue(IsLayoutAvgAlignProperty); }
+            set { SetValue(IsLayoutAvgAlignProperty, value); }
+        }
+
+        public static readonly DependencyProperty IsLayoutAvgAlignProperty =
+      DependencyProperty.Register("IsLayoutAvgAlign", typeof(bool), typeof(LayoutAglinContent), new PropertyMetadata(true));
+
+
+        public bool IsLayoutAlign
+        {
+            get { return (bool)GetValue(IsLayoutAlignProperty); }
+            set { SetValue(IsLayoutAvgAlignProperty, value); }
+        }
+
+        public static readonly DependencyProperty IsLayoutAlignProperty =
+      DependencyProperty.Register("IsLayoutAlign", typeof(bool), typeof(LayoutAglinContent), new PropertyMetadata(true));
+
+        public string Btntag
+        {
+            get { return (string)GetValue(BtntagProperty); }
+            set { SetValue(BtntagProperty, value); }
+        }
+
+        public static readonly DependencyProperty BtntagProperty =
+      DependencyProperty.Register("Btntag", typeof(string), typeof(LayoutAglinContent), new PropertyMetadata(""));
+
+        private void Align_Checked(object sender, RoutedEventArgs e)
+        {
+            var btn = sender as RadioButton;
+            if (btn != null && btn.Tag != null && string.IsNullOrEmpty(btn.Tag.ToString()) == false)
+            {
+                Btntag = btn.Tag.ToString();
+                ValueChanged?.Invoke(btn.Tag.ToString(), null);
+            }
+        }
+    }
+}

+ 258 - 0
PDF Office/CustomControl/ImageButton.cs

@@ -0,0 +1,258 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace PDF_Office.CustomControl
+{
+    public class ImageButton : Button
+    {
+        static ImageButton()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageButton), new FrameworkPropertyMetadata(typeof(ImageButton)));
+        }
+
+        public override void OnApplyTemplate()
+        {
+            base.OnApplyTemplate();
+            if (this.MouseOverBackground == null)
+            {
+                this.MouseOverBackground = Background;
+            }
+            if (this.MouseDownBackground == null)
+            {
+                if (this.MouseOverBackground == null)
+                {
+                    this.MouseDownBackground = Background;
+                }
+                else
+                {
+                    this.MouseDownBackground = MouseOverBackground;
+                }
+            }
+            if (this.MouseOverBorderBrush == null)
+            {
+                this.MouseOverBorderBrush = BorderBrush;
+            }
+            if (this.MouseDownBorderBrush == null)
+            {
+                if (this.MouseOverBorderBrush == null)
+                {
+                    this.MouseDownBorderBrush = BorderBrush;
+                }
+                else
+                {
+                    this.MouseDownBorderBrush = MouseOverBorderBrush;
+                }
+            }
+            if (this.MouseOverForeground == null)
+            {
+                this.MouseOverForeground = Foreground;
+            }
+            if (this.MouseDownForeground == null)
+            {
+                if (this.MouseOverForeground == null)
+                {
+                    this.MouseDownForeground = Foreground;
+                }
+                else
+                {
+                    this.MouseDownForeground = this.MouseOverForeground;
+                }
+            }
+        }
+
+        #region 依赖项属性  
+
+        /// <summary>  
+        /// 鼠标移上去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBackgroundProperty
+            = DependencyProperty.Register("MouseOverBackground", typeof(Brush), typeof(ImageButton));
+
+        /// <summary>
+        /// 鼠标移上去的背景颜色的透明度
+        /// </summary>
+        public static readonly DependencyProperty MouseOverBackgroundOpacityProperty
+            = DependencyProperty.Register("MouseOverBackgroundOpacity", typeof(double), typeof(ImageButton), new PropertyMetadata(1.0, null));
+
+        /// <summary>  
+        /// 鼠标按下去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBackgroundProperty
+            = DependencyProperty.Register("MouseDownBackground", typeof(Brush), typeof(ImageButton));
+
+        /// <summary>  
+        /// 鼠标移上去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverForegroundProperty
+            = DependencyProperty.Register("MouseOverForeground", typeof(Brush), typeof(ImageButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownForegroundProperty
+            = DependencyProperty.Register("MouseDownForeground", typeof(Brush), typeof(ImageButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标移上去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBorderBrushProperty
+            = DependencyProperty.Register("MouseOverBorderBrush", typeof(Brush), typeof(ImageButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBorderBrushProperty
+            = DependencyProperty.Register("MouseDownBorderBrush", typeof(Brush), typeof(ImageButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 圆角  
+        /// </summary>  
+        public static readonly DependencyProperty CornerRadiusProperty
+            = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(ImageButton), null);
+
+        //图标  
+        public static readonly DependencyProperty IconProperty
+            = DependencyProperty.Register("Icon", typeof(ImageSource), typeof(ImageButton), null);
+
+        //鼠标移上去的图标图标  
+        public static readonly DependencyProperty IconMouseOverProperty
+            = DependencyProperty.Register("IconMouseOver", typeof(ImageSource), typeof(ImageButton), null);
+
+        //鼠标按下去的图标图标  
+        public static readonly DependencyProperty IconPressProperty
+            = DependencyProperty.Register("IconPress", typeof(ImageSource), typeof(ImageButton), null);
+
+        //图标高度  
+        public static readonly DependencyProperty IconHeightProperty
+            = DependencyProperty.Register("IconHeight", typeof(double), typeof(ImageButton), new PropertyMetadata(24.0, null));
+
+        //图标宽度  
+        public static readonly DependencyProperty IconWidthProperty
+            = DependencyProperty.Register("IconWidth", typeof(double), typeof(ImageButton), new PropertyMetadata(24.0, null));
+
+        //图标和内容的对齐方式  
+        public static readonly DependencyProperty IconContentOrientationProperty
+            = DependencyProperty.Register("IconContentOrientation", typeof(Orientation), typeof(ImageButton), new PropertyMetadata(Orientation.Horizontal, null));
+
+        //图标和内容的距离  
+        public static readonly DependencyProperty IconContentMarginProperty
+            = DependencyProperty.Register("IconContentMargin", typeof(Thickness), typeof(ImageButton), new PropertyMetadata(new Thickness(0, 0, 0, 0), null));
+
+        #endregion
+
+        #region 属性包装
+
+        public Brush MouseOverBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverBackgroundProperty);
+            }
+            set { SetValue(MouseOverBackgroundProperty, value); }
+        }
+
+        public double MouseOverBackgroundOpacity
+        {
+            get
+            {
+                return (double)GetValue(MouseOverBackgroundOpacityProperty);
+            }
+            set { SetValue(MouseOverBackgroundOpacityProperty, value); }
+        }
+
+        public Brush MouseDownBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownBackgroundProperty);
+            }
+            set { SetValue(MouseDownBackgroundProperty, value); }
+        }
+
+        public Brush MouseOverForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverForegroundProperty);
+            }
+            set { SetValue(MouseOverForegroundProperty, value); }
+        }
+
+        public Brush MouseDownForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownForegroundProperty);
+            }
+            set { SetValue(MouseDownForegroundProperty, value); }
+        }
+
+        public Brush MouseOverBorderBrush
+        {
+            get { return (Brush)GetValue(MouseOverBorderBrushProperty); }
+            set { SetValue(MouseOverBorderBrushProperty, value); }
+        }
+
+        public Brush MouseDownBorderBrush
+        {
+            get { return (Brush)GetValue(MouseDownBorderBrushProperty); }
+            set { SetValue(MouseDownBorderBrushProperty, value); }
+        }
+
+        public CornerRadius CornerRadius
+        {
+            get { return (CornerRadius)GetValue(CornerRadiusProperty); }
+            set { SetValue(CornerRadiusProperty, value); }
+        }
+
+        public ImageSource Icon
+        {
+            get { return (ImageSource)GetValue(IconProperty); }
+            set { SetValue(IconProperty, value); }
+        }
+
+        public ImageSource IconMouseOver
+        {
+            get { return (ImageSource)GetValue(IconMouseOverProperty); }
+            set { SetValue(IconMouseOverProperty, value); }
+        }
+
+        public ImageSource IconPress
+        {
+            get { return (ImageSource)GetValue(IconPressProperty); }
+            set { SetValue(IconPressProperty, value); }
+        }
+
+        public double IconHeight
+        {
+            get { return (double)GetValue(IconHeightProperty); }
+            set { SetValue(IconHeightProperty, value); }
+        }
+
+        public double IconWidth
+        {
+            get { return (double)GetValue(IconWidthProperty); }
+            set { SetValue(IconWidthProperty, value); }
+        }
+
+        public Orientation IconContentOrientation
+        {
+            get { return (Orientation)GetValue(IconContentOrientationProperty); }
+            set { SetValue(IconContentOrientationProperty, value); }
+        }
+
+        public Thickness IconContentMargin
+        {
+            get { return (Thickness)GetValue(IconContentMarginProperty); }
+            set { SetValue(IconContentMarginProperty, value); }
+        }
+
+        #endregion
+    }
+}

+ 253 - 0
PDF Office/CustomControl/ImageRadioButton .cs

@@ -0,0 +1,253 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace PDF_Office.CustomControl
+{
+    public class ImageRadioButton : RadioButton
+    {
+        static ImageRadioButton()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(ImageRadioButton), new FrameworkPropertyMetadata(typeof(ImageRadioButton)));
+        }
+
+        public override void OnApplyTemplate()
+        {
+            base.OnApplyTemplate();
+            if (this.MouseOverBackground == null)
+            {
+                this.MouseOverBackground = Background;
+            }
+            if (this.MouseDownBackground == null)
+            {
+                if (this.MouseOverBackground == null)
+                {
+                    this.MouseDownBackground = Background;
+                }
+                else
+                {
+                    this.MouseDownBackground = MouseOverBackground;
+                }
+            }
+            if (this.MouseOverBorderBrush == null)
+            {
+                this.MouseOverBorderBrush = BorderBrush;
+            }
+            if (this.MouseDownBorderBrush == null)
+            {
+                if (this.MouseOverBorderBrush == null)
+                {
+                    this.MouseDownBorderBrush = BorderBrush;
+                }
+                else
+                {
+                    this.MouseDownBorderBrush = MouseOverBorderBrush;
+                }
+            }
+            if (this.MouseOverForeground == null)
+            {
+                this.MouseOverForeground = Foreground;
+            }
+            if (this.MouseDownForeground == null)
+            {
+                if (this.MouseOverForeground == null)
+                {
+                    this.MouseDownForeground = Foreground;
+                }
+                else
+                {
+                    this.MouseDownForeground = this.MouseOverForeground;
+                }
+            }
+        }
+
+        #region 依赖项属性  
+
+        /// <summary>  
+        /// 鼠标移上去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBackgroundProperty
+            = DependencyProperty.Register("MouseOverBackground", typeof(Brush), typeof(ImageRadioButton));
+
+        /// <summary>  
+        /// 鼠标按下去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBackgroundProperty
+            = DependencyProperty.Register("MouseDownBackground", typeof(Brush), typeof(ImageRadioButton));
+
+        /// <summary>  
+        /// 鼠标移上去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverForegroundProperty
+            = DependencyProperty.Register("MouseOverForeground", typeof(Brush), typeof(ImageRadioButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownForegroundProperty
+            = DependencyProperty.Register("MouseDownForeground", typeof(Brush), typeof(ImageRadioButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标移上去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBorderBrushProperty
+            = DependencyProperty.Register("MouseOverBorderBrush", typeof(Brush), typeof(ImageRadioButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBorderBrushProperty
+            = DependencyProperty.Register("MouseDownBorderBrush", typeof(Brush), typeof(ImageRadioButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 圆角  
+        /// </summary>  
+        public static readonly DependencyProperty CornerRadiusProperty
+            = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(ImageRadioButton), null);
+
+        //图标  
+        public static readonly DependencyProperty IconProperty
+            = DependencyProperty.Register("Icon", typeof(ImageSource), typeof(ImageRadioButton), null);
+
+        //鼠标移上去的图标图标  
+        public static readonly DependencyProperty IconMouseOverProperty
+            = DependencyProperty.Register("IconMouseOver", typeof(ImageSource), typeof(ImageRadioButton), null);
+
+        //鼠标按下去的图标图标  
+        public static readonly DependencyProperty IconPressProperty
+            = DependencyProperty.Register("IconPress", typeof(ImageSource), typeof(ImageRadioButton), null);
+
+        //选中的图标图标  
+        public static readonly DependencyProperty IconCheckedProperty
+            = DependencyProperty.Register("IconChecked", typeof(ImageSource), typeof(ImageRadioButton), null);
+
+        //图标高度  
+        public static readonly DependencyProperty IconHeightProperty
+            = DependencyProperty.Register("IconHeight", typeof(double), typeof(ImageRadioButton), new PropertyMetadata(24.0, null));
+
+        //图标宽度  
+        public static readonly DependencyProperty IconWidthProperty
+            = DependencyProperty.Register("IconWidth", typeof(double), typeof(ImageRadioButton), new PropertyMetadata(24.0, null));
+
+        //图标和内容的对齐方式  
+        public static readonly DependencyProperty IconContentOrientationProperty
+            = DependencyProperty.Register("IconContentOrientation", typeof(Orientation), typeof(ImageRadioButton), new PropertyMetadata(Orientation.Horizontal, null));
+
+        //图标和内容的距离  
+        public static readonly DependencyProperty IconContentMarginProperty
+            = DependencyProperty.Register("IconContentMargin", typeof(Thickness), typeof(ImageRadioButton), new PropertyMetadata(new Thickness(0, 0, 0, 0), null));
+
+        #endregion
+
+        #region 属性包装
+
+        public Brush MouseOverBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverBackgroundProperty);
+            }
+            set { SetValue(MouseOverBackgroundProperty, value); }
+        }
+
+        public Brush MouseDownBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownBackgroundProperty);
+            }
+            set { SetValue(MouseDownBackgroundProperty, value); }
+        }
+
+        public Brush MouseOverForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverForegroundProperty);
+            }
+            set { SetValue(MouseOverForegroundProperty, value); }
+        }
+
+        public Brush MouseDownForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownForegroundProperty);
+            }
+            set { SetValue(MouseDownForegroundProperty, value); }
+        }
+
+        public Brush MouseOverBorderBrush
+        {
+            get { return (Brush)GetValue(MouseOverBorderBrushProperty); }
+            set { SetValue(MouseOverBorderBrushProperty, value); }
+        }
+
+        public Brush MouseDownBorderBrush
+        {
+            get { return (Brush)GetValue(MouseDownBorderBrushProperty); }
+            set { SetValue(MouseDownBorderBrushProperty, value); }
+        }
+
+        public CornerRadius CornerRadius
+        {
+            get { return (CornerRadius)GetValue(CornerRadiusProperty); }
+            set { SetValue(CornerRadiusProperty, value); }
+        }
+
+        public ImageSource Icon
+        {
+            get { return (ImageSource)GetValue(IconProperty); }
+            set { SetValue(IconProperty, value); }
+        }
+
+        public ImageSource IconMouseOver
+        {
+            get { return (ImageSource)GetValue(IconMouseOverProperty); }
+            set { SetValue(IconMouseOverProperty, value); }
+        }
+
+        public ImageSource IconPress
+        {
+            get { return (ImageSource)GetValue(IconPressProperty); }
+            set { SetValue(IconPressProperty, value); }
+        }
+
+        public ImageSource IconChecked
+        {
+            get { return (ImageSource)GetValue(IconCheckedProperty); }
+            set { SetValue(IconCheckedProperty, value); }
+        }
+
+        public double IconHeight
+        {
+            get { return (double)GetValue(IconHeightProperty); }
+            set { SetValue(IconHeightProperty, value); }
+        }
+
+        public double IconWidth
+        {
+            get { return (double)GetValue(IconWidthProperty); }
+            set { SetValue(IconWidthProperty, value); }
+        }
+
+        public Orientation IconContentOrientation
+        {
+            get { return (Orientation)GetValue(IconContentOrientationProperty); }
+            set { SetValue(IconContentOrientationProperty, value); }
+        }
+
+        public Thickness IconContentMargin
+        {
+            get { return (Thickness)GetValue(IconContentMarginProperty); }
+            set { SetValue(IconContentMarginProperty, value); }
+        }
+
+        #endregion
+    }
+}

+ 3 - 3
PDF Office/CustomControl/NumericUpDown.xaml

@@ -5,7 +5,7 @@
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Office.CustomControl"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-    d:DesignHeight="40"
+    d:DesignHeight="32"
     d:DesignWidth="80"
     Background="#EEEEEE"
     FontSize="20"
@@ -19,7 +19,7 @@
             <TextBox
                 Name="TextBox_Num"
                 MinWidth="80"
-                MinHeight="20"
+                MinHeight="32"
                 Padding="16,0,0,0"
                 VerticalContentAlignment="Center"
                 Background="Transparent"
@@ -32,7 +32,7 @@
                 Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Text}"
                 TextAlignment="Left"
                 TextChanged="TextBox_Num_TextChanged" />
-            <Grid Grid.Column="1" Width="20">
+            <Grid Grid.Column="1" Width="16">
                 <Grid.RowDefinitions>
                     <RowDefinition />
                     <RowDefinition />

+ 19 - 5
PDF Office/CustomControl/NumericUpDown.xaml.cs

@@ -41,6 +41,7 @@ namespace PDF_Office.CustomControl
             get { return (double)GetValue(ValueProperty); }
             set
             {
+                SetValue(ValueProperty, value);
                 if (value > Maximum)
                 {
                     SetValue(ValueProperty, Maximum);
@@ -58,9 +59,17 @@ namespace PDF_Office.CustomControl
         }
 
         public static readonly DependencyProperty ValueProperty =
-            DependencyProperty.Register("Value", typeof(double), typeof(NumericUpDown), new PropertyMetadata(0.0));
-
+            DependencyProperty.Register("Value", typeof(double), typeof(NumericUpDown), new PropertyMetadata(0.0, SelectedItemSourcePropertyChanged));
 
+        private static void SelectedItemSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as NumericUpDown;
+            var value = (double)e.NewValue;
+            if (control != null)
+            {
+                control.TextBox_Num.Text = Convert.ToString(value);
+            }
+        }
         /// <summary>
         /// 最大值
         /// </summary>
@@ -167,13 +176,18 @@ namespace PDF_Office.CustomControl
 
         private void TextBox_Num_TextChanged(object sender, TextChangedEventArgs e)
         {
-            int num = 0;
-            if (this.TextBox_Num.Text == "" || !int.TryParse(this.TextBox_Num.Text,out num))
+            //int.TryParse("30.0000610351563"),字符串有小数点,会转换失败
+            double num = 0;
+            if (this.TextBox_Num.Text == "" || !double.TryParse(this.TextBox_Num.Text,out num))
+            {
+                this.TextBox_Num.Text = Minimum.ToString();
+            }
+            if (int.Parse(this.TextBox_Num.Text) < Minimum)
             {
                 this.TextBox_Num.Text = Minimum.ToString();
             }
             Text = this.TextBox_Num.Text;
-            Value = int.Parse(this.TextBox_Num.Text);
+            Value = (int)double.Parse(this.TextBox_Num.Text);
         }
 
         private void CountTextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)

+ 58 - 0
PDF Office/CustomControl/PaginationControl.xaml

@@ -0,0 +1,58 @@
+<UserControl
+    x:Class="PDF_Office.CustomControl.PaginationControl"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    Height="36"
+    d:DesignHeight="450"
+    Foreground="{StaticResource color.sys.text.anti.norm}"
+    mc:Ignorable="d">
+    <Border Background="{StaticResource color.sys.layout.dark.bg}" CornerRadius="{StaticResource radius.base.m}">
+        <Grid
+            Margin="16,6"
+            HorizontalAlignment="Stretch"
+            Background="Transparent">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="auto" />
+                <ColumnDefinition Width="auto" />
+                <ColumnDefinition Width="auto" />
+            </Grid.ColumnDefinitions>
+            <Grid>
+                <cus:TextBoxEx
+                    x:Name="TxtInput"
+                    Width="50"
+                    Height="24"
+                    CornerRadius="4"
+                    Foreground="{StaticResource color.field.text.act}"
+                    InputMethod.IsInputMethodEnabled="False"
+                    LostFocus="TxtInput_LostFocus"
+                    PreviewKeyDown="TxtInput_PreviewKeyDown"
+                    ShowClose="False"
+                    Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:PaginationControl}, Path=InputString, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
+                    Visibility="Collapsed" />
+                <TextBlock
+                    Name="TblIndex"
+                    MinWidth="15"
+                    VerticalAlignment="Center"
+                    PreviewMouseDown="TblIndex_PreviewMouseDown"
+                    Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:PaginationControl}, Path=CurrentPage, StringFormat={}{0}}"
+                    TextAlignment="Center" />
+            </Grid>
+            <TextBlock
+                Grid.Column="1"
+                Margin="8,0"
+                VerticalAlignment="Center"
+                FontSize="12"
+                Text="/" />
+            <TextBlock
+                Name="TBPageCount"
+                Grid.Column="2"
+                VerticalAlignment="Center"
+                FocusVisualStyle="{x:Null}"
+                Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:PaginationControl}, Path=PageCount, StringFormat={}{0}}" />
+        </Grid>
+    </Border>
+</UserControl>

+ 108 - 0
PDF Office/CustomControl/PaginationControl.xaml.cs

@@ -0,0 +1,108 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl
+{
+    /// <summary>
+    /// PaginationControl.xaml 的交互逻辑
+    /// </summary>
+    public partial class PaginationControl : UserControl
+    {
+        public PaginationControl()
+        {
+            InitializeComponent();
+        }
+
+
+        public int CurrentPage
+        {
+            get { return (int)GetValue(CurrentPageProperty); }
+            set { SetValue(CurrentPageProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for CurrentPage.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty CurrentPageProperty =
+            DependencyProperty.Register("CurrentPage", typeof(int), typeof(PaginationControl), new PropertyMetadata(0));
+
+
+
+
+        public int PageCount
+        {
+            get { return (int)GetValue(PageCountProperty); }
+            set { SetValue(PageCountProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for PageCount.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty PageCountProperty =
+            DependencyProperty.Register("PageCount", typeof(int), typeof(PaginationControl), new PropertyMetadata(0));
+
+
+
+        public string InputString
+        {
+            get { return (string)GetValue(InputStringProperty); }
+            set { SetValue(InputStringProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for InputString.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty InputStringProperty =
+            DependencyProperty.Register("InputString", typeof(string), typeof(PaginationControl), new PropertyMetadata(""));
+
+
+        private void CheckInput()
+        {
+            int page = CurrentPage;
+            bool result = int.TryParse(InputString,out page);
+            if(result&&(page <= PageCount)&&page>=1)
+            {
+                CurrentPage = page;
+            }
+            else
+            {
+                InputString = CurrentPage.ToString();
+            }
+        }
+
+        private async void TblIndex_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+        {
+            if(e.ClickCount==2)
+            {
+                TblIndex.Visibility = Visibility.Collapsed;
+                TxtInput.Visibility = Visibility.Visible;
+                await Task.Delay(20);
+                TxtInput.SelectAll();
+                TxtInput.Focus();
+                InputString = CurrentPage.ToString();
+            }
+        }
+
+        private void TxtInput_LostFocus(object sender, RoutedEventArgs e)
+        {
+            CheckInput();
+            TblIndex.Visibility = Visibility.Visible;
+            TxtInput.Visibility = Visibility.Collapsed;
+
+        }
+
+        private void TxtInput_PreviewKeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Enter)
+            {
+                CheckInput();
+            }
+        }
+    }
+}

+ 2 - 2
PDF Office/CustomControl/PathButton.cs

@@ -159,11 +159,11 @@ namespace PDF_Office.CustomControl
         public static readonly DependencyProperty IconCheckedProperty
             = DependencyProperty.Register("IconChecked", typeof(Geometry), typeof(PathButton), null);
 
-        //鼠标移上去的图标填充色   
+        //选中的图标填充色   
         public static readonly DependencyProperty IconCheckedFillProperty
             = DependencyProperty.Register("IconCheckedFill", typeof(Brush), typeof(PathButton), null);
 
-        //鼠标移上去的透明度 
+        //选中的图标的透明度 
         public static readonly DependencyProperty IconCheckedOpacityProperty
             = DependencyProperty.Register("IconCheckedOpacity", typeof(double), typeof(PathButton), null);
 

+ 385 - 0
PDF Office/CustomControl/PathRadioButton.cs

@@ -0,0 +1,385 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+
+namespace PDF_Office.CustomControl
+{
+    public class PathRadioButton : RadioButton
+    {
+        static PathRadioButton()
+        {
+            DefaultStyleKeyProperty.OverrideMetadata(typeof(PathRadioButton), new FrameworkPropertyMetadata(typeof(PathRadioButton)));
+        }
+
+        public override void OnApplyTemplate()
+        {
+            base.OnApplyTemplate();
+            if (this.MouseOverBackground == null)
+            {
+                this.MouseOverBackground = Background;
+            }
+            if (this.MouseDownBackground == null)
+            {
+                if (this.MouseOverBackground == null)
+                {
+                    this.MouseDownBackground = Background;
+                }
+                else
+                {
+                    this.MouseDownBackground = MouseOverBackground;
+                }
+            }
+            if (this.MouseOverBorderBrush == null)
+            {
+                this.MouseOverBorderBrush = BorderBrush;
+            }
+            if (this.MouseDownBorderBrush == null)
+            {
+                if (this.MouseOverBorderBrush == null)
+                {
+                    this.MouseDownBorderBrush = BorderBrush;
+                }
+                else
+                {
+                    this.MouseDownBorderBrush = MouseOverBorderBrush;
+                }
+            }
+            if (this.MouseOverForeground == null)
+            {
+                this.MouseOverForeground = Foreground;
+            }
+            if (this.MouseDownForeground == null)
+            {
+                if (this.MouseOverForeground == null)
+                {
+                    this.MouseDownForeground = Foreground;
+                }
+                else
+                {
+                    this.MouseDownForeground = this.MouseOverForeground;
+                }
+            }
+            if (this.IconChecked == null)
+            {
+                if (this.IconPress == null)
+                {
+                    this.IconChecked = Icon;
+                }
+                else
+                {
+                    this.IconChecked = this.IconPress;
+                }
+            }
+
+            if (this.IconCheckedFill == null)
+            {
+                if (this.IconPressFill == null)
+                {
+                    this.IconCheckedFill = IconFill;
+                }
+                else
+                {
+                    this.IconCheckedFill = this.IconPressFill;
+                }
+            }
+        }
+
+        #region 依赖项属性  
+
+        /// <summary>  
+        /// 鼠标移上去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBackgroundProperty
+                = DependencyProperty.Register("MouseOverBackground", typeof(Brush), typeof(PathRadioButton));
+
+        /// <summary>  
+        /// 鼠标按下去的背景颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBackgroundProperty
+            = DependencyProperty.Register("MouseDownBackground", typeof(Brush), typeof(PathRadioButton));
+
+        /// <summary>  
+        /// 鼠标移上去的背景颜色透明度 
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBackgroundOpacityProperty
+                = DependencyProperty.Register("MouseOverBackgroundOpacity", typeof(double), typeof(PathRadioButton), new PropertyMetadata(1.0, null));
+
+        /// <summary>  
+        /// 鼠标按下去的背景颜色透明度  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBackgroundOpacityProperty
+            = DependencyProperty.Register("MouseDownBackgroundOpacity", typeof(double), typeof(PathRadioButton), new PropertyMetadata(1.0, null));
+
+        /// <summary>  
+        /// 鼠标移上去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverForegroundProperty
+            = DependencyProperty.Register("MouseOverForeground", typeof(Brush), typeof(PathRadioButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的字体颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownForegroundProperty
+            = DependencyProperty.Register("MouseDownForeground", typeof(Brush), typeof(PathRadioButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标移上去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseOverBorderBrushProperty
+            = DependencyProperty.Register("MouseOverBorderBrush", typeof(Brush), typeof(PathRadioButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 鼠标按下去的边框颜色  
+        /// </summary>  
+        public static readonly DependencyProperty MouseDownBorderBrushProperty
+            = DependencyProperty.Register("MouseDownBorderBrush", typeof(Brush), typeof(PathRadioButton), new PropertyMetadata(null, null));
+
+        /// <summary>  
+        /// 圆角  
+        /// </summary>  
+        public static readonly DependencyProperty CornerRadiusProperty
+            = DependencyProperty.Register("CornerRadius", typeof(CornerRadius), typeof(PathRadioButton), null);
+
+        //图标  
+        public static readonly DependencyProperty IconProperty
+            = DependencyProperty.Register("Icon", typeof(Geometry), typeof(PathRadioButton), null);
+
+        //图标填充色  
+        public static readonly DependencyProperty IconFillProperty
+            = DependencyProperty.Register("IconFill", typeof(Brush), typeof(PathRadioButton), null);
+
+        //图标透明度 
+        public static readonly DependencyProperty IconOpacityProperty
+            = DependencyProperty.Register("IconOpacity", typeof(double), typeof(PathRadioButton), null);
+
+        //选中的图标  
+        public static readonly DependencyProperty IconCheckedProperty
+            = DependencyProperty.Register("IconChecked", typeof(Geometry), typeof(PathRadioButton), null);
+
+        //选中的图标填充色   
+        public static readonly DependencyProperty IconCheckedFillProperty
+            = DependencyProperty.Register("IconCheckedFill", typeof(Brush), typeof(PathRadioButton), null);
+
+        //选中的图标的透明度 
+        public static readonly DependencyProperty IconCheckedOpacityProperty
+            = DependencyProperty.Register("IconCheckedOpacity", typeof(double), typeof(PathRadioButton), null);
+
+        //鼠标移上去的图标  
+        public static readonly DependencyProperty IconMouseOverProperty
+            = DependencyProperty.Register("IconMouseOver", typeof(Geometry), typeof(PathRadioButton), null);
+
+        //鼠标移上去的图标填充色   
+        public static readonly DependencyProperty IconMouseOverFillProperty
+            = DependencyProperty.Register("IconMouseOverFill", typeof(Brush), typeof(PathRadioButton), null);
+
+        //鼠标移上去的透明度 
+        public static readonly DependencyProperty IconMouseOverOpacityProperty
+            = DependencyProperty.Register("IconMouseOverOpacity", typeof(double), typeof(PathRadioButton), null);
+
+        //鼠标按下去的图标
+        public static readonly DependencyProperty IconPressProperty
+            = DependencyProperty.Register("IconPress", typeof(Geometry), typeof(PathRadioButton), null);
+
+        //鼠标按下去的图标填充色   
+        public static readonly DependencyProperty IconPressFillProperty
+            = DependencyProperty.Register("IconPressFill", typeof(Brush), typeof(PathRadioButton), null);
+
+        //鼠标按下去的透明度 
+        public static readonly DependencyProperty IconPressOpacityProperty
+            = DependencyProperty.Register("IconPressOpacity", typeof(double), typeof(PathRadioButton), null);
+
+        //图标高度  
+        public static readonly DependencyProperty IconHeightProperty
+            = DependencyProperty.Register("IconHeight", typeof(double), typeof(PathRadioButton), new PropertyMetadata(24.0, null));
+
+        //图标宽度  
+        public static readonly DependencyProperty IconWidthProperty
+            = DependencyProperty.Register("IconWidth", typeof(double), typeof(PathRadioButton), new PropertyMetadata(24.0, null));
+
+        //图标和内容的对齐方式  
+        public static readonly DependencyProperty IconContentOrientationProperty
+            = DependencyProperty.Register("IconContentOrientation", typeof(Orientation), typeof(PathRadioButton), new PropertyMetadata(Orientation.Horizontal, null));
+
+        //图标和内容的距离  
+        public static readonly DependencyProperty IconContentMarginProperty
+            = DependencyProperty.Register("IconContentMargin", typeof(Thickness), typeof(PathRadioButton), new PropertyMetadata(new Thickness(0, 0, 0, 0), null));
+
+        #endregion
+
+        #region 属性包装 
+
+        public Brush MouseOverBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverBackgroundProperty);
+            }
+            set { SetValue(MouseOverBackgroundProperty, value); }
+        }
+
+        public Brush MouseDownBackground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownBackgroundProperty);
+            }
+            set { SetValue(MouseDownBackgroundProperty, value); }
+        }
+
+        public double MouseOverBackgroundOpacity
+        {
+            get
+            {
+                return (double)GetValue(MouseOverBackgroundOpacityProperty);
+            }
+            set { SetValue(MouseOverBackgroundOpacityProperty, value); }
+        }
+
+        public double MouseDownBackgroundOpacity
+        {
+            get
+            {
+                return (double)GetValue(MouseDownBackgroundOpacityProperty);
+            }
+            set { SetValue(MouseDownBackgroundOpacityProperty, value); }
+        }
+
+        public Brush MouseOverForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseOverForegroundProperty);
+            }
+            set { SetValue(MouseOverForegroundProperty, value); }
+        }
+
+        public Brush MouseDownForeground
+        {
+            get
+            {
+                return (Brush)GetValue(MouseDownForegroundProperty);
+            }
+            set { SetValue(MouseDownForegroundProperty, value); }
+        }
+
+        public Brush MouseOverBorderBrush
+        {
+            get { return (Brush)GetValue(MouseOverBorderBrushProperty); }
+            set { SetValue(MouseOverBorderBrushProperty, value); }
+        }
+
+        public Brush MouseDownBorderBrush
+        {
+            get { return (Brush)GetValue(MouseDownBorderBrushProperty); }
+            set { SetValue(MouseDownBorderBrushProperty, value); }
+        }
+
+        public CornerRadius CornerRadius
+        {
+            get { return (CornerRadius)GetValue(CornerRadiusProperty); }
+            set { SetValue(CornerRadiusProperty, value); }
+        }
+
+        public Geometry Icon
+        {
+            get { return (Geometry)GetValue(IconProperty); }
+            set { SetValue(IconProperty, value); }
+        }
+
+        public Brush IconFill
+        {
+            get { return (Brush)GetValue(IconFillProperty); }
+            set { SetValue(IconFillProperty, value); }
+        }
+
+        public double IconOpacity
+        {
+            get { return (double)GetValue(IconOpacityProperty); }
+            set { SetValue(IconOpacityProperty, value); }
+        }
+
+        public Geometry IconChecked
+        {
+            get { return (Geometry)GetValue(IconCheckedProperty); }
+            set { SetValue(IconCheckedProperty, value); }
+        }
+
+        public Brush IconCheckedFill
+        {
+            get { return (Brush)GetValue(IconCheckedFillProperty); }
+            set { SetValue(IconCheckedFillProperty, value); }
+        }
+
+        public double IconCheckedOpacity
+        {
+            get { return (double)GetValue(IconCheckedOpacityProperty); }
+            set { SetValue(IconCheckedOpacityProperty, value); }
+        }
+        public Geometry IconMouseOver
+        {
+            get { return (Geometry)GetValue(IconMouseOverProperty); }
+            set { SetValue(IconMouseOverProperty, value); }
+        }
+
+        public Brush IconMouseOverFill
+        {
+            get { return (Brush)GetValue(IconMouseOverProperty); }
+            set { SetValue(IconMouseOverProperty, value); }
+        }
+
+        public double IconMouseOverOpacity
+        {
+            get { return (double)GetValue(IconMouseOverProperty); }
+            set { SetValue(IconMouseOverProperty, value); }
+        }
+
+        public Geometry IconPress
+        {
+            get { return (Geometry)GetValue(IconPressProperty); }
+            set { SetValue(IconPressProperty, value); }
+        }
+
+        public Brush IconPressFill
+        {
+            get { return (Brush)GetValue(IconPressFillProperty); }
+            set { SetValue(IconPressFillProperty, value); }
+        }
+
+        public double IconPressOpacity
+        {
+            get { return (double)GetValue(IconPressOpacityProperty); }
+            set { SetValue(IconPressOpacityProperty, value); }
+        }
+
+        public double IconHeight
+        {
+            get { return (double)GetValue(IconHeightProperty); }
+            set { SetValue(IconHeightProperty, value); }
+        }
+
+        public double IconWidth
+        {
+            get { return (double)GetValue(IconWidthProperty); }
+            set { SetValue(IconWidthProperty, value); }
+        }
+
+        public Orientation IconContentOrientation
+        {
+            get { return (Orientation)GetValue(IconContentOrientationProperty); }
+            set { SetValue(IconContentOrientationProperty, value); }
+        }
+
+        public Thickness IconContentMargin
+        {
+            get { return (Thickness)GetValue(IconContentMarginProperty); }
+            set { SetValue(IconContentMarginProperty, value); }
+        }
+
+        #endregion
+    }
+}

+ 87 - 0
PDF Office/CustomControl/ScanViewControl/CustomDraw.cs

@@ -0,0 +1,87 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media;
+
+namespace PDF_Office.CustomControl.ScanViewControl
+{
+    class CustomDraw : DrawingVisual
+    {
+        public Rect PaintRect;
+        public Rect RawRect;
+        public string PaintText;
+        public double FontSize = 0;
+        private Pen DrawPen;
+        private SolidColorBrush CoverBrush = Brushes.Transparent;// new SolidColorBrush(Color.FromArgb(0x01, 0xFF, 0xFF, 0xFF));
+        public CustomDraw()
+        {
+            DrawPen = new Pen(Brushes.Red, 1);
+        }
+
+        public void Draw()
+        {
+            DrawingContext dc = RenderOpen();
+            dc.DrawRectangle(null, DrawPen, PaintRect);
+            if (string.IsNullOrEmpty(PaintText) == false)
+            {
+                double fontSize = 1;
+                FormattedText formatText = new FormattedText(PaintText,
+                    CultureInfo.CurrentCulture,
+                    FlowDirection.LeftToRight,
+                    new Typeface(new FontFamily("Arial"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal),
+                    fontSize,
+                    Brushes.Green,Helper.DpiHelpers.Dpi/96F);
+                while (formatText.Width + fontSize < PaintRect.Width && formatText.Height < PaintRect.Height)
+                {
+                    fontSize += 1;
+                    formatText.SetFontSize(fontSize);
+                }
+                if (fontSize > 1)
+                {
+                    formatText.SetFontSize(fontSize - 1);
+                }
+                FontSize = fontSize;
+                dc.DrawRectangle(Brushes.White, null, PaintRect);
+                Array x = PaintText.ToCharArray();
+                double w = 0;
+
+                List<FormattedText> drawFormatList = new List<FormattedText>();
+                for (int i = 0; i < x.Length; i++)
+                {
+                    FormattedText formatText1 = new FormattedText(x.GetValue(i).ToString(),
+                    CultureInfo.CurrentCulture,
+                    FlowDirection.LeftToRight,
+                    new Typeface(new FontFamily("Arial"), FontStyles.Normal, FontWeights.Normal, FontStretches.Normal),
+                    fontSize,
+                    Brushes.Green, Helper.DpiHelpers.Dpi / 96F);
+                    formatText1.SetFontSize(fontSize);
+                    w += formatText1.Width;
+                    drawFormatList.Add(formatText1);
+                }
+
+                Point startPos = new Point(PaintRect.Left, (int)(PaintRect.Top));
+                double subLength = PaintRect.Width - w;
+                double offset = subLength / x.Length;
+
+                foreach (FormattedText subFormat in drawFormatList)
+                {
+                    dc.DrawText(subFormat, startPos);
+                    startPos.X += subFormat.Width + offset;
+                }
+
+            }
+            dc.Close();
+        }
+
+        public void DrawBounds()
+        {
+            DrawingContext dc = RenderOpen();
+            dc.DrawRectangle(CoverBrush, DrawPen, PaintRect);
+            dc.Close();
+        }
+    }
+}

+ 223 - 0
PDF Office/CustomControl/ScanViewControl/CustomPanel.cs

@@ -0,0 +1,223 @@
+using PDF_Office.Helper;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+
+namespace PDF_Office.CustomControl.ScanViewControl
+{
+    class CustomPanel: Panel
+    {
+        public SolidColorBrush CoverBrush { get; set; } = new SolidColorBrush(Color.FromArgb(0xA0, 0xFF, 0xFF, 0xFF));
+        public bool DrawCover { get; set; } = false;
+
+        private WriteableBitmap BackgroundImage = null;
+        private int BackgroundWidth = 0;
+        private int BackgroundHeight = 0;
+        private Point OffsetPos = new Point(0, 0);
+        private double ScaleRate = 1;
+        private CustomDraw HoverChild = null;
+        public TextBlock ParentBlock;
+        private int RawWidth = 0;
+        private int RawHeight = 0;
+
+
+        /// <summary>
+        /// 展示用的背景图
+        /// </summary>
+        public WriteableBitmap BGImage
+        {
+            get { return (WriteableBitmap)GetValue(BGImageProperty); }
+            set 
+            { 
+                SetValue(BGImageProperty, value); 
+            }
+        }
+
+        // Using a DependencyProperty as the backing store for BGImage.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty BGImageProperty =
+            DependencyProperty.Register("BGImage", typeof(WriteableBitmap), typeof(CustomPanel), new FrameworkPropertyMetadata(null,new PropertyChangedCallback(OnImageChanged)));
+
+        private static void OnImageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            if ((e.NewValue as  WriteableBitmap)!=null)
+            {
+                (d as CustomPanel).SetBackgroundImage(e.NewValue as WriteableBitmap);
+            }
+        }
+
+
+        /// <summary>
+        ///  当前页的OCR结果
+        /// </summary>
+        public List<KeyValuePair<Rect, string>> OCRTextRectList
+        {
+            get { return (List<KeyValuePair<Rect, string>>)GetValue(OCRTextRectListProperty); }
+            set { SetValue(OCRTextRectListProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for OCRTextRectList.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty OCRTextRectListProperty =
+            DependencyProperty.Register("OCRTextRectList", typeof(List<KeyValuePair<Rect, string>>), typeof(CustomPanel), new FrameworkPropertyMetadata(null, new PropertyChangedCallback(OnOCRChanged)));
+
+        private static void OnOCRChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            if ((e.NewValue as List<KeyValuePair<Rect, string>>) != null)
+            {
+                (d as CustomPanel).SetTextsRects(e.NewValue as List<KeyValuePair<Rect, string>>);
+            }
+        }
+
+        private List<CustomDraw> VisualControlList = new List<CustomDraw>();
+        protected override int VisualChildrenCount => VisualControlList.Count;
+        protected override Visual GetVisualChild(int index)
+        {
+            return VisualControlList[index];
+        }
+        protected override void OnRender(DrawingContext dc)
+        {
+            Rect drawRect = new Rect(0, 0, ActualWidth, ActualHeight);
+            dc.DrawRectangle(Brushes.LightGray, null, drawRect);
+            DrawBackground(dc);
+        }
+
+        protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
+        {
+            double scale = Math.Min(sizeInfo.NewSize.Width / BackgroundWidth, sizeInfo.NewSize.Height / BackgroundHeight);
+            scale = Math.Min(scale, 1);
+            int drawWidth = (int)(scale * BackgroundWidth);
+            int drawHeight = (int)(scale * BackgroundHeight);
+            if (drawWidth < 10 || drawHeight < 10)
+            {
+                return;
+            }
+
+            int offsetX = (int)((sizeInfo.NewSize.Width - drawWidth) / 2);
+            int offsetY = (int)((sizeInfo.NewSize.Height - drawHeight) / 2);
+            foreach (CustomDraw drawVisual in VisualControlList)
+            {
+                Rect paintRect = drawVisual.RawRect;
+                drawVisual.PaintRect = new Rect((int)(paintRect.Left * scale + offsetX),
+                   (int)(paintRect.Top * scale + offsetY),
+                   (int)(paintRect.Width * scale),
+                   (int)(paintRect.Height * scale));
+                drawVisual.Draw();
+            }
+        }
+
+        private void DrawBackground(DrawingContext dc)
+        {
+            if (BackgroundImage != null && BackgroundWidth > 0 && BackgroundHeight > 0)
+            {
+                double scale = Math.Min(ActualWidth / BackgroundWidth, ActualHeight / BackgroundHeight);
+                scale = Math.Min(scale, 1);
+                int drawWidth = (int)(scale * BackgroundWidth);
+                int drawHeight = (int)(scale * BackgroundHeight);
+                if (drawWidth < 10 || drawHeight < 10)
+                {
+                    return;
+                }
+                ScaleRate = scale;
+                OffsetPos.X = (int)((ActualWidth - drawWidth) / 2);
+                OffsetPos.Y = (int)((ActualHeight - drawHeight) / 2);
+                Rect drawRect = new Rect(OffsetPos.X, OffsetPos.Y, drawWidth, drawHeight);
+                dc.DrawImage(BackgroundImage, drawRect);
+                if (DrawCover)
+                {
+                    dc.DrawRectangle(CoverBrush, null, drawRect);
+                }
+            }
+        }
+
+        private void CleanChild()
+        {
+            foreach (DrawingVisual child in VisualControlList)
+            {
+                RemoveLogicalChild(child);
+                RemoveVisualChild(child);
+            }
+            VisualControlList.Clear();
+        }
+
+        public void SetBackgroundImage(WriteableBitmap bgImage)
+        {
+            DrawCover = false;
+            BackgroundImage = bgImage;
+            BackgroundWidth = 0;
+            BackgroundHeight = 0;
+            RawWidth = 0;
+            RawHeight = 0;
+            OffsetPos = new Point(0, 0);
+            CleanChild();
+            if (BackgroundImage != null && BackgroundImage.PixelHeight > 0 && BackgroundImage.PixelWidth > 0)
+            {
+                RawWidth = BackgroundImage.PixelWidth;
+                RawHeight = BackgroundImage.PixelHeight;
+                BackgroundWidth = DpiHelpers.GetDpiUnrelatedNum(BackgroundImage.PixelWidth);
+                BackgroundHeight = DpiHelpers.GetDpiUnrelatedNum(BackgroundImage.PixelHeight);
+
+                double scale = Math.Min(ActualWidth / BackgroundWidth, ActualHeight / BackgroundHeight);
+                scale = Math.Min(scale, 1);
+                int drawWidth = (int)(scale * BackgroundWidth);
+                int drawHeight = (int)(scale * BackgroundHeight);
+                if (drawWidth < 10 || drawHeight < 10)
+                {
+                    return;
+                }
+                ScaleRate = scale;
+                OffsetPos.X = (int)((ActualWidth - drawWidth) / 2);
+                OffsetPos.Y = (int)((ActualHeight - drawHeight) / 2);
+
+                InvalidateVisual();
+            }
+        }
+
+        public int GetBackgroundImageWidth()
+        {
+            if (BackgroundImage != null)
+            {
+                return RawWidth;
+            }
+            return 0;
+        }
+
+        public int GetBackgroundImageHeight()
+        {
+            if (BackgroundImage != null)
+            {
+                return RawHeight;
+            }
+            return 0;
+        }
+
+        public void SetTextsRects(List<KeyValuePair<Rect, string>> textsRect)
+        {
+            CleanChild();
+            foreach (KeyValuePair<Rect, string> textRect in textsRect)
+            {
+                CustomDraw drawVisual = new CustomDraw();
+                drawVisual.PaintText = textRect.Value;
+                Rect paintRect = DpiHelpers.GetDpiUnrelatedRect(textRect.Key);
+                drawVisual.RawRect = paintRect;
+                drawVisual.PaintRect = new Rect((int)(paintRect.Left * ScaleRate + OffsetPos.X),
+                    (int)(paintRect.Top * ScaleRate + OffsetPos.Y),
+                    (int)(paintRect.Width * ScaleRate),
+                    (int)(paintRect.Height * ScaleRate));
+                drawVisual.Draw();
+                VisualControlList.Add(drawVisual);
+                AddLogicalChild(drawVisual);
+                AddVisualChild(drawVisual);
+            }
+        }
+
+        public void RePaint()
+        {
+            InvalidateVisual();
+        }
+    }
+}

+ 14 - 0
PDF Office/CustomControl/TextBoxEx.cs

@@ -125,5 +125,19 @@ namespace PDF_Office.CustomControl
         // Using a DependencyProperty as the backing store for TipText.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty TipTextProperty =
             DependencyProperty.Register("TipText", typeof(string), typeof(TextBoxEx), new PropertyMetadata(""));
+
+
+
+        public bool ShowClose
+        {
+            get { return (bool)GetValue(ShowCloseProperty); }
+            set { SetValue(ShowCloseProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for ShowClose.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty ShowCloseProperty =
+            DependencyProperty.Register("ShowClose", typeof(bool), typeof(TextBoxEx), new PropertyMetadata(true));
+
+
     }
 }

+ 3 - 2
PDF Office/CustomControl/TextBoxWithTip.xaml

@@ -16,13 +16,13 @@
                         <Grid>
                             <Grid.RowDefinitions>
                                 <RowDefinition Height="*" />
-                                <RowDefinition Height="20" />
+                                <RowDefinition MaxHeight="30" />
                             </Grid.RowDefinitions>
                             <local:TextBoxEx
                                 x:Name="TextBox"
                                 IsError="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:TextBoxWithTip}, Path=IsError}"
                                 PlaceholderText="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:TextBoxWithTip}, Path=PlaceHoldText}"
-                                Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:TextBoxWithTip}, Path=Text}" />
+                                Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:TextBoxWithTip}, Path=Text, UpdateSourceTrigger=PropertyChanged}" />
                             <TextBlock
                                 Name="TbTip"
                                 Grid.Row="1"
@@ -31,6 +31,7 @@
                                 FontSize="12"
                                 Foreground="{StaticResource color.field.text.tips}"
                                 Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:TextBoxWithTip}, Path=TipText}"
+                                TextWrapping="Wrap"
                                 Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:TextBoxWithTip}, Path=ShowTip}" />
                         </Grid>
                         <ControlTemplate.Triggers>

+ 1 - 1
PDF Office/CustomControl/TextBoxWithTip.xaml.cs

@@ -54,7 +54,7 @@ namespace PDF_Office.CustomControl
 
         // Using a DependencyProperty as the backing store for Text.  This enables animation, styling, binding, etc...
         public static readonly DependencyProperty TextProperty =
-            DependencyProperty.Register("Text", typeof(string), typeof(TextBoxWithTip), new PropertyMetadata(null));
+            DependencyProperty.Register("Text", typeof(string), typeof(TextBoxWithTip), new PropertyMetadata(""));
 
         public string PlaceHoldText
         {

+ 11 - 9
PDF Office/CustomControl/WritableComboBox.xaml

@@ -5,25 +5,23 @@
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Office.CustomControl"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-    d:DesignHeight="32"
+    d:DesignHeight="24"
     d:DesignWidth="200"
     mc:Ignorable="d">
     <Grid>
-
-
         <ComboBox
             x:Name="writableComboBox"
             Grid.Column="1"
             MinWidth="58"
-            MinHeight="32"
+            MinHeight="24"
             VerticalContentAlignment="Center"
-            SelectionChanged="writableComboBox_SelectionChanged"
             SelectedIndex="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=SelectedIndex}"
+            SelectionChanged="writableComboBox_SelectionChanged"
             Visibility="Visible">
-            <ComboBoxItem Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=IsAllPageVisible}">全部页面</ComboBoxItem>
-            <ComboBoxItem>奇数页</ComboBoxItem>
-            <ComboBoxItem>偶数页</ComboBoxItem>
-            <ComboBoxItem>自定义页面</ComboBoxItem>
+            <ComboBoxItem Tag="AllPage" Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=IsAllPageVisible}">全部页面</ComboBoxItem>
+            <ComboBoxItem Tag="OddPage">奇数页</ComboBoxItem>
+            <ComboBoxItem IsEnabled="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=EvenPageIsEnabled}" Tag="EvenPage">偶数页</ComboBoxItem>
+            <ComboBoxItem Tag="CustomPage">自定义页面</ComboBoxItem>
         </ComboBox>
         <TextBox
             x:Name="writableTextBox"
@@ -31,6 +29,10 @@
             MinHeight="{Binding ElementName=writableComboBox, Path=MinHeight}"
             HorizontalAlignment="Left"
             VerticalContentAlignment="Center"
+            Panel.ZIndex="1"
+            LostFocus="writableTextBox_LostFocus"
+            PreviewKeyDown="writableTextBox_PreviewKeyDown"
+            Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:WritableComboBox}, Path=Text}"
             TextChanged="writableTextBox_TextChange"
             Visibility="Hidden" />
     </Grid>

+ 130 - 0
PDF Office/CustomControl/WritableComboBox.xaml.cs

@@ -1,5 +1,6 @@
 using ImTools;
 using Newtonsoft.Json.Linq;
+using PDF_Office.Helper;
 using System;
 using System.Collections.Generic;
 using System.Diagnostics;
@@ -71,6 +72,16 @@ namespace PDF_Office.CustomControl
         public static readonly DependencyProperty CurrentPageProperty =
             DependencyProperty.Register("CurrentPage", typeof(bool), typeof(WritableComboBox), new PropertyMetadata(false));
 
+        public bool EvenPageIsEnabled
+        {
+            get { return (bool)GetValue(EvenPageIsEnabledProperty); }
+            set { SetValue(EvenPageIsEnabledProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty EvenPageIsEnabledProperty =
+            DependencyProperty.Register("EvenPageIsEnabled", typeof(bool), typeof(WritableComboBox), new PropertyMetadata(true));
+
         public string SelectedIndex
         {
             get { return (string)GetValue(SelectedIndexProperty); }
@@ -92,6 +103,33 @@ namespace PDF_Office.CustomControl
 
             DependencyProperty.Register("Text", typeof(string), typeof(WritableComboBox), new PropertyMetadata(""));
 
+
+        private List<int> pageIndexList = new List<int>();
+
+        public List<int> PageIndexList
+        {
+            private get { return (List<int>)GetValue(PageIndexListProperty); }
+            set { SetValue(PageIndexListProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for PageIndexList.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty PageIndexListProperty =
+            DependencyProperty.Register("PageIndexList", typeof(List<int>), typeof(WritableComboBox), new PropertyMetadata(new List<int>()));
+
+
+
+        public int MaxPageRange
+        {
+            get { return (int)GetValue(MaxPageRangeProperty); }
+            set { SetValue(MaxPageRangeProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for MaxPageRange.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty MaxPageRangeProperty =
+            DependencyProperty.Register("MaxPageRange", typeof(int), typeof(WritableComboBox), new PropertyMetadata(0));
+
+
+
         public ItemCollection Items
         {
             get { return (ItemCollection)GetValue(ItemsProperty); }
@@ -124,8 +162,10 @@ namespace PDF_Office.CustomControl
 
         private void writableComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
+            
             if (this.writableComboBox.SelectedIndex == this.writableComboBox.Items.Count - 1)
             {
+                if (this.writableComboBox.ActualWidth == 0) { this.writableTextBox.Width = 210; this.writableTextBox.Visibility = Visibility.Visible; return; }
                 this.writableTextBox.Width = this.writableComboBox.ActualWidth - 18;
                 Trace.WriteLine(this.writableComboBox.ActualWidth);
                 this.writableTextBox.Visibility = Visibility.Visible;
@@ -149,6 +189,75 @@ namespace PDF_Office.CustomControl
                 }
             }
             this.SelectedIndex = this.writableComboBox.SelectedIndex.ToString();
+            if (writableComboBox.SelectedItem as ComboBoxItem == null)
+            {
+                return;
+            }
+
+            switch ((writableComboBox.SelectedItem as ComboBoxItem).Tag.ToString())
+            {
+                case "AllPage":
+                    if (CommonHelper.GetPagesInRange(ref pageIndexList, "1-" + MaxPageRange, MaxPageRange, new char[] { ',' }, new char[] { '-' }))
+                    {
+                        PageIndexList = pageIndexList;
+                        Text = "1-" + MaxPageRange;
+                    }
+                    break;
+                case "OddPage":
+                    {
+                        string pageRange = "";
+                        for (int i = 1; i <= MaxPageRange; i++)
+                        {
+                            if (i % 2 != 0 || MaxPageRange == 1)
+                            {
+                                if (string.IsNullOrEmpty(pageRange))
+                                {
+                                    pageRange = i.ToString();
+                                }
+                                else
+                                {
+                                    pageRange += "," + i;
+                                }
+                            }
+
+                        }
+                        if (CommonHelper.GetPagesInRange(ref pageIndexList, pageRange, MaxPageRange, new char[] { ',' }, new char[] { '-' }))
+                        {
+                            PageIndexList = pageIndexList;
+                            Text = pageRange;
+                        }
+                        break;
+                    }
+                case "EvenPage":
+                    {
+                        string pageRange = "";
+                        for (int i = 1; i <= MaxPageRange; i++)
+                        {
+                            if (i % 2 == 0 || MaxPageRange == 1)
+                            {
+                                if (string.IsNullOrEmpty(pageRange))
+                                {
+                                    pageRange = i.ToString();
+                                }
+                                else
+                                {
+                                    pageRange += "," + i;
+                                }
+                            }
+
+                        }
+                        if (CommonHelper.GetPagesInRange(ref pageIndexList, pageRange, MaxPageRange, new char[] { ',' }, new char[] { '-' }))
+                        {
+                            PageIndexList = pageIndexList;
+                            Text = pageRange;
+                        }
+                        break;
+                    }
+                case "CustomPage":
+                    break;
+                default:
+                    break;
+            }
 
             SelectionChanged?.Invoke(sender, e);
         }
@@ -164,5 +273,26 @@ namespace PDF_Office.CustomControl
 
             TextChanged?.Invoke(sender, e);
         }
+
+        private void writableTextBox_LostFocus(object sender, RoutedEventArgs e)
+        {
+            if (CommonHelper.GetPagesInRange(ref pageIndexList, writableTextBox.Text, MaxPageRange, new char[] { ',' }, new char[] { '-' }))
+            {
+                PageIndexList = pageIndexList;
+                Text = writableTextBox.Text;
+            }
+            else
+            {
+                writableTextBox.Text = "";
+            }
+        }
+
+        private void writableTextBox_PreviewKeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Enter)
+            {
+                writableComboBox.Focus();
+            }
+        }
     }
 }

+ 30 - 0
PDF Office/DataConvert/CenterToolTipConverter .cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class CenterToolTipConverter : IMultiValueConverter
+    {
+        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (values.FirstOrDefault(v => v == DependencyProperty.UnsetValue) != null)
+            {
+                return double.NaN;
+            }
+            double placementTargetWidth = (double)values[0];
+            double toolTipWidth = (double)values[1];
+            return (placementTargetWidth / 4.0*3) - (toolTipWidth / 2.0);
+        }
+
+        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+        {
+            throw new NotSupportedException();
+        }
+    }
+}

+ 35 - 0
PDF Office/DataConvert/ColorBrushConvert.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+using System.Windows.Media;
+
+namespace PDF_Office.DataConvert
+{
+    /// <summary>
+    /// Color to SolidColorBrush
+    /// </summary>
+    public class ColorBrushConvert : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if((Color)value!=null)
+            {
+                return new SolidColorBrush((Color)value);
+            }
+            return Brushes.White;
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+           if((SolidColorBrush)value!=null)
+            {
+                return ((SolidColorBrush)value).Color;
+            }
+            return Brushes.White.Color;
+        }
+    }
+}

+ 27 - 0
PDF Office/DataConvert/IndexConverter .cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Controls;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class IndexConverter : IValueConverter
+    {
+        public object Convert(object value, Type TargetType, object parameter, CultureInfo culture)
+        {
+            ListViewItem item = (ListViewItem)value;
+            ListView listView = ItemsControl.ItemsControlFromItemContainer(item) as ListView;
+            int index = listView.ItemContainerGenerator.IndexFromContainer(item) + 1;
+            return index.ToString();
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 17 - 1
PDF Office/DataConvert/InvertBoolConvert.cs

@@ -32,7 +32,23 @@ namespace PDF_Office.DataConvert
 
         public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
         {
-            throw new NotImplementedException();
+
+            if (value is bool)
+            {
+                if ((bool)value)
+                {
+                    return false;
+                }
+                else
+                {
+                    return true;
+                }
+            }
+            else
+            {
+                return false;
+            }
+
         }
     }
 }

+ 38 - 0
PDF Office/DataConvert/ListCountToVisible.cs.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class ListCountToVisible : IValueConverter
+    {
+        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (value == null)
+            {
+                return Visibility.Collapsed;
+            }
+            else
+            {
+                if ((int)value==0)
+                {
+                    return Visibility.Visible;
+                }
+                else
+                {
+                    return Visibility.Collapsed;
+                }
+            }
+        }
+
+        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 26 - 0
PDF Office/EventAggregators/RedactionCommandEvent.cs

@@ -0,0 +1,26 @@
+using ComPDFKitViewer.AnnotEvent;
+using Prism.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.EventAggregators
+{
+    public class RedactionCommandEventArgs
+    {
+        public string UniCode { get; set; }
+
+        public object Sender { get; set; }
+
+        public AnnotCommandArgs args { get; set; }
+    }
+
+    /// <summary>
+    /// 绑定标记密文右键菜单的事件
+    /// </summary>
+    public class RedactionCommandEvent: PubSubEvent<RedactionCommandEventArgs>
+    {
+    }
+}

+ 94 - 0
PDF Office/EventAggregators/ScanEvent.cs

@@ -0,0 +1,94 @@
+using Prism.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.EventAggregators
+{
+    public enum ScanMode
+    {
+        Unknown,
+        /// <summary>
+        /// 点击OCR按钮
+        /// </summary>
+        OCR,
+        /// <summary>
+        /// 区域识别
+        /// </summary>
+        Area
+    }
+
+    public enum ScanLanguageMode
+    {
+        /// <summary>
+        /// 简体中文
+        /// </summary>
+        ChineseS,
+        /// <summary>
+        /// 繁体中文
+        /// </summary>
+        ChineseT,
+        English,
+        French,
+    }
+    public class ScanEventArgs
+    {
+        private ScanMode mode = ScanMode.Unknown;
+        public ScanMode Mode 
+        {
+            get
+            {
+                return mode;
+            }
+            set
+            {
+                mode = value;
+            }
+        }
+
+        private ScanLanguageMode scanLanguage = ScanLanguageMode.English;
+        public ScanLanguageMode ScanLanguage 
+        { 
+            get
+            {
+                return scanLanguage;
+            }
+            set
+            {
+                scanLanguage = value;
+            } 
+        }
+
+        private List<int> pageRange ;
+        public List<int> PageRange 
+        {
+            get
+            {
+                return pageRange;
+            }
+            set
+            {
+                pageRange = value;
+            }
+        }
+
+        private string unicode = "";
+        public string Unicode 
+        {
+            get
+            {
+                return unicode;
+            }
+            set 
+            {
+                unicode = value;
+            }
+        }
+    }
+    class ScanEvent : PubSubEvent<ScanEventArgs>
+    {
+
+    }
+}

+ 50 - 2
PDF Office/EventAggregators/SendPrintInfoEvent.cs

@@ -4,18 +4,66 @@ using Prism.Events;
 using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Printing;
 using System.Security.Cryptography.X509Certificates;
 using System.Text;
 using System.Threading.Tasks;
 
 namespace PDF_Office.EventAggregators
 {
-    public class SendPrintSettingsInfoEvent:PubSubEvent<PrintSettingsInfo>
+
+    public class PrintSettingsInfoWithUnicode
+    {
+        public PrintSettingsInfo printSettingsInfo;
+        public string Unicode;
+    }
+
+    public class PrintModInfoWithUnicode
+    {
+        public PrintModInfo printModInfo;
+        public string Unicode;
+    }
+
+    public class PrintQueueWithUnicode
     {
+        public PrintQueue printQueue;
+        public EnumBothSidesStage EnumBothSidesStage;
+        public string Unicode;
     }
 
-    public class SendPrintSettingsModInfoEvent:PubSubEvent<PrintModInfo>
+    public class LabelWithUnicode
     {
+        public string Label;
+        public string Unicode;
+    }
+
+    public class EnumDuplexPrintModWithUnicode
+    {
+        public EnumDuplexPrintMod enumDuplexPrintMod;
+        public string Unicode;
+    }
+
+    public class GetCurrentViewEvent
+    {
+    }
 
+    public class SendPrintSettingsInfoEvent : PubSubEvent<PrintSettingsInfoWithUnicode>
+    {
+    }
+
+    public class SendPrintSettingsModInfoEvent : PubSubEvent<PrintModInfoWithUnicode>
+    {
+    }
+
+    public class SendPrintQueueEvent : PubSubEvent<PrintQueueWithUnicode>
+    {
+    }
+
+    public class SendLabelEvent : PubSubEvent<LabelWithUnicode>
+    {
+    }
+
+    public class SendDuplexPrintModEvent : PubSubEvent<EnumDuplexPrintModWithUnicode>
+    {
     }
 }

+ 39 - 0
PDF Office/EventAggregators/SplitEvent.cs

@@ -0,0 +1,39 @@
+using Prism.Events;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.EventAggregators
+{
+    public enum SplitMode
+    {
+        /// <summary>
+        /// 垂直分屏
+        /// </summary>
+        Vertical,
+        /// <summary>
+        /// 水平分屏
+        /// </summary>
+        Horizontal,
+        /// <summary>
+        /// 单屏(退出分屏)
+        /// </summary>
+        Single
+    }
+
+    public class SplitEventArgs
+    {
+        public SplitMode Mode { get; set; }
+
+        public string Unicode { get; set; }
+    }
+
+    /// <summary>
+    /// 通知分屏的事件
+    /// </summary>
+    public class SplitEvent: PubSubEvent<SplitEventArgs>
+    {
+    }
+}

+ 51 - 2
PDF Office/Helper/CacheFilePath.cs

@@ -1,4 +1,6 @@
-using PDF_Office.Properties;
+using ComPDFKit.PDFDocument;
+using PDF_Office.Properties;
+using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -13,7 +15,7 @@ namespace PDF_Office.Helper
     /// 功能模块需要创建缓存文件夹时,统一在此类里处理
     /// 临时文件在app启动时进行删除
     /// </summary>
-    public class CacheFilePath
+    public class CacheFilePath:BindableBase
     {
         private static readonly CacheFilePath instance = new CacheFilePath();
 
@@ -23,6 +25,22 @@ namespace PDF_Office.Helper
         List<string> CustomStamp = new List<string> { "CustomStamp" };
         List<string> SignatureFreeHand = new List<string> { "Signature" ,"FreeHand" };
         List<string> SignatureStamp = new List<string> { "Signature", "Stamp" };
+        List<string> MergeFile = new List<string> { "Temp" };
+
+        private CPDFDocument copyDoc;
+        /// <summary>
+        /// 页面编辑复制粘贴的临时缓存文件
+        /// </summary>
+        public CPDFDocument CopyDoc
+        {
+            get { return copyDoc; }
+            set
+            {
+                SetProperty(ref copyDoc, value);
+            }
+        }
+
+
         public static CacheFilePath Instance => instance;
 
         private CacheFilePath()
@@ -30,6 +48,14 @@ namespace PDF_Office.Helper
 
         }
 
+        ~ CacheFilePath()
+        {
+            if(CopyDoc!=null)
+            {
+                CopyDoc.Release();
+            }
+        }
+
         /// <summary>
         /// 自定图章缓存文件夹
         /// </summary>
@@ -61,6 +87,18 @@ namespace PDF_Office.Helper
                return CreateCacheDirectory(SignatureFreeHand);
             }
         }
+
+        /// <summary>
+        /// 合并文件的缓存文件夹
+        /// </summary>
+        public string MergeFilePath
+        {
+            get
+            {
+               return CreateCacheDirectory(MergeFile);
+            }
+        }
+        
         /// <summary>
         ///  在“文档”路径下创建缓存文件夹,传C:\Users\kdan\Documents\PDF Office 以后的文件夹名
         /// </summary>
@@ -138,6 +176,17 @@ namespace PDF_Office.Helper
                     }
                 }
                 Settings.Default.AppProperties.NeedToDeletePath.Clear();
+
+                //清楚Temp 文件夹下的临时文件
+                DirectoryInfo tempfolder = new DirectoryInfo(Path.Combine(App.CurrentPath, "Temp"));
+                if (tempfolder.Exists)
+                {
+                    foreach (var file in tempfolder.GetFiles())
+                    {
+                        if (file.Exists)
+                            file.Delete();
+                    }
+                }
             }
             catch { }
         }

+ 110 - 2
PDF Office/Helper/ConverterHelper.cs

@@ -11,6 +11,8 @@ using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
 using ComPDFKit_Conversion.Options;
 using PDF_Office.CustomControl;
 using Exception = System.Exception;
+using ImageMagick;
+using System.IO.Compression;
 
 namespace PDF_Office.Helper
 {
@@ -166,7 +168,84 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static async Task<bool> ImgConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists,string pawssword, ImgType type)
+        public static void ImageMagickPDFToImage(string imageType,string filePath,string outputFolder,string outputFileName) {
+            ZipFile.ExtractToDirectory(filePath, outputFolder + "\\" + outputFileName);
+            var files = Directory.GetFiles(outputFolder + "\\" + outputFileName, "*.png");
+            int i=0;
+            var images = new MagickImageCollection();
+            foreach (var file in files)
+            {
+                //pdf整体转为gif,将.gifoff改为.gif
+                Trace.WriteLine(file);
+                if (imageType == ".gifoff") {
+                    images.Add(file);
+                    images[i].AnimationDelay = 100; // in this example delay is 1000ms/1sec
+                    images[i].Flip();
+                }
+                
+                using (var image = new MagickImage(file))
+                {
+                    if (imageType != ".gifoff")
+                    {
+                    //Save frame as jpg
+                    //image.Format = MagickFormat.Jp2;
+                    image.Write(file.Remove(file.LastIndexOf(".png"), 4) + imageType);
+                    }
+                    // 删除该文件
+                    System.IO.File.Delete(file);
+                }
+            }
+            if (imageType == ".gifoff")
+            {
+                // Optionally reduce colors
+                var settings = new QuantizeSettings();
+                settings.Colors = 256;
+                images.Quantize(settings);
+
+                // Optionally optimize the images (images should have the same size).
+                images.Optimize();
+
+                // Save gif
+                int fileIndex = 1;
+                if (File.Exists(outputFolder + "\\" + outputFileName + ".gif"))
+                {
+                    while (fileIndex >= 1)
+                    {
+                        if (!File.Exists(outputFolder + "\\" + outputFileName + "_" + fileIndex + ".gif"))
+                        {
+                            images.Write(outputFolder + "\\" + outputFileName + ".gif");
+                            fileIndex = -1;
+                        }
+                        fileIndex++;
+                    }
+                }
+                else { images.Write(outputFolder + "\\" + outputFileName + ".gif"); }
+               
+            }
+            else {
+                int fileIndex = 1;
+                
+                if (File.Exists(outputFolder + "\\" + outputFileName + ".zip"))
+                {
+                    while (fileIndex>=1) {
+                        if (!File.Exists(outputFolder + "\\" + outputFileName + "_" + fileIndex + ".zip"))
+                        {
+                            ZipFile.CreateFromDirectory(outputFolder + "\\" + outputFileName, outputFolder + "\\" + outputFileName + "_" + fileIndex + ".zip");
+                            fileIndex=-1;
+                        }
+                        fileIndex++;
+                    }
+                }
+                else { ZipFile.CreateFromDirectory(outputFolder + "\\" + outputFileName, outputFolder + "\\" + outputFileName + ".zip"); }
+                
+            }
+            DirectoryInfo di = new DirectoryInfo(outputFolder + "\\" + outputFileName);
+            di.Delete(true);
+
+
+        }       
+
+        public static async Task<bool> ImgConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists,string pawssword, ImgType type,string imageType=".png")
         {
             bool result = false;
             try
@@ -177,7 +256,36 @@ namespace PDF_Office.Helper
                 string outputFolder = outputpath;
                 string outputFileName = Path.GetFileNameWithoutExtension(inputpath);
                 ConvertError error = ConvertError.ERR_UNKNOWN;
-                result = await Task.Run(() => imgConverter.Convert(outputFolder, ref outputFileName, pageArray, type, ref error, getProgress));
+                if (imageType == ".png" || imageType == ".jpg")
+                {
+                    result = await Task.Run(() => imgConverter.Convert(outputFolder, ref outputFileName, pageArray, type, ref error, getProgress));
+                }
+                else
+                { //创建缓存文件夹
+                   
+                    string folderPath = Path.Combine(App.CurrentPath, "ConverterImg");
+                    //有可能因为其他原因存在同名文件,导致创建文件夹失败,需要先删除同名文件
+                    //保险措施(猜测)
+                    if (File.Exists(folderPath))
+                    {
+                        File.Delete(folderPath);
+                    }
+
+                    DirectoryInfo tempfolder = new DirectoryInfo(folderPath);
+                    if (!tempfolder.Exists)
+                    {
+                        tempfolder.Create();
+                    }
+
+                    //预览图缓存
+                    string saveName = Guid.NewGuid().ToString();
+                    string savePath = Path.Combine(folderPath, saveName);
+                     result = await Task.Run(() => imgConverter.Convert(folderPath, ref saveName, pageArray, type, ref error, getProgress));
+                    ImageMagickPDFToImage(imageType, saveName, outputFolder, outputFileName);
+                    DirectoryInfo di = new DirectoryInfo(folderPath);
+                    di.Delete(true);
+                }
+                
                 if (result)
                 {
                     if (File.Exists(outputFileName))

+ 1 - 1
PDF Office/Helper/DpiHelpers.cs

@@ -87,7 +87,7 @@ namespace PDF_Office.Helper
         {
             Rect standRect = new Rect(GetDpiUnrelatedNum(oldValue.Left), GetDpiUnrelatedNum(oldValue.Top),
                 GetDpiUnrelatedNum(oldValue.Width), GetDpiUnrelatedNum(oldValue.Height));
-            return new Rect(standRect.Left * 72D / 96D, standRect.Top * 72D / 96D, standRect.Width * 72D / 96D, standRect.Height * 72D / 96D);
+            return new Rect((int)(standRect.Left * 72D / 96D), (int)(standRect.Top * 72D / 96D), (int)(standRect.Width * 72D / 96D), (int)(standRect.Height * 72D / 96D));
         }
 
         /// <summary>

+ 62 - 0
PDF Office/Helper/HomePageEditHelper.cs

@@ -8,6 +8,8 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Documents;
 using static System.Windows.Forms.VisualStyles.VisualStyleElement;
+using ComPDFKit.PDFDocument;
+using PDF_Office.Model.EditTools.Bates;
 
 namespace PDF_Office.Helper
 {
@@ -148,6 +150,66 @@ namespace PDF_Office.Helper
 
             }
         }
+
+        public static string UpDataPageRange(int pagecount,string pagerange) {
+
+            List<int> PageIndexLists = new List<int>();
+            string str = "";
+            if(CommonHelper.GetPagesInRange(ref PageIndexLists, pagerange, 9999, new char[] { ',' }, new char[] { '-' }))
+            {
+                
+                foreach (var PageIndex in PageIndexLists) {
+                   int pageindex = PageIndex + 1;
+                    if (pageindex<= pagecount)
+                    {
+                        str = str + pageindex.ToString();
+                        str = str + ",";
+                    }
+                }
+                if(str=="")
+                    return str;
+                return str.Remove(str.LastIndexOf(","),1);
+            }
+            return str;
+        }
+
+        public static string ReverseDate(string str,CPDFDocument Document)
+        {
+            string yyyy = DateTime.Now.ToString("yyyy");
+            string yy = DateTime.Now.ToString("yy");
+            string mm = DateTime.Now.ToString("MM");
+            string m = DateTime.Now.ToString("%M");
+            string dd = DateTime.Now.ToString("dd");
+            string d = DateTime.Now.ToString("%d");
+            str = str.Replace("<<m/d>>", m + "/" + d)
+            .Replace("<<m/d/yy>>", m + "/" + d + "/" + yy)
+            .Replace("<<m/d/yyyy>>", m + "/" + d + "/" + yyyy)
+            .Replace("<<mm/dd/yy>>", mm + "/" + dd + "/" + yy)
+            .Replace("<<mm/dd/yyyy>>", mm + "/" + dd + "/" + yyyy)
+            .Replace("<<d/m/yy>>", d + "/" + m + "/" + yy)
+            .Replace("<<d/m/yyyy>>", d + "/" + m + "/" + yyyy)
+            .Replace("<<dd/mm/yy>>", dd + "/" + mm + "/" + yy)
+            .Replace("<<dd/mm/yyyy>>", dd + "/" + mm + "/" + yyyy)
+            .Replace("<<mm/yy>>", mm + "/" + yy)
+            .Replace("<<mm/yyyy>>", mm + "/" + yyyy)
+            .Replace("<<m.d.yy>>", m + "." + d + "." + yy)
+            .Replace("<<m.d.yyyy>>", m + "." + d + "." + yyyy)
+            .Replace("<<mm.dd.yy>>", mm + "." + dd + "." + yy)
+            .Replace("<<mm.dd.yyyy>>", mm + "." + dd + "." + yyyy)
+            .Replace("<<mm.yy>>", mm + "." + yy)
+            .Replace("<<mm.yyyy>>", mm + "." + yyyy)
+            .Replace("<<d.m.yy>>", d + "." + m + "." + yy)
+            .Replace("<<d.m.yyyy>>", d + "." + m + "." + yyyy)
+            .Replace("<<dd.mm.yy>>", dd + "." + mm + "." + yy)
+            .Replace("<<dd.mm.yyyy>>", dd + "." + mm + "." + yyyy)
+            .Replace("<<yy-mm-dd>>", yy + "-" + mm + "-" + dd)
+            .Replace("<<yyyy-mm-dd>>", yyyy + "-" + mm + "-" + dd)
+            .Replace("<<1 of n>>", "<<1>>" + " of " + Document.PageCount)
+            .Replace("<<1/n>>", "<<1>>" + "/" + Document.PageCount)
+            .Replace("<<Page 1>>", "Page" + "<<1>>")
+            .Replace("<<Page 1 of n>>", "Page " + "<<1>>" + " of " + Document.PageCount);
+            return str;
+        }
     }
 
 }

+ 645 - 0
PDF Office/Helper/PageEditTool.cs

@@ -0,0 +1,645 @@
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing.Imaging;
+using System.Drawing;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Forms;
+using System.Windows.Media.Imaging;
+using System.Windows;
+
+namespace PDF_Office.Helper
+{
+    public enum FileExtension
+    {
+        JPG = 255216,
+        GIF = 7173,
+        PNG = 13780,
+        SWF = 6787,
+        RAR = 8297,
+        ZIP = 8075,
+        _7Z = 55122,
+        VALIDFILE = 9999999
+    }
+
+    /// <summary>
+    /// 页面编辑的工具类
+    /// </summary>
+    public static class PageEditTool
+    {
+        [DllImport("user32.dll")]
+        private static extern IntPtr SetCapture(long hWnd);
+
+        [DllImport("user32.dll")]
+        private static extern long ReleaseCapture();
+
+        /// <summary>
+        /// 打开路径并定位文件...对于@"h:\Bleacher Report - Hardaway with the safe call ??.mp4"这样的,explorer.exe /select,d:xxx不认,用API整它
+        /// </summary>
+        /// <param name="filePath">文件绝对路径</param>
+        [DllImport("shell32.dll", ExactSpelling = true)]
+        private static extern void ILFree(IntPtr pidlList);
+
+        [DllImport("shell32.dll", CharSet = CharSet.Unicode, ExactSpelling = true)]
+        private static extern IntPtr ILCreateFromPathW(string pszPath);
+
+        [DllImport("shell32.dll", ExactSpelling = true)]
+        private static extern int SHOpenFolderAndSelectItems(IntPtr pidlList, uint cild, IntPtr children, uint dwFlags);
+
+        /// <summary>
+        /// 打开文件夹浏览,并选中一个文件(对于文件名称比较不规范的,可以用这个)
+        /// </summary>
+        /// <param name="filePath"></param>
+        public static void ExplorerFile(string filePath)
+        {
+            try
+            {
+                if (!File.Exists(filePath) && !Directory.Exists(filePath))
+                    return;
+
+                if (Directory.Exists(filePath))
+                    Process.Start(@"explorer.exe", "/select,\"" + filePath + "\"");
+                else
+                {
+                    IntPtr pidlList = ILCreateFromPathW(filePath);
+                    if (pidlList != IntPtr.Zero)
+                    {
+                        try
+                        {
+                            Marshal.ThrowExceptionForHR(SHOpenFolderAndSelectItems(pidlList, 0, IntPtr.Zero, 0));
+                        }
+                        finally
+                        {
+                            ILFree(pidlList);
+                        }
+                    }
+                }
+            }
+            catch { }
+        }
+
+        /// <summary>
+        /// 强制捕获鼠标
+        /// </summary>
+        /// <param name="hwd"></param>
+        public static void DOSetCapture(long hwd)
+        {
+            SetCapture(hwd);
+        }
+
+        public static void DoReleaseCapture()
+        {
+            ReleaseCapture();
+        }
+
+        /// <summary>
+        /// 返回文件占有的大小
+        /// </summary>
+        /// <param name="filePath"></param>
+        /// <returns></returns>
+        public static string GetFileSize(string filePath)
+        {
+            //判断当前路径所指向的是否为文件
+            if (File.Exists(filePath))
+            {
+                //定义一个FileInfo对象,使之与filePath所指向的文件向关联,
+                //以获取其大小
+                FileInfo fileInfo = new FileInfo(filePath);
+                var size = fileInfo.Length;
+                string strSize = "";
+                if (size < 1024)
+                {
+                    strSize = Math.Round(size / 1024.0, 3) + " KB";
+                }
+                else if (size / 1024 > 1024)
+                {
+                    strSize = Math.Round(size / 1024 / 1024.0, 1) + " MB";
+                }
+                else
+                {
+                    strSize = Math.Round(size / 1024.0, 1) + " KB";
+                }
+                return strSize;
+            }
+            else
+            {
+                return string.Empty;
+            }
+        }
+
+        /// <summary>
+        /// 用照片查看器查看指定路径的图片
+        /// </summary>
+        /// <param name="Path">带文件名的绝对路径</param>
+        public static void BrowsePicture(string Path)
+        {
+            //建立新的系统进程
+            System.Diagnostics.Process process = new System.Diagnostics.Process();
+            //设置文件名,此处为图片的真实路径+文件名
+            process.StartInfo.FileName = Path;
+            //此为关键部分。设置进程运行参数,此时为最大化窗口显示图片。
+            process.StartInfo.Arguments = "rundll32.exe C://WINDOWS//system32//shimgvw.dll,ImageView_Fullscreen";
+            //此项为是否使用Shell执行程序,因系统默认为true,此项也可不设,但若设置必须为true
+            process.StartInfo.UseShellExecute = true;
+            //此处可以更改进程所打开窗体的显示样式,可以不设
+            process.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal;
+            process.Start();
+            process.Dispose();
+        }
+
+        /// <summary>
+        /// 校验PageRange 输入是否合法,且可返回List<int> Pages  存放的索引值
+        /// </summary>
+        /// <param name="pageList">返回的页面集合</param>
+        /// <param name="pageRange">需要判断的文本</param>
+        /// <param name="count">页面总数</param>
+        /// <param name="enumerationSeparator">例 new char[] { ',' }</param>
+        /// <param name="rangeSeparator">例 new char[] { '-' }</param>
+        /// <param name="inittag"></param>
+        /// <returns></returns>
+        public static bool GetPagesInRange(ref List<int> pageList, string pageRange, int count, char[] enumerationSeparator, char[] rangeSeparator, bool inittag = false)
+        {
+            string[] rangeSplit = pageRange.Split(enumerationSeparator);//根据分隔符 拆分字符串
+
+            pageList.Clear();
+
+            foreach (string range in rangeSplit)
+            {
+                int starttag = 1;
+                if (inittag)
+                {
+                    starttag = 0;
+                }
+                if (range.Contains("-"))//连续页
+                {
+                    try
+                    {
+                        string[] limits = range.Split(rangeSeparator);//对子字符串再根据”-“ 拆分
+                        if (limits.Length >= 2 && !string.IsNullOrWhiteSpace(limits[0]) && !string.IsNullOrWhiteSpace(limits[1]))
+                        {
+                            int start = int.Parse(limits[0]);
+                            int end = int.Parse(limits[1]);
+
+                            if ((start < starttag) || (end > count) || (start > end))
+                            {
+                                //throw new Exception(string.Format("Invalid page(s) in range {0} - {1}", start, end));
+                                return false;
+                            }
+
+                            for (int i = start; i <= end; ++i)
+                            {
+                                if (pageList.Contains(i))
+                                {
+                                    // throw new Exception(string.Format("Invalid page(s) in range {0} - {1}", start, end));
+                                    return false;
+                                }
+
+                                pageList.Add(i - 1);
+                            }
+                            continue;
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        // MessageBox.Show("请检查符号或页码范围是否正确。","提示",MessageBoxButton.OKCancel,MessageBoxImage.Warning);
+                        return false;
+                    }
+                }
+                int pageNr;
+                try
+                {
+                    // Single page
+                    pageNr = int.Parse(range);//单页
+                }
+                catch (Exception)//格式不正确时
+                {
+                    return false;
+                }
+                if (pageNr < starttag || pageNr > count)
+                {
+                    return false;
+                    //throw new Exception(string.Format("Invalid page {0}", pageNr));
+                }
+                if (pageList.Contains(pageNr))
+                {
+                    return false;
+                    // throw new Exception(string.Format("Invalid page {0}", pageNr));
+                }
+                pageList.Add(pageNr - 1);
+            }
+            return true;
+        }
+
+        /// <summary>
+        ///  返回指定路径的图标
+        /// </summary>
+        /// <param name="path"></param>
+        /// <returns></returns>
+        public static BitmapSource ToBitmapSource(string path)
+        {
+            System.Drawing.Icon ico = System.Drawing.Icon.ExtractAssociatedIcon(path);
+            System.Drawing.Bitmap bitmap = ico.ToBitmap();
+            BitmapSource returnSource;
+            try
+            {
+                returnSource = System.Windows.Interop.Imaging.CreateBitmapSourceFromHBitmap(bitmap.GetHbitmap(), IntPtr.Zero, Int32Rect.Empty, BitmapSizeOptions.FromEmptyOptions());
+            }
+            catch
+            {
+                returnSource = null;
+            }
+            return returnSource;
+        }
+
+        public static string GetPageParmFromList(List<int> pagesList)
+        {
+            string pageParam = "";
+            if (pagesList.Count != 0)
+            {
+                pagesList.Sort();//先对页码排序
+
+                for (int i = 0; i < pagesList.Count; i++)
+                {
+                    if (i == 0)
+                    {
+                        pageParam += pagesList[0].ToString();
+                    }
+                    else
+                    {
+                        if (pagesList[i] == pagesList[i - 1] + 1)//页码连续
+                        {
+                            if (i >= 2)
+                            {
+                                if (pagesList[i - 1] != pagesList[i - 2] + 1)
+                                    pageParam += "-";
+                            }
+                            else
+                                pageParam += "-";
+
+                            if (i == pagesList.Count - 1)
+                            {
+                                pageParam += pagesList[i].ToString();
+                            }
+                        }
+                        else//页码不连续时
+                        {
+                            if (i >= 2)
+                            {
+                                if (pagesList[i - 1] == pagesList[i - 2] + 1)
+                                    pageParam += pagesList[i - 1].ToString();
+                            }
+                            pageParam += "," + pagesList[i].ToString();
+                        }
+                    }
+                }
+            }
+            return pageParam;
+        }
+
+        /// <summary>
+        /// 检测文件是否重复  追加尾号
+        /// </summary>
+        /// <param name="path"></param>
+        /// <returns></returns>
+        public static string CreateFilePath(string path)
+        {
+            int i = 1;
+            string oldDestName = path;
+            do
+            {
+                if (File.Exists(path))
+                {
+                    int lastDot = oldDestName.LastIndexOf('.');
+
+                    string fileExtension = string.Empty;
+
+                    string fileName = oldDestName;
+
+                    if (lastDot > 0)
+                    {
+                        fileExtension = fileName.Substring(lastDot);
+
+                        fileName = fileName.Substring(0, lastDot);
+                    }
+
+                    path = fileName + string.Format(@"({0})", i) + fileExtension;
+                }
+                ++i;
+            } while (File.Exists(path));
+            return path;
+        }
+
+        /// <summary>
+        /// 检查文件夹是否重复  追加尾号
+        /// </summary>
+        /// <param name="path"></param>
+        /// <returns></returns>
+        public static string CreateFolder(string folder)
+        {
+            try
+            {
+                int i = 1;
+                string oldDestName = folder;
+                DirectoryInfo info = new DirectoryInfo(folder);
+                do
+                {
+                    info = new DirectoryInfo(folder);
+                    if (info.Exists)
+                    {
+                        string fileName = oldDestName;
+
+                        folder = fileName + string.Format(@"({0})", i);
+                    }
+                    ++i;
+                } while (info.Exists);
+                info.Create();
+            }
+            catch { return null; }
+            return folder;
+        }
+
+        /// <summary>
+        /// 文件名称是否合法
+        /// </summary>
+        /// <param name="fileName">文件名</param>
+        /// <returns>返回true是合法</returns>
+        public static bool IsValidFileName(string fileName)
+        {
+            try
+            {
+                foreach (char invalidChar in Path.GetInvalidFileNameChars())
+                {
+                    if (fileName.Contains(invalidChar.ToString()))
+                        return false;
+                }
+                return true;
+            }
+            catch
+            {
+                return false;
+            }
+        }
+
+        /// <summary>
+        /// 悬浮提示框(气泡形式)
+        /// </summary>
+        /// <param name="control">显示提示的控件</param>
+        /// <param name="tipMsg">内容</param>
+        /// <param name="tipTitle">标题</param>
+        /// <param name="delay">调用该函数而显示时间</param>
+        /// <param name="autoPopDelay">悬浮控件上的显示时间</param>
+        public static async void ShowToolTip(Control control, string tipMsg, string tipTitle = "", int delay = 2000, int autoPopDelay = 0)
+        {
+            if (control == null || string.IsNullOrEmpty(tipMsg))
+                return;
+            try
+            {
+                ToolTip toolTip = new ToolTip();
+
+                //if (string.IsNullOrEmpty(tipTitle))
+                //    tipTitle = App.MainPageLoader.GetString("Main_HintWarningTilte");
+
+                toolTip.ToolTipTitle = tipTitle;
+                toolTip.SetToolTip(control, tipMsg);
+                toolTip.IsBalloon = true;
+                toolTip.ToolTipIcon = ToolTipIcon.Warning;
+                toolTip.ShowAlways = false;
+                toolTip.AutoPopDelay = autoPopDelay;
+                toolTip.Show(tipMsg, control);
+                await Task.Delay(delay);
+                toolTip.Hide(control);
+            }
+            catch { }
+        }
+
+        public static BitmapImage ToBitmapImage(System.Drawing.Bitmap ImageOriginal)
+        {
+            System.Drawing.Bitmap ImageOriginalBase = new System.Drawing.Bitmap(ImageOriginal);
+            BitmapImage bitmapImage = new BitmapImage();
+            using (System.IO.MemoryStream ms = new System.IO.MemoryStream())
+            {
+                //ImageOriginalBase.Save(ms, ImageOriginalBase.RawFormat);
+                ImageOriginalBase.Save(ms, System.Drawing.Imaging.ImageFormat.Png);
+                bitmapImage.BeginInit();
+                bitmapImage.StreamSource = ms;
+                bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
+                bitmapImage.EndInit();
+                bitmapImage.Freeze();
+            }
+            return bitmapImage;
+        }
+
+        /// <summary>
+        /// 获取图片的旋转角度
+        /// 获取后可以 通过bitmap的RotateFlip 回位
+        /// </summary>
+        /// <param name="path">文件路径</param>
+        /// <returns></returns>
+        public static int GetPictureRotation(string path)
+        {
+            int rotate = 0;
+            using (var image = System.Drawing.Image.FromFile(path))
+            {
+                foreach (var prop in image.PropertyItems)
+                {
+                    if (prop.Id == 0x112)
+                    {
+                        if (prop.Value[0] == 6)
+                            rotate = 90;
+                        if (prop.Value[0] == 8)
+                            rotate = -90;
+                        if (prop.Value[0] == 3)
+                            rotate = 180;
+                        prop.Value[0] = 1;
+                    }
+                }
+            }
+            return rotate;
+        }
+
+        public static byte[] GetImageByteFromPath(string ImagePath, string fileExt, out double width, out double height)
+        {
+            try
+            {
+                #region 跟图章一样的转换方法。
+
+                if (ImagePath != null && ImagePath.Length > 0 && File.Exists(ImagePath))
+                {
+                    FileStream fileData = File.OpenRead(ImagePath);
+                    BitmapFrame frame = null;
+                    width = 0;
+                    height = 0;
+
+                    if (fileExt.Contains(".jpg") || fileExt.Contains(".jpeg"))
+                    {
+                        JpegBitmapDecoder decoder = (JpegBitmapDecoder)JpegBitmapDecoder.Create(fileData, BitmapCreateOptions.None, BitmapCacheOption.Default);
+                        frame = decoder.Frames[0];
+                        width = frame.Width;
+                        height = frame.Height;
+                    }
+                    else if (fileExt.Contains(".png"))
+                    {
+                        PngBitmapDecoder decoder = (PngBitmapDecoder)PngBitmapDecoder.Create(fileData, BitmapCreateOptions.None, BitmapCacheOption.Default);
+                        frame = decoder.Frames[0];
+                        width = frame.Width;
+                        height = frame.Height;
+                    }
+                    else if (fileExt.Contains(".bmp"))
+                    {
+                        BmpBitmapDecoder decoder = (BmpBitmapDecoder)BmpBitmapDecoder.Create(fileData, BitmapCreateOptions.None, BitmapCacheOption.Default);
+                        frame = decoder.Frames[0];
+                        width = frame.Width;
+                        height = frame.Height;
+                    }
+                    else//默认采用png的解码方式
+                    {
+                        BitmapDecoder decoder = BitmapDecoder.Create(fileData, BitmapCreateOptions.None, BitmapCacheOption.Default);
+                        frame = decoder.Frames[0];
+                        width = frame.Width;
+                        height = frame.Height;
+                    }
+
+                    if (frame != null)
+                    {
+                        var ImageArray = new byte[frame.PixelWidth * frame.PixelHeight * 4];
+                        frame.CopyPixels(ImageArray, frame.PixelWidth * 4, 0);
+                        return ImageArray;
+                    }
+                    return null;
+                }
+                width = 0;
+                height = 0;
+                return null;
+
+                #endregion 跟图章一样的转换方法。
+            }
+            catch (Exception ex)
+            {
+                width = 0;
+                height = 0;
+                return null;
+            }
+        }
+
+        /// <summary>
+        /// BitmapImage 转Bitmap
+        /// </summary>
+        /// <param name="bitmapImage"></param>
+        /// <param name="isPng"></param>
+        /// <returns></returns>
+        public static Bitmap GetBitmapByBitmapImage(BitmapImage bitmapImage, bool isPng = false)
+        {
+            Bitmap bitmap;
+            MemoryStream outStream = new MemoryStream();
+            BitmapEncoder enc = new JpegBitmapEncoder();
+            if (isPng)
+            {
+                enc = new PngBitmapEncoder();
+            }
+            enc.Frames.Add(BitmapFrame.Create(bitmapImage));
+            enc.Save(outStream);
+            bitmap = new Bitmap(outStream);
+            return bitmap;
+        }
+
+        /// <summary>
+        /// 根据图片数据判断图片类型
+        /// </summary>
+        /// <param name="fileName"></param>
+        /// <returns></returns>
+        public static FileExtension CheckTextFile(string fileName)
+        {
+            FileStream fs = new FileStream(fileName, FileMode.Open, FileAccess.Read);
+            System.IO.BinaryReader br = new System.IO.BinaryReader(fs);
+            string fileType = string.Empty; ;
+            try
+            {
+                byte data = br.ReadByte();
+                fileType += data.ToString();
+                data = br.ReadByte();
+                fileType += data.ToString();
+                FileExtension extension;
+                try
+                {
+                    extension = (FileExtension)Enum.Parse(typeof(FileExtension), fileType);
+                }
+                catch
+                {
+                    extension = FileExtension.VALIDFILE;
+                }
+                return extension;
+            }
+            catch (Exception ex)
+            {
+                throw ex;
+            }
+            finally
+            {
+                if (fs != null)
+                {
+                    fs.Close();
+                    br.Close();
+                }
+            }
+        }
+
+        /// <summary>
+        /// 压缩图片到600*600以内,压缩成功后返回压缩完成的缓存路径
+        /// 如果压缩 失败 返回原图路径
+        /// </summary>
+        /// <param name="filePath"></param>
+        /// <returns></returns>
+        public static string CompressImage(string filePath, int maxwidth = 600)
+        {
+            try
+            {
+                string sourcepath = filePath;
+                var guid = Guid.NewGuid().ToString();
+                string folder = Path.Combine(App.CurrentPath, "Temp");
+                if (!Directory.Exists(folder))
+                {
+                    Directory.CreateDirectory(folder);
+                }
+                var path = System.IO.Path.Combine(App.CurrentPath, "Temp", guid);
+
+                Bitmap bitmap = new Bitmap(sourcepath);
+
+                var b = bitmap;
+                //bitmap.Dispose();
+
+                double scale = Math.Min((double)maxwidth / b.Width, (double)maxwidth / b.Height);
+                scale = Math.Min(scale, 1);
+                System.Drawing.Size newsize = new System.Drawing.Size(maxwidth, maxwidth);
+                newsize.Width = (int)(scale * b.Width);
+                newsize.Height = (int)(scale * b.Height);
+
+                if (!File.Exists(path))
+                {
+                    if (CheckTextFile(sourcepath) == FileExtension.PNG)
+                    {
+                        using (var bp = new Bitmap(b, (int)newsize.Width, (int)newsize.Height))
+                        {
+                            bp.Save(path, ImageFormat.Png);
+                        }
+                    }
+                    else
+                    {
+                        using (var bp = new Bitmap(b, (int)newsize.Width, (int)newsize.Height))
+                        {
+                            bp.Save(path, ImageFormat.Jpeg);
+                        }
+                    }
+                }
+                return path;
+            }
+            catch
+            {
+                return filePath;
+            }
+        }
+    }
+}

+ 11 - 0
PDF Office/Helper/UpdateAttributeHelper.cs

@@ -25,6 +25,17 @@ namespace PDF_Office.Helper
             annotEditEvent = Event;
         }
 
+        public bool IsCreateForm()
+        {
+            if (annotEditEvent != null)
+            {
+                if(annotEditEvent.EditAction == ActionType.Add)
+                    return true;
+            }
+
+            return false;
+        }
+
         public void UpdateAttrib(AnnotAttrib attrib, object updateData)
         {
             if (annotAttribEvent != null)

+ 2 - 1
PDF Office/Model/Dialog/ConverterDialogs/ConverterImgDialogModel.cs

@@ -9,7 +9,8 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
 {
     public class ConverterImgDialogModel : ConverterDialogsModel
     {
-        public ImgType Type =ImgType.JPEG;
+        public ImgType Type =ImgType.PNG;
         public string DPI = "50";
+        public string imageType = ".jpeg";
     }
 }

+ 1 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgModel.cs

@@ -10,6 +10,7 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.H
     public class HomePageConverterImgModel : HomePageConverterDialogModel
     {
         public ImgType Type = ImgType.JPEG;
+        public string imageType = ".jpeg";
         public string DPI = "50";
     }
 }

+ 87 - 33
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogModel.cs

@@ -7,6 +7,7 @@ using System.Printing;
 using System.Runtime.Remoting.Channels;
 using System.Text;
 using System.Threading.Tasks;
+using System.Windows.Forms;
 using static PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter.HomePagePrinterDialogModel;
 
 namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
@@ -24,15 +25,25 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
         /// <summary>
         /// 页码范围
         /// </summary>
-        public EnumPageRange EnumPageRange = EnumPageRange.StatusAllRange;
+        public int EnumPageRange = 0;
         /// <summary>
         /// 逆页序
         /// </summary>
         public bool IsIndexReverse { get; set; }
+
+        /// <summary>
+        /// 双面打印
+        /// </summary>
+        public bool IsDuplex = false;
+
+        /// <summary>
+        /// 是否打印页面边框
+        /// </summary>
+        public bool IsPrintPageBorde = false;
         /// <summary>
         /// 打印方向
         /// </summary>
-        public EnumPrintOrientation EnumPrintOrientation = EnumPrintOrientation.StatusLandscape;
+        public EnumPrintOrientation EnumPrintOrientation = EnumPrintOrientation.StatusPortrait;
         /// <summary>
         /// 带Annot
         /// </summary>
@@ -52,19 +63,39 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
         /// <summary>
         /// 自定义打印页码范围
         /// </summary>
-        public List<int> CustomRange { get; set; }
+        public List<int> PageRangeList = new List<int>();
         /// <summary>
         /// 打印Mod
         /// </summary>
-        public PrintModInfo printModInfo  = new PrintModInfo();
-
+        public PrintModInfo PrintModInfo = new SizeInfo();
+        /// <summary>
+        /// Document对象,用于打印
+        /// </summary>
+        public PrintDocument PrintDocument = new PrintDocument();
+        /// <summary>
+        /// 是否双面打印 
+        /// </summary>
+        public bool IsBothSides = false;
+        /// <summary>
+        /// 边距
+        /// </summary>
         public List<int> Margin = new List<int>();
+
+        /// <summary>
+        /// 需要重新渲染?
+        /// </summary>
+        public bool needRerendering = true;
+
+        public PrintSettingsInfo()
+        {
+            PrintDocument.DefaultPageSettings.Landscape = false;
+        }
     }
 
     public class HomePagePrinterDialogModel
     {
 
-    } 
+    }
 
 
     public enum EnumSizeType
@@ -73,13 +104,31 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
         StatusActural,
         StatusCustomized,
     }
+    /// <summary>
+    /// 双面打印阶段
+    /// </summary>
+    public enum EnumBothSidesStage
+    {
+        StatusNone,
+        StatusFrontSide,
+        StatusBackSide
+    }
 
-    public enum EnumPageRange
+    public enum EnumPageRangeWithoutCurrentPage
     {
         StatusAllRange,
         StatusOddRange,
         StatusEvenRange,
-        StatusCustomizedRange
+        StatusCustomizedRange,
+    }
+
+    public enum EnumPageRangeWithCurrentPage
+    {
+        StatusAllRange,
+        StatusCurrentPage,
+        StatusOddRange,
+        StatusEvenRange,
+        StatusCustomizedRange,
     }
 
     public enum EnumPrintOrientation
@@ -92,7 +141,8 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
     {
         StatusOnlyDocument,
         StatusDocumentAndMarkUps,
-        StatusDocumentAndForm,
+        StatusDocumentAndStamps,
+        StatusDocumentAndForm
     }
 
     public enum EnumPrintMod
@@ -137,18 +187,29 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
     public enum EnumBookletBinding
     {
         StatusLeft,
-        StatusRight,
+        StatusRight
+    }
+
+    public enum EnumDuplexPrintMod
+    {
+        StatusNone,
+        StatusFlipLongEdge,
+        StatusFlipShortEdge
     }
 
     public class PrintModInfo
     {
         public EnumPrintMod EnumPrintMod = EnumPrintMod.StatusSize;
+        /// <summary>
+        /// 双面打印
+        /// </summary>
+        public EnumDuplexPrintMod EnumDuplexPrintMod = EnumDuplexPrintMod.StatusNone;
     }
 
     public class SizeInfo : PrintModInfo
     {
-        public EnumSizeType EnumSizeType { get; set; }
-        public int DisplayRatio { get; set; }
+        public EnumSizeType EnumSizeType = EnumSizeType.StatusAdaptive;
+        public int DisplayRatio = 100;
     }
 
 
@@ -158,36 +219,29 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePagePrinter
         public bool HasCutMarks { get; set; }
         public bool HasLabel { get; set; }
         public double OverLap { get; set; }
-    }
-
-    public class PostModTileInfo : PosterInfo
-    {
-        public int TileRatio { get; set; }
-    }
-
-    public class PostModSplitInfo : PosterInfo
-    {
         public EnumDisplayPageNumber EnumDisplayPageNumber { get; set; }
+        public int HorizontalSheetNumber { get; set; }
+        public int VerticalSheetNumber { get; set; }
         public int TileRatio { get; set; }
-        public int WidthPartNumber { get; set; }
-        public int HeightPartNumber { get; set; }
+
+        public string Label;
     }
 
     public class MultipleInfo : PrintModInfo
     {
-        public EnumPageOrder EnumPageOrder { set; get; }
-        public EnumDisplayPageNumber EnumDisplayPageNumber { get; set; }
-        public int HorizontalPageNumber { get; set; }
-        public int VerticalPageNumber { get; set; }
-        public bool IsAutoRotate { get; set; }
+        public EnumPageOrder EnumPageOrder = EnumPageOrder.StatusHorizontalOrder;
+        public EnumDisplayPageNumber EnumDisplayPageNumber = EnumDisplayPageNumber.StatusTwo;
+        public int HorizontalPageNumber = 2;
+        public int VerticalPageNumber = 1;
+        public bool IsAutoRotate = false;
     }
 
     public class BookletInfo : PrintModInfo
     {
-        public EnumBookletSubset EnumBookletSubset { get; set; }
-        public EnumBookletBinding EnumBookletBinding { get; set; }
-        public int BeginPaperIndex { get; set; }
-        public int EndPaperIndex { get; set; }
-        public bool IsAutoRotate { get; set; }
+        public EnumBookletSubset EnumBookletSubset = EnumBookletSubset.StatusBothSides;
+        public EnumBookletBinding EnumBookletBinding = EnumBookletBinding.StatusLeft;
+        public int BeginPaperIndex = 1;
+        public int EndPaperIndex = 1;
+        public bool IsAutoRotate = false;
     }
 }

+ 26 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HtmlModel.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs
+{
+    public class HtmlModel
+    {
+        /// <summary>
+        /// 文件路径
+        /// </summary>
+        public string FilePath { get; set; } = "";
+
+        /// <summary>
+        /// 页面尺寸
+        /// </summary>
+        public Microsoft.Office.Interop.Word.WdPaperSize PageSize { get; set; } = Microsoft.Office.Interop.Word.WdPaperSize.wdPaperCustom;
+
+        /// <summary>
+        /// 边距
+        /// </summary>
+        public double Margin { get; set; } = 0;
+    }
+}

+ 154 - 0
PDF Office/Model/Dialog/ToolsDialogs/MergeObject.cs

@@ -0,0 +1,154 @@
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media.Imaging;
+
+namespace PDF_Office.Model.Dialog.ToolsDialogs
+{
+    class MergeObject : BindableBase
+    {
+        private string docName;
+
+        /// <summary>
+        /// 文档名
+        /// </summary>
+        public string DocName
+        {
+            get { return docName; }
+            set
+            {
+                SetProperty(ref docName, value);
+            }
+        }
+
+        private string docSize;
+
+        /// <summary>
+        /// 文档大小
+        /// </summary>
+        public string DocSize
+        {
+            get { return docSize; }
+            set
+            {
+                SetProperty(ref docSize, value);
+            }
+        }
+
+        private BitmapSource docThumbnail;
+
+        /// <summary>
+        /// 文档首张图片
+        /// </summary>
+        public BitmapSource DocThumbnail
+        {
+            get { return docThumbnail; }
+            set
+            {
+                SetProperty(ref docThumbnail, value);
+            }
+        }
+
+        private int sdkPageCount;
+        /// <summary>
+        /// SDK获取到的页面数量
+        /// </summary>
+        public int SDKPageCount
+        {
+            get { return sdkPageCount; }
+            set
+            {
+                SetProperty(ref sdkPageCount, value);
+            }
+        }
+
+
+        private string docPageCount;
+
+        /// <summary>
+        /// 文档页数
+        /// </summary>
+        public string DocPageCount
+        {
+            get { return docPageCount; }
+            set
+            {
+                SetProperty(ref docPageCount, value);
+            }
+        }
+
+        private string filePath;
+
+        /// <summary>
+        /// 文档文件路径
+        /// </summary>
+        public string FilePath
+        {
+            get { return filePath; }
+            set
+            {
+                SetProperty(ref filePath, value);
+            }
+        }
+
+        private string setPageRange;
+
+        /// <summary>
+        /// 设置的文档页面范围
+        /// </summary>
+        public string SetPageRange
+        {
+            get { return setPageRange; }
+            set
+            {
+                SetProperty(ref setPageRange, value);
+            }
+        }
+
+        private string password="";
+
+        /// <summary>
+        /// 密码
+        /// </summary>
+        public string Password
+        {
+            get { return password; }
+            set
+            {
+                SetProperty(ref password, value);
+            }
+        }
+
+        /// <summary>
+        /// 显示上半部分线
+        /// </summary>
+        private bool isBackwards = false;
+
+        public bool IsBackwards
+        {
+            get { return isBackwards; }
+            set
+            {
+                SetProperty(ref isBackwards, value);
+            }
+        }
+
+        /// <summary>
+        /// 显示下半部分线
+        /// </summary>
+        private bool isForward=false;
+
+        public bool IsForward
+        {
+            get { return isForward; }
+            set
+            {
+                SetProperty(ref isForward, value);
+            }
+        }
+
+    }
+}

+ 106 - 85
PDF Office/Model/DialogNames.cs

@@ -1,93 +1,98 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace PDF_Office.Model
-{
-    /// <summary>
-    /// 记录弹窗的名称
-    /// </summary>
-    public static class DialogNames
-    {
-        /// <summary>
-        /// 文档解密弹窗 需要传参PDFDocument对象
-        /// </summary>
-        public static string VerifyPassWordDialog = "PassWordDialog";
-
-        /// <summary>
-        /// 全屏模式弹窗
-        /// </summary>
-        public static string FullScreenDialog = "FullScreenDialog";
-
-        /// <summary>
-        /// 压缩弹窗
-        /// </summary>
-        public static string CompressDialog = "CompressDialog";
-
-        /// <summary>
-        /// 解压缩弹窗
-        /// </summary>
-        public static string SetPasswordDialog = "SetPasswordDialog";
-
-        /// <summary>
-        /// 解压缩弹窗
-        /// </summary>
-        public static string CheckPasswordDialog = "CheckPasswordDialog";
-
-        /// <summary>
-        /// 删除安全性设置
-        /// </summary>
-        public static string DeleteSafetySettingsDialog = "DeleteSafetySettingsDialog";
-
-        /// <summary>
-        /// 进度条
-        /// </summary>
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model
+{
+    /// <summary>
+    /// 记录弹窗的名称
+    /// </summary>
+    public static class DialogNames
+    {
+        /// <summary>
+        /// 文档解密弹窗 需要传参PDFDocument对象
+        /// </summary>
+        public static string VerifyPassWordDialog = "PassWordDialog";
+
+        /// <summary>
+        /// 全屏模式弹窗
+        /// </summary>
+        public static string FullScreenDialog = "FullScreenDialog";
+
+        /// <summary>
+        /// 压缩弹窗
+        /// </summary>
+        public static string CompressDialog = "CompressDialog";
+
+        /// <summary>
+        /// 合并弹窗
+        /// </summary>
+        public static string MergeDialog = "MergeDialog";
+
+        /// <summary>
+        /// 解压缩弹窗
+        /// </summary>
+        public static string SetPasswordDialog = "SetPasswordDialog";
+
+        /// <summary>
+        /// 解压缩弹窗
+        /// </summary>
+        public static string CheckPasswordDialog = "CheckPasswordDialog";
+
+        /// <summary>
+        /// 删除安全性设置
+        /// </summary>
+        public static string DeleteSafetySettingsDialog = "DeleteSafetySettingsDialog";
+
+        /// <summary>
+        /// 进度条
+        /// </summary>
         public static string CompressProgressBarDialog = "CompressProgressBarDialog";
 
-        /// <summary>
-        /// 页面编辑- 提取弹窗
-        /// </summary>
-        public static string ExtractDialog = "ExtractDialog";
-
-        /// <summary>
-        /// 页面编辑-拆分弹窗
-        /// </summary>
-        public static string SplitDialog = "SplitDialog";
-
-        /// <summary>
-        /// 页面编辑-插入弹窗
-        /// </summary>
-        public static string InsertDialog = "InsertDialog";
-
-        ///<summary>
-        ///主页工具-提取弹窗
-        /// </summary>
-        public static string HomePageExtractDialog = "HomePageExtractDialog";
-
-        ///<summary>
-        ///主页工具-插入弹窗
-        /// </summary
-        public static string HomePageInsertDialog = "HomePageInsertDialog";
-
-        ///<summary>
-        ///主页工具-拆分弹窗
-        /// </summary>
-        public static string HomePageSplitDialog = "HomePageSplitDialog";
-
-        ///<summary>
-        ///主页工具-打印弹窗
-        /// </summary>
+        /// <summary>
+        /// 页面编辑- 提取弹窗
+        /// </summary>
+        public static string ExtractDialog = "ExtractDialog";
+
+        /// <summary>
+        /// 页面编辑-拆分弹窗
+        /// </summary>
+        public static string SplitDialog = "SplitDialog";
+
+        /// <summary>
+        /// 页面编辑-插入弹窗
+        /// </summary>
+        public static string InsertDialog = "InsertDialog";
+
+        ///<summary>
+        ///主页工具-提取弹窗
+        /// </summary>
+        public static string HomePageExtractDialog = "HomePageExtractDialog";
+
+        ///<summary>
+        ///主页工具-插入弹窗
+        /// </summary
+        public static string HomePageInsertDialog = "HomePageInsertDialog";
+
+        ///<summary>
+        ///主页工具-拆分弹窗
+        /// </summary>
+        public static string HomePageSplitDialog = "HomePageSplitDialog";
+
+        ///<summary>
+        ///主页工具-打印弹窗
+        /// </summary>
         public static string HomePagePrinterDialog = "HomePagePrinterDialog";
 
-        ///<summary>
-        ///打印弹窗-打印页面设置
-        /// </summary>
+        ///<summary>
+        ///打印弹窗-打印页面设置
+        /// </summary>
         public static string HomePagePrinterPaperSettingsDialog = "HomePagePrinterPaperSettingsDialog";
 
-        ///<summary>
-        ///主页工具-图片转PDF弹窗
+        ///<summary>
+        ///主页工具-图片转PDF弹窗
         /// </summary>
         public static string HomePagePictureToPDFDialog = "HomePagePictureToPDFDialog";
 
@@ -143,5 +148,21 @@ namespace PDF_Office.Model
         ///转档进度条弹窗
         /// </summary>
         public static string ConverterProgressBarDialog = "ConverterProgressBarDialog";
-    }
+
+        public static string EditPresetColorsDialog = "EditPresetColorsDialog";
+
+        /// <summary>
+        /// 从网页创建PDF弹窗
+        /// </summary>
+        public static string CreateFromHtmlDialog = "CreateFromHtmlDialog";
+
+        /// <summary>
+        /// 标记密文相关弹窗
+        /// </summary>
+        public static string MarkSettingDialog = "MarkSettingsDialog";
+
+        public static string PageMarkDialog = "PageMarkDialog";
+
+        public static string RepeatMarkDialog = "RepeatMarkDialog";
+    }
 }

+ 35 - 0
PDF Office/Model/ParameterNames.cs

@@ -21,6 +21,10 @@ namespace PDF_Office.Model
 
         #endregion ViewModelName
 
+<<<<<<< HEAD
+=======
+        public static string ViewModularContentViewModel = "ViewModularContentViewModel";
+>>>>>>> dev
         public static string PDFViewer = "PDFViewer";
 
         public static string FilePath = "FilePath";
@@ -39,6 +43,32 @@ namespace PDF_Office.Model
 
         public static string BatchProcessing_Name = "BatchProcessing_Name";
 
+        /// <summary>
+        /// 页码集合
+        /// </summary>
+<<<<<<< HEAD
+        public static string Bookmark = "Bookmark";
+
+        public static string Title = "Title";
+
+        public static string BookmarkInfo = "BookmarkInfo";
+
+        /// <summary>
+        /// 注释列表
+        /// </summary>
+=======
+        public static string PageList = "PageList";
+
+        /// <summary>
+        /// 页面总数
+        /// </summary>
+        public static string PageCount = "PageCount";
+
+        /// <summary>
+        /// 当前页
+        /// </summary>
+        public static string CurrentPageIndex = "CurrentPageIndex";
+
         /// <summary>
         /// 书签
         /// </summary>
@@ -51,6 +81,7 @@ namespace PDF_Office.Model
         /// <summary>
         /// 注释列表
         /// </summary>
+>>>>>>> dev
 
         public static string Annotation = "Annotation";
         public static string AnnotEvent = "AnnotEvent";
@@ -89,5 +120,9 @@ namespace PDF_Office.Model
         /// </summary>
         public static string PrintQueue = "PrintQueue";
         public static string PrintSettingsInfo = "PrintSettingsInfo";
+<<<<<<< HEAD
+=======
+        public static string PrintCurrentPage = "PrintCurrentPage";
+>>>>>>> dev
     }
 }

+ 31 - 0
PDF Office/Model/RegionNames.cs

@@ -73,6 +73,7 @@ namespace PDF_Office.Model
                 return GetRegionName("BatesViewerRegionName");
             }
         }
+
         public static string HeaderFooterViewerRegionName
         {
             get
@@ -155,6 +156,28 @@ namespace PDF_Office.Model
             }
         }
 
+        /// <summary>
+        /// 视图模块-分屏视图-PDF
+        /// </summary>
+        public static string SplitViewRegionName
+        {
+            get
+            {
+                return GetRegionName("SplitViewRegionName");
+            }
+        }
+
+        /// <summary>
+        /// 视图模块-分屏视图-页面控件
+        /// </summary>
+        public static string SplitScreenPageRegionName
+        {
+            get
+            {
+                return GetRegionName("SplitScreenPageRegionName");
+            }
+        }
+
         /// <summary>
         /// 视图模块-主题颜色
         /// </summary>
@@ -185,6 +208,14 @@ namespace PDF_Office.Model
             }
         }
 
+        public static string OCRViewerRegionName
+        {
+            get
+            {
+                return GetRegionName("OCRViewerRegionName");
+            }
+        }
+
         /// <summary>
         /// 获取MainWindowsViewModel RegionNames字典里的RegionName,
         /// 如果字典里没有键值就新建一个GUID,并插入到

+ 460 - 22
PDF Office/PDF Office.csproj

@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Project="packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props" Condition="Exists('packages\Xamarin.Forms.5.0.0.2012\build\Xamarin.Forms.props')" />
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
@@ -17,6 +17,21 @@
     <Deterministic>true</Deterministic>
     <NuGetPackageImportStamp>
     </NuGetPackageImportStamp>
+    <IsWebBootstrapper>false</IsWebBootstrapper>
+    <PublishUrl>publish\</PublishUrl>
+    <Install>true</Install>
+    <InstallFrom>Disk</InstallFrom>
+    <UpdateEnabled>false</UpdateEnabled>
+    <UpdateMode>Foreground</UpdateMode>
+    <UpdateInterval>7</UpdateInterval>
+    <UpdateIntervalUnits>Days</UpdateIntervalUnits>
+    <UpdatePeriodically>false</UpdatePeriodically>
+    <UpdateRequired>false</UpdateRequired>
+    <MapFileExtensions>true</MapFileExtensions>
+    <ApplicationRevision>0</ApplicationRevision>
+    <ApplicationVersion>1.0.0.%2a</ApplicationVersion>
+    <UseApplicationTrust>false</UseApplicationTrust>
+    <BootstrapperEnabled>true</BootstrapperEnabled>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
@@ -29,18 +44,25 @@
     <WarningLevel>4</WarningLevel>
     <Prefer32Bit>false</Prefer32Bit>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <DocumentationFile>
+    </DocumentationFile>
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
     <PlatformTarget>AnyCPU</PlatformTarget>
-    <DebugType>pdbonly</DebugType>
+    <DebugType>none</DebugType>
     <Optimize>true</Optimize>
     <OutputPath>bin\Release\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
     <WarningLevel>4</WarningLevel>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
+    <Prefer32Bit>false</Prefer32Bit>
   </PropertyGroup>
   <ItemGroup>
+    <Reference Include="ComDocumentAIKit, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>.\ComDocumentAIKit.dll</HintPath>
+    </Reference>
     <Reference Include="ComOCRKit.Desk, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
       <HintPath>.\ComOCRKit.Desk.dll</HintPath>
@@ -90,6 +112,12 @@
     <Reference Include="Google.Apis.PlatformServices, Version=1.57.0.0, Culture=neutral, PublicKeyToken=4b01fa6e34db77ab, processorArchitecture=MSIL">
       <HintPath>packages\Google.Apis.1.57.0\lib\net45\Google.Apis.PlatformServices.dll</HintPath>
     </Reference>
+    <Reference Include="Magick.NET-Q16-AnyCPU, Version=12.2.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec, processorArchitecture=MSIL">
+      <HintPath>packages\Magick.NET-Q16-AnyCPU.12.2.2\lib\netstandard20\Magick.NET-Q16-AnyCPU.dll</HintPath>
+    </Reference>
+    <Reference Include="Magick.NET.Core, Version=12.2.0.0, Culture=neutral, PublicKeyToken=2004825badfa91ec, processorArchitecture=MSIL">
+      <HintPath>packages\Magick.NET.Core.12.2.2\lib\netstandard20\Magick.NET.Core.dll</HintPath>
+    </Reference>
     <Reference Include="Microsoft.AppCenter, Version=0.0.0.0, Culture=neutral, PublicKeyToken=8a600e2fee7ba272, processorArchitecture=MSIL">
       <HintPath>packages\Microsoft.AppCenter.4.5.0\lib\net461\Microsoft.AppCenter.dll</HintPath>
     </Reference>
@@ -120,6 +148,7 @@
     <Reference Include="office, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c">
       <EmbedInteropTypes>True</EmbedInteropTypes>
     </Reference>
+    <Reference Include="PresentationFramework.Aero2" />
     <Reference Include="Prism, Version=8.1.97.5141, Culture=neutral, PublicKeyToken=40ee6c3a2184dc59, processorArchitecture=MSIL">
       <HintPath>packages\Prism.Core.8.1.97\lib\net461\Prism.dll</HintPath>
     </Reference>
@@ -150,6 +179,7 @@
     <Reference Include="System.Data" />
     <Reference Include="System.Deployment" />
     <Reference Include="System.Drawing" />
+    <Reference Include="System.IO.Compression.FileSystem" />
     <Reference Include="System.Management" />
     <Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
       <HintPath>packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
@@ -203,6 +233,9 @@
     <Compile Include="CustomControl\CompositeControl\ColorSubContent.xaml.cs">
       <DependentUpon>ColorSubContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\CompositeControl\CustomComboControl.xaml.cs">
+      <DependentUpon>CustomComboControl.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\CompositeControl\SlidComboControl.xaml.cs">
       <DependentUpon>SlidComboControl.xaml</DependentUpon>
     </Compile>
@@ -212,7 +245,12 @@
     <Compile Include="CustomControl\Form\FormFieldCombox.xaml.cs">
       <DependentUpon>FormFieldCombox.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\Form\LayoutAglinContent.xaml.cs">
+      <DependentUpon>LayoutAglinContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\IconAndTextTabItem.cs" />
+    <Compile Include="CustomControl\ImageButton.cs" />
+    <Compile Include="CustomControl\ImageRadioButton .cs" />
     <Compile Include="CustomControl\ListBoxItemToolBar.cs" />
     <Compile Include="CustomControl\MenuItemWithPath.cs" />
     <Compile Include="CustomControl\MessageBoxEx.cs" />
@@ -225,7 +263,13 @@
     <Compile Include="CustomControl\PageTurningPreview.xaml.cs">
       <DependentUpon>PageTurningPreview.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\PaginationControl.xaml.cs">
+      <DependentUpon>PaginationControl.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\PathButton.cs" />
+    <Compile Include="CustomControl\PathRadioButton.cs" />
+    <Compile Include="CustomControl\ScanViewControl\CustomDraw.cs" />
+    <Compile Include="CustomControl\ScanViewControl\CustomPanel.cs" />
     <Compile Include="CustomControl\SystemControl\CustomCommandAction .cs" />
     <Compile Include="CustomControl\SystemControl\RoutedEventTrigger.cs" />
     <Compile Include="CustomControl\TextBoxEx.cs" />
@@ -240,14 +284,18 @@
     </Compile>
     <Compile Include="DataConvert\AnnotateFontSizeConverter.cs" />
     <Compile Include="DataConvert\BoolToTextWrapConvert.cs" />
+    <Compile Include="DataConvert\CenterToolTipConverter .cs" />
+    <Compile Include="DataConvert\ColorBrushConvert.cs" />
     <Compile Include="DataConvert\CreateTimeToDate.cs" />
     <Compile Include="DataConvert\FileFormatToIconConvert.cs" />
     <Compile Include="DataConvert\GroupHeaderConverter.cs" />
+    <Compile Include="DataConvert\IndexConverter .cs" />
     <Compile Include="DataConvert\IntToBooleanConvert.cs" />
     <Compile Include="DataConvert\FileToImageSourceConvert.cs" />
     <Compile Include="DataConvert\IntAndTagToBoolMultiBinding.cs" />
     <Compile Include="DataConvert\IntToColorBrush.cs" />
     <Compile Include="DataConvert\InvertBoolConvert.cs" />
+    <Compile Include="DataConvert\ListCountToVisible.cs.cs" />
     <Compile Include="DataConvert\ObjectConvert.cs" />
     <Compile Include="DataConvert\PropertyPanelVisible.cs" />
     <Compile Include="DataConvert\StringToDateConvert.cs" />
@@ -257,7 +305,10 @@
     <Compile Include="EventAggregators\EditToolsEvent.cs" />
     <Compile Include="EventAggregators\PageEditNotifyEvent.cs" />
     <Compile Include="EventAggregators\PageEditRefreshEvent.cs" />
+    <Compile Include="EventAggregators\RedactionCommandEvent.cs" />
+    <Compile Include="EventAggregators\ScanEvent.cs" />
     <Compile Include="EventAggregators\SendPrintInfoEvent.cs" />
+    <Compile Include="EventAggregators\SplitEvent.cs" />
     <Compile Include="Helper\CacheFilePath.cs" />
     <Compile Include="Helper\ConverterHelper.cs" />
     <Compile Include="Helper\DpiHelpers.cs" />
@@ -267,6 +318,7 @@
     <Compile Include="Helper\DragDropHelper.cs" />
     <Compile Include="Helper\HomePageEditHelper.cs" />
     <Compile Include="Helper\ObservableDictionary.cs" />
+    <Compile Include="Helper\PageEditTool.cs" />
     <Compile Include="Helper\PasswordBoxHelper.cs" />
     <Compile Include="Helper\RichTextBoxHelper.cs" />
     <Compile Include="Helper\SDKLisenceHelper.cs" />
@@ -310,7 +362,9 @@
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWordModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePagePictureToPDFDialogModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HtmlModel.cs" />
     <Compile Include="Model\Dialog\ToolsDialogs\CompressDialogModel\CompressDialogModel.cs" />
+    <Compile Include="Model\Dialog\ToolsDialogs\MergeObject.cs" />
     <Compile Include="Model\Dialog\ToolsDialogs\SaftyDialogs\CheckPasswordDialogModel.cs" />
     <Compile Include="Model\Dialog\ToolsDialogs\SaftyDialogs\DeleteSafetySettintgsModel.cs" />
     <Compile Include="Model\Dialog\ToolsDialogs\SaftyDialogs\SetPasswordDialogModel.cs" />
@@ -347,6 +401,11 @@
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
     </Compile>
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\CreateFromHtmlDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\Redaction\MarkSettingDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\Redaction\PageMarkDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\Redaction\RepeatMarkDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\ToolsDialogs\MergeDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageRemoveDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterDocumentContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterPaperSettingsDialogViewModel.cs" />
@@ -391,25 +450,52 @@
     <Compile Include="ViewModels\EditTools\HeaderFooter\HeaderFooterDocumentContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\HeaderFooter\HeaderFooterTemplateListContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Redaction\RedactionContentViewModel.cs" />
-    <Compile Include="ViewModels\EditTools\Redaction\RedactionDocumentContentViewModel.cs" />
     <Compile Include="ViewModels\Form\ButtonPropertyViewModel.cs" />
     <Compile Include="ViewModels\Form\CheckBoxPropertyViewModel.cs" />
     <Compile Include="ViewModels\Form\ComboxPropertyViewModel.cs" />
+    <Compile Include="ViewModels\Form\EditPresetColorsDialogViewModel.cs" />
     <Compile Include="ViewModels\Form\FormBaseVM.cs" />
     <Compile Include="ViewModels\Form\FormsToolContentViewModel.cs" />
     <Compile Include="ViewModels\Form\ListBoxPropertyViewModel.cs" />
     <Compile Include="ViewModels\Form\RadioButtonPropertyViewModel.cs" />
     <Compile Include="ViewModels\Form\SignPropertyViewModel.cs" />
     <Compile Include="ViewModels\Form\TextFieldPropertyViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterCreateContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterTemplateListContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesCreateContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesTemplateListContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateColorContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateFileContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundTemplateListBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundTemplateListColorContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundTemplateListFileContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkCreateBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkCreateFileContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkCreateTextContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListFileContentViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListTextContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\PDFToolsContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\QuickToolsContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureCreateDialogViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SnapshotEditMenuViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\PDFEdit\ImageEditPropertyViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\PDFEdit\ImageTextEditPropertyViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\PDFEdit\PDFEditVM.cs" />
+    <Compile Include="ViewModels\PropertyPanel\PDFEdit\TextEditPropertyViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\Scan\ScanPropertyPanelViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\ViewModular\ReadViewContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\RecentFiles\RecentFilesContentViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\CustomCreateDialogViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\DynamicPropertyDialogViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\TextEditPropertyViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\CustomCreateDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\DynamicPropertyDialogViewModel.cs" />
+    <Compile Include="ViewModels\PropertyPanel\ViewModular\PageContentViewModel.cs" />
+    <Compile Include="ViewModels\Scan\ScanViwerViewModel.cs" />
     <Compile Include="ViewModels\Tools\ConverterBarContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />
@@ -465,6 +551,7 @@
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Function.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Properties.cs" />
+    <Compile Include="ViewModels\Tools\ScanContentViewModel.cs" />
     <Compile Include="ViewModels\Tools\TextEditToolContentViewModel.cs" />
     <Compile Include="ViewModels\Tools\ToolsBarContentViewModel.cs" />
     <Compile Include="ViewModels\EditTools\Watermark\WatermarkContentViewModel.cs" />
@@ -538,9 +625,48 @@
     <Compile Include="Views\Dialog\FullScreenWindow.xaml.cs">
       <DependentUpon>FullScreenWindow.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\CreateFromHtmlDialog.xaml.cs">
+      <DependentUpon>CreateFromHtmlDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateBaseContent.xaml.cs">
+      <DependentUpon>HomePageBackgroundCreateBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateColorContent.xaml.cs">
+      <DependentUpon>HomePageBackgroundCreateColorContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateFileContent.xaml.cs">
+      <DependentUpon>HomePageBackgroundCreateFileContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundDialog.xaml.cs">
+      <DependentUpon>HomePageBackgroundDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundTemplateListBaseContent.xaml.cs">
+      <DependentUpon>HomePageBackgroundTemplateListBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundTemplateListColorContent.xaml.cs">
+      <DependentUpon>HomePageBackgroundTemplateListColorContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundTemplateListFileContent.xaml.cs">
+      <DependentUpon>HomePageBackgroundTemplateListFileContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesCreateContent.xaml.cs">
+      <DependentUpon>HomePageBatesCreateContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesTemplateListContent.xaml.cs">
+      <DependentUpon>HomePageBatesTemplateListContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterCreateContent.xaml.cs">
+      <DependentUpon>HomePageHeaderFooterCreateContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterTemplateListContent.xaml.cs">
+      <DependentUpon>HomePageHeaderFooterTemplateListContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialog.xaml.cs">
       <DependentUpon>HomePageBatchProcessingDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesDialog.xaml.cs">
+      <DependentUpon>HomePageBatesDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialog.xaml.cs">
       <DependentUpon>HomePageCompressDialog.xaml</DependentUpon>
     </Compile>
@@ -559,12 +685,36 @@
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWord.xaml.cs">
       <DependentUpon>HomePageConverterWord.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterDialog.xaml.cs">
+      <DependentUpon>HomePageHeaderFooterDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageRemoveDialog.xaml.cs">
       <DependentUpon>HomePageRemoveDialog.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialog.xaml.cs">
       <DependentUpon>HomePageSetPasswordDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkCreateBaseContent.xaml.cs">
+      <DependentUpon>HomePageWatermarkCreateBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkCreateFileContent.xaml.cs">
+      <DependentUpon>HomePageWatermarkCreateFileContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkCreateTextContent.xaml.cs">
+      <DependentUpon>HomePageWatermarkCreateTextContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkDialog.xaml.cs">
+      <DependentUpon>HomePageWatermarkDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListBaseContent.xaml.cs">
+      <DependentUpon>HomePageWatermarkTemplateListBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListFileContent.xaml.cs">
+      <DependentUpon>HomePageWatermarkTemplateListFileContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListTextContent.xaml.cs">
+      <DependentUpon>HomePageWatermarkTemplateListTextContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageExtractDialog.xaml.cs">
       <DependentUpon>HomePageExtractDialog.xaml</DependentUpon>
     </Compile>
@@ -607,12 +757,24 @@
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterDialog.xaml.cs">
       <DependentUpon>HomePagePrinterDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\Redaction\MarkSettingDialog.xaml.cs">
+      <DependentUpon>MarkSettingDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\Redaction\PageMarkDialog.xaml.cs">
+      <DependentUpon>PageMarkDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\Redaction\RepeatMarkDialog.xaml.cs">
+      <DependentUpon>RepeatMarkDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\ToolsDialogs\CompressDialogs\CompressDialog.xaml.cs">
       <DependentUpon>CompressDialog.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\Dialog\ToolsDialogs\CompressDialogs\CompressProgressBarDialog.xaml.cs">
       <DependentUpon>CompressProgressBarDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\ToolsDialogs\MergeDialog.xaml.cs">
+      <DependentUpon>MergeDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\ToolsDialogs\SaftyDialogs\CheckPasswordDialog.xaml.cs">
       <DependentUpon>CheckPasswordDialog.xaml</DependentUpon>
     </Compile>
@@ -628,9 +790,6 @@
     <Compile Include="Views\EditTools\Redaction\RedactionContent.xaml.cs">
       <DependentUpon>RedactionContent.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\EditTools\Redaction\RedactionDocumentContent.xaml.cs">
-      <DependentUpon>RedactionDocumentContent.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Views\EditTools\Bates\BatesContent.xaml.cs">
       <DependentUpon>BatesContent.xaml</DependentUpon>
     </Compile>
@@ -676,6 +835,12 @@
     <Compile Include="Views\Form\ComboxProperty.xaml.cs">
       <DependentUpon>ComboxProperty.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Form\EditPresetColorsDialog.xaml.cs">
+      <DependentUpon>EditPresetColorsDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Form\EmptyFormProperty.xaml.cs">
+      <DependentUpon>EmptyFormProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Form\FormsToolContent.xaml.cs">
       <DependentUpon>FormsToolContent.xaml</DependentUpon>
       <SubType>Code</SubType>
@@ -792,10 +957,10 @@
     <Compile Include="CustomControl\CompositeControl\SlidContentPop.xaml.cs">
       <DependentUpon>SlidContentPop.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\AnnotPanel\CustomCreateDialog.xaml.cs">
+    <Compile Include="Views\Dialog\CustomCreateDialog.xaml.cs">
       <DependentUpon>CustomCreateDialog.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\AnnotPanel\DynamicPropertyDialog.xaml.cs">
+    <Compile Include="Views\Dialog\DynamicPropertyDialog.xaml.cs">
       <DependentUpon>DynamicPropertyDialog.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\FreehandAnnotProperty.xaml.cs">
@@ -819,6 +984,9 @@
     <Compile Include="Views\PropertyPanel\AnnotPanel\SignatureCreateDialog.xaml.cs">
       <DependentUpon>SignatureCreateDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\AnnotPanel\SnapshotEditMenu.xaml.cs">
+      <DependentUpon>SnapshotEditMenu.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\StampAnnotProperty.xaml.cs">
       <DependentUpon>StampAnnotProperty.xaml</DependentUpon>
     </Compile>
@@ -828,11 +996,20 @@
     <Compile Include="CustomControl\CompositeControl\SlidContent.xaml.cs">
       <DependentUpon>SlidContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\PDFEdit\ImageEditProperty.xaml.cs">
+      <DependentUpon>ImageEditProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\PropertyPanel\PDFEdit\ImageTextEditProperty.xaml.cs">
+      <DependentUpon>ImageTextEditProperty.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\PropertyPanel\PDFEdit\TextEditProperty.xaml.cs">
+      <DependentUpon>TextEditProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\PropertyPanelContent.xaml.cs">
       <DependentUpon>PropertyPanelContent.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\TextEditProperty.xaml.cs">
-      <DependentUpon>TextEditProperty.xaml</DependentUpon>
+    <Compile Include="Views\PropertyPanel\Scan\ScanPropertyPanel.xaml.cs">
+      <DependentUpon>ScanPropertyPanel.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\PropertyPanel\ViewModular\ReadModeContent.xaml.cs">
       <DependentUpon>ReadModeContent.xaml</DependentUpon>
@@ -843,18 +1020,27 @@
     <Compile Include="Views\PropertyPanel\ViewModular\SplitScreenContent.xaml.cs">
       <DependentUpon>SplitScreenContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\ViewModular\PageContent.xaml.cs">
+      <DependentUpon>PageContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\ViewModular\ThemesContent.xaml.cs">
       <DependentUpon>ThemesContent.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\PropertyPanel\ViewModular\ViewModularContent.xaml.cs">
       <DependentUpon>ViewModularContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Scan\ScanViwer.xaml.cs">
+      <DependentUpon>ScanViwer.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Tools\AnnotToolContent.xaml.cs">
       <DependentUpon>AnnotToolContent.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\Tools\ConverterBarContent.xaml.cs">
       <DependentUpon>ConverterBarContent.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Tools\ScanContent.xaml.cs">
+      <DependentUpon>ScanContent.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Tools\TextEditToolContent.xaml.cs">
       <DependentUpon>TextEditToolContent.xaml</DependentUpon>
     </Compile>
@@ -884,6 +1070,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="CustomControl\CompositeControl\CustomComboControl.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="CustomControl\CompositeControl\SlidComboControl.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -892,6 +1082,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="CustomControl\Form\LayoutAglinContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="CustomControl\LoadingControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -908,6 +1102,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="CustomControl\PaginationControl.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="CustomControl\TextBoxWithTip.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -956,6 +1154,14 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Styles\ImageButtonStyle.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Styles\ImageRadioButtonDictionary.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\ListBoxStyle.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -976,10 +1182,18 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\PathRadioButtonDictionary.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\RadioButtonStyle.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\SeparatorStyle.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Styles\SliderStyle.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -992,6 +1206,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Styles\ToggleButton.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Styles\WindowsStyle.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -1092,14 +1310,98 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateBaseContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateColorContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundCreateFileContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundTemplateListBaseContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundTemplateListColorContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundTemplateListFileContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesCreateContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesTemplateListContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterCreateContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterTemplateListContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\CreateFromHtmlDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageRemoveDialog.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkCreateBaseContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkCreateFileContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkCreateTextContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListBaseContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListFileContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListTextContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterDocumentContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1144,6 +1446,22 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\Redaction\MarkSettingDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\Dialog\Redaction\PageMarkDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\Dialog\Redaction\RepeatMarkDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\Dialog\ToolsDialogs\MergeDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\EditTools\Bates\BatesContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1180,10 +1498,6 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\EditTools\Redaction\RedactionDocumentContent.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="Views\FillAndSign\FillAndSignContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1212,6 +1526,14 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Form\EditPresetColorsDialog.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\Form\EmptyFormProperty.xaml">
+      <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
+    </Page>
     <Page Include="Views\Form\FormsToolContent.xaml">
       <SubType>Designer</SubType>
       <Generator>XamlIntelliSenseFileGenerator</Generator>
@@ -1307,11 +1629,11 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\CustomCreateDialog.xaml">
+    <Page Include="Views\Dialog\CustomCreateDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\DynamicPropertyDialog.xaml">
+    <Page Include="Views\Dialog\DynamicPropertyDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
@@ -1367,6 +1689,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\AnnotPanel\SnapshotEditMenu.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\StampAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1409,14 +1735,26 @@
     <Page Include="Views\EditTools\Background\BackgroundCreateBaseContent.xaml">
       <SubType>Designer</SubType>
     </Page>
-    <Page Include="Views\PropertyPanel\PropertyPanelContent.xaml">
+    <Page Include="Views\PropertyPanel\PDFEdit\ImageEditProperty.xaml">
+      <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
+    </Page>
+    <Page Include="Views\PropertyPanel\PDFEdit\ImageTextEditProperty.xaml">
       <Generator>MSBuild:Compile</Generator>
+      <SubType>Designer</SubType>
     </Page>
-    <Page Include="Views\PropertyPanel\TextEditProperty.xaml">
+    <Page Include="Views\PropertyPanel\PDFEdit\TextEditProperty.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\PropertyPanel\PropertyPanelContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\PropertyPanel\Scan\ScanPropertyPanel.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\ViewModular\ReadModeContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1437,6 +1775,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\ViewModular\PageContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\ViewModular\ThemesContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1523,6 +1865,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\Scan\ScanViwer.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Tools\AnnotToolContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -1531,6 +1877,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Tools\ScanContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Tools\TextEditToolContent.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
@@ -1561,9 +1911,48 @@
       <Generator>SettingsSingleFileGenerator</Generator>
       <LastGenOutput>Settings.Designer.cs</LastGenOutput>
     </None>
+    <Content Include="ComDocumentAIKit.dll" />
+    <Resource Include="Resources\ToolBarIcon\Scan\enhance.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Resources\ToolBarIcon\Scan\ocr.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Resources\ToolBarIcon\Scan\batch.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Resources\BOTA\no_outline.png" />
+    <Resource Include="Resources\PropertyPanel\nosign.png" />
     <Content Include="source\AnalysisWord\Res\word\_rels\document.xml.rels">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
+    <None Include="x64\models\DA_image_enhance_magic_color_1.0.0.model">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="x64\models\DA_Ocr_Classification_1.0.0.model">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="x64\models\DA_Ocr_Detection_chinese_1.0.0.model">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="x64\models\DA_Ocr_Detection_english_1.0.0.model">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="x64\models\DA_Ocr_Recognition_chinese_1.0.0.model">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="x64\models\DA_Ocr_Recognition_chinese_cht_1.0.0.model">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="x64\models\DA_Ocr_Recognition_english_1.0.0.model">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="x64\models\DA_Ocr_Recognition_japan_1.0.0.model">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
+    <None Include="x64\models\DA_Ocr_Recognition_korean_1.0.0.model">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </None>
     <Resource Include="Resources\BOTA\Annotation\Arrow.png" />
     <Resource Include="Resources\BOTA\Annotation\Bookmark.png" />
     <Resource Include="Resources\BOTA\Annotation\Circle.png" />
@@ -1628,6 +2017,13 @@
     <Resource Include="Resources\StampIcons\SignHere.png" />
     <Resource Include="Resources\StampIcons\Void.png" />
     <Resource Include="Resources\StampIcons\Witness.png" />
+    <Resource Include="Resources\Dialog\AddImage.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Resources\Dialog\AddImageSuspend.png">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Resource>
+    <Resource Include="Resources\Dialog\help.png" />
     <Content Include="Resources\PageEdit\GridLine.jpg">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
@@ -1638,6 +2034,8 @@
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
     <Resource Include="Resources\EditTools\watermark_bg.png" />
+    <Resource Include="Resources\PropertyPanel\EmptyAnnot.png" />
+    <Resource Include="Resources\PropertyPanel\nostamp.png" />
     <Content Include="source\AnalysisWord\Res\_rels\.rels">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
@@ -1647,7 +2045,6 @@
   </ItemGroup>
   <ItemGroup>
     <Folder Include="Views\Edit\" />
-    <Folder Include="Views\Scan\" />
   </ItemGroup>
   <ItemGroup>
     <Content Include="ComOCRKit.Desk.dll">
@@ -1796,6 +2193,33 @@
     <Content Include="x64\CPDFConverterNative.dll">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
+    <Content Include="x64\DocumentAILib\ComDocumentAINative.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="x64\DocumentAILib\DocumentAI.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="x64\DocumentAILib\libiomp5md.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="x64\DocumentAILib\mkldnn.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="x64\DocumentAILib\mklml.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="x64\DocumentAILib\onnxruntime.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="x64\DocumentAILib\opencv_world420.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="x64\DocumentAILib\paddle2onnx.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
+    <Content Include="x64\DocumentAILib\paddle_inference.dll">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
     <Content Include="x64\libhpdf.dll">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
@@ -1851,12 +2275,26 @@
       <LastGenOutput>Resources.Designer.cs</LastGenOutput>
     </EmbeddedResource>
   </ItemGroup>
+  <ItemGroup>
+    <BootstrapperPackage Include=".NETFramework,Version=v4.6.2">
+      <Visible>False</Visible>
+      <ProductName>Microsoft .NET Framework 4.6.2 %28x86 和 x64%29</ProductName>
+      <Install>true</Install>
+    </BootstrapperPackage>
+    <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
+      <Visible>False</Visible>
+      <ProductName>.NET Framework 3.5 SP1</ProductName>
+      <Install>false</Install>
+    </BootstrapperPackage>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
     <PropertyGroup>
       <ErrorText>这台计算机上缺少此项目引用的 NuGet 程序包。使用“NuGet 程序包还原”可下载这些程序包。有关更多信息,请参见 http://go.microsoft.com/fwlink/?LinkID=322105。缺少的文件是 {0}。</ErrorText>
     </PropertyGroup>
     <Error Condition="!Exists('packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets'))" />
+    <Error Condition="!Exists('packages\Magick.NET-Q16-AnyCPU.12.2.2\build\netstandard20\Magick.NET-Q16-AnyCPU.targets')" Text="$([System.String]::Format('$(ErrorText)', 'packages\Magick.NET-Q16-AnyCPU.12.2.2\build\netstandard20\Magick.NET-Q16-AnyCPU.targets'))" />
   </Target>
   <Import Project="packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets" Condition="Exists('packages\SQLitePCLRaw.lib.e_sqlite3.2.0.2\build\net461\SQLitePCLRaw.lib.e_sqlite3.targets')" />
+  <Import Project="packages\Magick.NET-Q16-AnyCPU.12.2.2\build\netstandard20\Magick.NET-Q16-AnyCPU.targets" Condition="Exists('packages\Magick.NET-Q16-AnyCPU.12.2.2\build\netstandard20\Magick.NET-Q16-AnyCPU.targets')" />
 </Project>

+ 63 - 9
PDF Office/Properties/Resources.Designer.cs

@@ -19,10 +19,10 @@ namespace PDF_Office.Properties {
     // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。
     // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen
     // (以 /str 作为命令选项),或重新生成 VS 项目。
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
     [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    public class Resources {
+    internal class Resources {
         
         private static global::System.Resources.ResourceManager resourceMan;
         
@@ -36,7 +36,7 @@ namespace PDF_Office.Properties {
         ///   返回此类使用的缓存的 ResourceManager 实例。
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        public static global::System.Resources.ResourceManager ResourceManager {
+        internal static global::System.Resources.ResourceManager ResourceManager {
             get {
                 if (object.ReferenceEquals(resourceMan, null)) {
                     global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PDF_Office.Properties.Resources", typeof(Resources).Assembly);
@@ -51,7 +51,7 @@ namespace PDF_Office.Properties {
         ///   使用此强类型资源类的所有资源查找执行重写。
         /// </summary>
         [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
-        public static global::System.Globalization.CultureInfo Culture {
+        internal static global::System.Globalization.CultureInfo Culture {
             get {
                 return resourceCulture;
             }
@@ -60,25 +60,79 @@ namespace PDF_Office.Properties {
             }
         }
         
+        /// <summary>
+        ///   查找类似 *.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt; 的本地化字符串。
+        /// </summary>
+        internal static string excelex {
+            get {
+                return ResourceManager.GetString("excelex", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 *.html; 的本地化字符串。
+        /// </summary>
+        internal static string htmlex {
+            get {
+                return ResourceManager.GetString("htmlex", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 *.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi; 的本地化字符串。
+        /// </summary>
+        internal static string imageex {
+            get {
+                return ResourceManager.GetString("imageex", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 PDF Files (*.pdf)|*.pdf 的本地化字符串。
         /// </summary>
-        public static string OpenDialogFilter {
+        internal static string OpenDialogFilter {
             get {
                 return ResourceManager.GetString("OpenDialogFilter", resourceCulture);
             }
         }
         
+        /// <summary>
+        ///   查找类似 *.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm; 的本地化字符串。
+        /// </summary>
+        internal static string pptex {
+            get {
+                return ResourceManager.GetString("pptex", resourceCulture);
+            }
+        }
+        
         /// <summary>
         ///   查找类似 &lt;Lisences
-        ///	devKey = &quot;MR+QexuegNeqiBQsqcIcFzDeioHWjwb2vjDGnbooRo2BeTSWnmGnqHt8tHPlZxRRinYCeuW5DqGFyKcFfMVXAsip0AFj42LhYS9KBFus5kgXzOn+ZcLVFm1an4fKnn6ShRXnUWaemHBeaMzLbFEPbz6jDFFoIizuCMHP6KFf/6o=&quot;
-        ///	devSecret=&quot;mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iYSXB8erGstkUyaynN7k8ocNCYAAzc9CPxiym2TlqeSUWpLOaOv47bs7x+UqfQzn9hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSnkBnoGhqnvZdAqbtp5o0JTKDl1EzWv/F/0Gw7Q02pypAMFoEMtjKxkVmy+liLW9u9&quot;
-        ///	userKey = &quot;iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXz [字符串的其余部分被截断]&quot;; 的本地化字符串。
+        ///	devKey = &quot;BYAm61De27VtCV+WwCzs+IxatlXahRQ894cp5zIJcNoy4S+u6QppBNrYoVcjU4TPKR9DDYI8qIMvbFC8aA7TOyGh1e5tRipgo4YJ48cJ1Z4B/DTm6zsIr5jM9igrURcLn49YTdeImf1nNhwTm9xkegp3gFoGfVhv5I7xHR517kQ=&quot;
+        ///	devSecret=&quot;mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iYSXB8erGstkUyaynN7k8ocNCYAAzc9CPxiym2TlqeSUWpLOaOv47bs7x+UqfQzn9hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSnRzqdOnX7x2+q8tWByiVc2g+bTR9XTCabBT78l+Iey7cmsKlSJ3WFqmDWhwfT73yCYDNQpuarUAQxiS1PJu8kUw==&quot;
+        ///	userKey = &quot;iBPRM/Tz [字符串的其余部分被截断]&quot;; 的本地化字符串。
         /// </summary>
-        public static string SDKLisence {
+        internal static string SDKLisence {
             get {
                 return ResourceManager.GetString("SDKLisence", resourceCulture);
             }
         }
+        
+        /// <summary>
+        ///   查找类似 *.txt; 的本地化字符串。
+        /// </summary>
+        internal static string txtex {
+            get {
+                return ResourceManager.GetString("txtex", resourceCulture);
+            }
+        }
+        
+        /// <summary>
+        ///   查找类似 *.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm; 的本地化字符串。
+        /// </summary>
+        internal static string wordex {
+            get {
+                return ResourceManager.GetString("wordex", resourceCulture);
+            }
+        }
     }
 }

+ 23 - 0
PDF Office/Properties/Resources.resx

@@ -117,11 +117,34 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <data name="excelex" xml:space="preserve">
+    <value>*.xls;*.xlsx;*.xlsm;*.xlsb;*.xlam;*.xltx;*.xltm;*.xlt;</value>
+    <comment>支持的excel文档文件格式</comment>
+  </data>
+  <data name="htmlex" xml:space="preserve">
+    <value>*.html;</value>
+    <comment>支持的html格式</comment>
+  </data>
+  <data name="imageex" xml:space="preserve">
+    <value>*.jpg;*.cur;*.bmp;*.jpeg;*.gif;*.png;*.tiff;*.tif;*.pic;*.ico;*.icns;*.tga;*.psd;*.eps;*.hdr;*.jp2;*.jpc;*.pict;*.sgi;</value>
+  </data>
   <data name="OpenDialogFilter" xml:space="preserve">
     <value>PDF Files (*.pdf)|*.pdf</value>
   </data>
+  <data name="pptex" xml:space="preserve">
+    <value>*.ppt;*.pptx;*.pptm;*.pptsx;*.pps;*.pptsm;*.pot;*.potm;</value>
+    <comment>支持的ppt文档文件格式</comment>
+  </data>
   <assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
   <data name="SDKLisence" type="System.Resources.ResXFileRef, System.Windows.Forms">
     <value>..\SDKLisence.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;gb2312</value>
   </data>
+  <data name="txtex" xml:space="preserve">
+    <value>*.txt;</value>
+    <comment>支持的txt格式</comment>
+  </data>
+  <data name="wordex" xml:space="preserve">
+    <value>*.doc;*.docx;*.docm;*.dot;*.dotx;*.dotm;</value>
+    <comment>支持的word文档文件格式</comment>
+  </data>
 </root>

+ 15 - 4
PDF Office/Properties/Settings.Designer.cs

@@ -12,7 +12,7 @@ namespace PDF_Office.Properties {
     
     
     [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
-    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
+    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -23,8 +23,8 @@ namespace PDF_Office.Properties {
             }
         }
         
-        [global::System.Configuration.UserScopedSettingAttribute()]
-        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         public global::PDFSettings.Settings.RecentOpenFiles RecentOpenFiles {
             get {
                 return ((global::PDFSettings.Settings.RecentOpenFiles)(this["RecentOpenFiles"]));
@@ -169,7 +169,7 @@ namespace PDF_Office.Properties {
                 this["HeaderFooterIndex"] = value;
             }
         }
-        
+        
         [global::System.Configuration.UserScopedSettingAttribute()]
         [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
         public global::PDFSettings.CustomStampList CustomStampList {
@@ -191,5 +191,16 @@ namespace PDF_Office.Properties {
                 this["SignatureList"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::PDFSettings.RedactionSettings RedactionsSettings {
+            get {
+                return ((global::PDFSettings.RedactionSettings)(this["RedactionsSettings"]));
+            }
+            set {
+                this["RedactionsSettings"] = value;
+            }
+        }
     }
 }

+ 8 - 5
PDF Office/Properties/Settings.settings

@@ -41,11 +41,14 @@
     <Setting Name="HeaderFooterIndex" Type="System.Int32" Scope="User">
       <Value Profile="(Default)">0</Value>
     </Setting>
-    <Setting Name="CustomStampList" Type="PDFSettings.CustomStampList" Scope="User">
+    <Setting Name="CustomStampList" Type="PDFSettings.CustomStampList" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="SignatureList" Type="PDFSettings.SignatureList" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
+    <Setting Name="RedactionsSettings" Type="PDFSettings.RedactionSettings" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
-    <Setting Name="SignatureList" Type="PDFSettings.SignatureList" Scope="User">
-      <Value Profile="(Default)" />
-    </Setting>
-  </Settings>
+  </Settings>
 </SettingsFile>

BIN
PDF Office/Resources/BOTA/no_outline.png


BIN
PDF Office/Resources/Dialog/AddImage.png


BIN
PDF Office/Resources/Dialog/AddImageSuspend.png


BIN
PDF Office/Resources/Dialog/help.png


BIN
PDF Office/Resources/PropertyPanel/EmptyAnnot.png


BIN
PDF Office/Resources/PropertyPanel/nosign.png


BIN
PDF Office/Resources/PropertyPanel/nostamp.png


BIN
PDF Office/Resources/ToolBarIcon/Scan/batch.png


BIN
PDF Office/Resources/ToolBarIcon/Scan/enhance.png


BIN
PDF Office/Resources/ToolBarIcon/Scan/ocr.png


+ 4 - 5
PDF Office/SDKLisence.xml

@@ -1,11 +1,10 @@
 <Lisences
-	devKey = "sTHSivIW4YnZQavIYDLVw4vaFcN5DQTUtRGrVyv5p9aeaHX3GirG/MBxl6Wy9TJbNOwR4CU6LPjHmGe3Po3OtBCPqIRheam9+LomScw3AvoUTHFlG1134e2J4enF43WJQ6PyOnjwZqsG1kUdlBPNztkoPzDAE2pQKgZWf6V2i34="
-    devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6cfaiHpW8pgW2aur3AxuQIBBLuJD5gcmNxTYW3KA32JLG8alfyXjKFVS3gka9bngvwfZ7GuNXybjKlmz1tnN6iVHpnbSj+xOHhWEperY4HHrSg=="
-	userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs="
+	devKey = "BK8BcXWm+YbGRpEONe43pEJXhshAiAwWoBQgwlEUnxFBkCVal4AYW01RnbuwHCdkktvy9sAYs/SUflLR+KOMayg6z2TE2G3OhIXf95sN8k1sk947zrPGeHPtHx7gMaurYrscLDAumvtymhg4rMTg7XFKfBtchlAi0bE+wPTsqa8="
+  devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iYSXB8erGstkUyaynN7k8ocNCYAAzc9CPxiym2TlqeSUWpLOaOv47bs7x+UqfQzn9hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBwyVLBY93oKLBB8UJg4t07605BGbaBKUlDopA0iGq1HSnRAJhqHxGgIZ+m3BxAFwgabp2OdkT7I9klGmA/4KertEmsKlSJ3WFqmDWhwfT73yCYDNQpuarUAQxiS1PJu8kUw=="
+  userKey = "iBPRM/Tz8b6Z1G2GQt52X7hiNCGfVYXztnPjalgrgARvqfKV6lFNH8QeScTzBRYI8GGFpwelfgh790Kd9JmL7V4adI1jCiFHUT2DLT7QucxY5Nkgys2aJItQS482Ck2G2Xf8gNgojxYxRt65o/MEzkj93foj8qIdfHagXsSorSs="
 	userSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4ivEHOmPIqbfhpDnKKj+7Ymj2rXQvfZRmke06HMV+3tt064G64WjPW8+EbGCNZaAh1hrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1FKJi6HYB+DuugQyaqI2prfej861QnJrU4s2T/npZK/"
 	ConverterDevKey="Eahwo7OZAYHJaCF7TJQYKSVqC62MzfBdllVXnC5BRR5BQFDKnQ1FJtCRVdug+VNg/ti+/DeA5Sq4IH2CBpQjAZst5705uk5Sz0ZwRu8Qdn9HFGwh2pG6dJEIrl7lOccoZS6+1IxgOTcTeHqYpym3NsmtbhBWE848Pvme3scpW28="
 	ConverterDevSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iccr16WMBclnQACarlyblNUvAm/S8uFbhXMvxwgBSgULSsrbuyF/SIZ3I+dl0qU8EiR4IKrcJxus3VRNu+jx8P7CGq2BlSjPVXRHBI1lV8ukpCIUGmcK+P+Z0QbYdkAHAm6NPgs2c4tp1jOFPPbnUkTtX7riDb9xRCx1YNm3/+xd96PzrVCcmtTizZP+elkr8="
 	ConverterUserkey=" WLUHzXhndQKyrTJVzvZ+dvPXDQDZeJpcSvklX3GJwRX4+urd8eQskYgbeCf0NXLZ/qJkS/k10x+qGad34i4v5rI/ASFIx901c/Nw5C0YJMH7X87dib141tdAmSmQhnKLO5TBi4FiAidboyvnLFLrYGMmS2kLQOXFPwPj5zQUv5A="
-	ConverterUserSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iK16EcneqBPRe2eKQLuJXpA79IONX9GVI/Ap3uWzMcNWaitc2UB6gDeexJXFPVaXOFAoV6NtcUJC8skonXVk7k/oKTJGcYKLPGdXenrzHolQ=="
-	>
+	ConverterUserSecret="mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4iK16EcneqBPRe2eKQLuJXpA79IONX9GVI/Ap3uWzMcNWaitc2UB6gDeexJXFPVaXOFAoV6NtcUJC8skonXVk7k/oKTJGcYKLPGdXenrzHolQ==" >
 </Lisences>

+ 60 - 32
PDF Office/Styles/ButtonStyle.xaml

@@ -17,14 +17,19 @@
             </Setter.Value>
         </Setter>
     </Style>
-    <Style
-        x:Key="PageEditToolBtn"
-        BasedOn="{StaticResource TitleBarBtn}"
-        TargetType="{x:Type Button}">
-        <Setter Property="Background" Value="Transparent" />
-        <Setter Property="BorderBrush" Value="Transparent" />
-        <Setter Property="Width" Value="auto" />
-        <Setter Property="Height" Value="40" />
+
+    <Style x:Key="TitleBarBtn" TargetType="{x:Type Button}">
+        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+        <Setter Property="Background" Value="{StaticResource Button.Static.Background}" />
+        <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Padding" Value="0" />
+        <Setter Property="Width" Value="32" />
+        <Setter Property="Height" Value="32" />
+        <Setter Property="IsTabStop" Value="False" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type Button}">
@@ -45,36 +50,30 @@
                     </Border>
                     <ControlTemplate.Triggers>
                         <Trigger Property="IsMouseOver" Value="true">
-                            <Setter TargetName="border" Property="Background" Value="#1A000000" />
+                            <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
                             <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.MouseOver.Border}" />
                         </Trigger>
                         <Trigger Property="IsPressed" Value="true">
-                            <Setter TargetName="border" Property="Background" Value="#26000000" />
+                            <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
                             <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.Pressed.Border}" />
                         </Trigger>
                         <Trigger Property="IsEnabled" Value="false">
-                            <Setter TargetName="border" Property="Background" Value="Transparent" />
-                            <Setter TargetName="border" Property="BorderBrush" Value="#33000000" />
-                            <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="#FF999999" />
-                            <Setter TargetName="contentPresenter" Property="Opacity" Value="0.4" />
+                            <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{StaticResource Button.Disabled.Foreground}" />
+                            <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
                         </Trigger>
                     </ControlTemplate.Triggers>
                 </ControlTemplate>
             </Setter.Value>
         </Setter>
     </Style>
-    <Style x:Key="TitleBarBtn" TargetType="{x:Type Button}">
-        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
-        <Setter Property="Background" Value="{StaticResource Button.Static.Background}" />
-        <Setter Property="BorderBrush" Value="{StaticResource Button.Static.Border}" />
-        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
-        <Setter Property="BorderThickness" Value="0" />
-        <Setter Property="HorizontalContentAlignment" Value="Center" />
-        <Setter Property="VerticalContentAlignment" Value="Center" />
-        <Setter Property="Padding" Value="0" />
-        <Setter Property="Width" Value="32" />
-        <Setter Property="Height" Value="32" />
-        <Setter Property="IsTabStop" Value="False" />
+    <Style
+        x:Key="PageEditToolBtn"
+        BasedOn="{StaticResource TitleBarBtn}"
+        TargetType="{x:Type Button}">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="BorderBrush" Value="Transparent" />
+        <Setter Property="Width" Value="auto" />
+        <Setter Property="Height" Value="40" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type Button}">
@@ -95,23 +94,24 @@
                     </Border>
                     <ControlTemplate.Triggers>
                         <Trigger Property="IsMouseOver" Value="true">
-                            <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
+                            <Setter TargetName="border" Property="Background" Value="#1A000000" />
                             <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.MouseOver.Border}" />
                         </Trigger>
                         <Trigger Property="IsPressed" Value="true">
-                            <Setter TargetName="border" Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
+                            <Setter TargetName="border" Property="Background" Value="#26000000" />
                             <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource Button.Pressed.Border}" />
                         </Trigger>
                         <Trigger Property="IsEnabled" Value="false">
-                            <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="{StaticResource Button.Disabled.Foreground}" />
-                            <Setter TargetName="contentPresenter" Property="Opacity" Value="0.5" />
+                            <Setter TargetName="border" Property="Background" Value="Transparent" />
+                            <Setter TargetName="border" Property="BorderBrush" Value="#33000000" />
+                            <Setter TargetName="contentPresenter" Property="TextElement.Foreground" Value="#FF999999" />
+                            <Setter TargetName="contentPresenter" Property="Opacity" Value="0.4" />
                         </Trigger>
                     </ControlTemplate.Triggers>
                 </ControlTemplate>
             </Setter.Value>
         </Setter>
     </Style>
-
     <Style
         x:Key="CloseBtn"
         BasedOn="{StaticResource TitleBarBtn}"
@@ -198,7 +198,6 @@
         </Setter>
     </Style>
 
-
     <Style x:Key="NoColorBtn" TargetType="{x:Type Button}">
         <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
         <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
@@ -580,4 +579,33 @@
             </Trigger>
         </Style.Triggers>
     </Style>
+
+    <!--  Design Token SubToolBar Style  -->
+    <Style
+        x:Key="subToolBar"
+        BasedOn="{StaticResource Btn.cta}"
+        TargetType="{x:Type Button}">
+        <Setter Property="Template" Value="{StaticResource ButtonControlTemplateWithCorner4}" />
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Width" Value="28" />
+        <Setter Property="Height" Value="28" />
+        <Style.Triggers>
+            <Trigger Property="IsDefaulted" Value="true">
+                <Setter Property="Background" Value="Transparent" />
+            </Trigger>
+            <Trigger Property="IsMouseOver" Value="true">
+                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+            </Trigger>
+            <Trigger Property="IsPressed" Value="true">
+                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+            </Trigger>
+            <Trigger Property="IsEnabled" Value="false">
+                <Setter Property="Background" Value="Transparent" />
+                <Setter Property="Opacity" Value="0.6" />
+                <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
+            </Trigger>
+        </Style.Triggers>
+    </Style>
 </ResourceDictionary>

+ 5 - 5
PDF Office/Styles/CheckBoxStyle.xaml

@@ -105,7 +105,7 @@
             </Trigger>
         </ControlTemplate.Triggers>
     </ControlTemplate>
-    
+
     <Style x:Key="EditToolsCheckBoxStyle" TargetType="{x:Type CheckBox}">
         <Setter Property="SnapsToDevicePixels" Value="true" />
         <Setter Property="OverridesDefaultStyle" Value="False" />
@@ -164,10 +164,10 @@
                             <Setter TargetName="CheckBoxRectangle" Property="Fill" Value="#FF00A8E0" />
                             <Setter TargetName="CheckBoxRectangle" Property="Opacity" Value="1" />
                             <Setter TargetName="CheckBoxRectangleOut" Property="Stroke" Value="Transparent" />
-                            <Setter TargetName="CheckedMark" Property="Visibility" Value="Visible"></Setter>
-                            <Setter TargetName="CheckBoxRectangle" Property="Fill" Value="#000000"></Setter>
-                            <Setter TargetName="CheckBoxRectangle" Property="Opacity" Value="1"></Setter>
-                            <Setter TargetName="CheckBoxRectangleOut" Property="Stroke" Value="Transparent"></Setter>
+                            <Setter TargetName="CheckedMark" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="CheckBoxRectangle" Property="Fill" Value="#000000" />
+                            <Setter TargetName="CheckBoxRectangle" Property="Opacity" Value="1" />
+                            <Setter TargetName="CheckBoxRectangleOut" Property="Stroke" Value="Transparent" />
                         </Trigger>
                     </ControlTemplate.Triggers>
                 </ControlTemplate>

+ 91 - 1
PDF Office/Styles/ContextMenuStyle.xaml

@@ -19,7 +19,6 @@
                 </Path>
             </MenuItem.Icon>
         </MenuItem>
-
     </ContextMenu>
 
     <ContextMenu x:Key="SelectAnnotContextMenu" FontSize="14">
@@ -82,4 +81,95 @@
         </MenuItem>
     </ContextMenu>
 
+    <!--  注释-内容选择-右键菜单  -->
+    <ContextMenu x:Key="SnapshotContextMenu" FontSize="14">
+        <!--<ContextMenu.ItemContainerStyle>
+            <Style TargetType="MenuItem">
+                <Setter Property="Padding" Value="0,7,0,7" />
+                <Setter Property="VerticalContentAlignment" Value="Center" />
+                <Setter Property="HorizontalContentAlignment" Value="Left" />
+            </Style>
+        </ContextMenu.ItemContainerStyle>-->
+        <MenuItem
+            Name="BtnSnapCopy"
+            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="BtnSnapExport"
+            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 Name="MenuExportPNG" Header="PNG" />
+            <MenuItem Name="MenuExportJPG" Header="JPG" />
+            <MenuItem Name="MenuExportPDF" Header="PDF" />
+        </MenuItem>
+
+        <MenuItem
+            Name="BtnSnapCropping"
+            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="BtnSnapZoom"
+            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="BtnSnapPrint"
+            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="RedactionContextMenu">
+        <MenuItem
+            Name="MenuDelete"
+            Command="{x:Static ApplicationCommands.Delete}"
+            CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
+            Header="Delete" />
+        <Separator Style="{StaticResource HorizontalSeparatorStyle}" />
+        <MenuItem Name="MenuProperties" Header="Properties..." />
+        <MenuItem Name="MenuSetDeufalt" Header="Use Current Properties as New Default" />
+        <Separator Style="{StaticResource HorizontalSeparatorStyle}" />
+        <MenuItem Name="MenuRepeat" Header="Repeat mark across pages" />
+        <MenuItem Name="MenuApply" Header="Apply Redactions" />
+        <MenuItem Name="MenuErase" Header="Erase Redactions" />
+    </ContextMenu>
 </ResourceDictionary>

+ 97 - 12
PDF Office/Styles/CustomBtnStyle.xaml

@@ -88,7 +88,7 @@
         <Setter Property="BorderThickness" Value="0" />
         <Setter Property="HorizontalContentAlignment" Value="Left" />
         <Setter Property="VerticalContentAlignment" Value="Top" />
-        <Setter Property="Height" Value="40" />
+        <Setter Property="Height" Value="25" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="customControl:CustomIconToggleBtn">
@@ -100,14 +100,14 @@
                         SnapsToDevicePixels="true">
                         <Grid>
                             <Grid
-                                Width="40"
-                                Height="40"
+                                Width="25"
+                                Height="25"
                                 HorizontalAlignment="Left"
                                 VerticalAlignment="Top">
                                 <Image
                                     x:Name="ImageIcon"
-                                    Width="20"
-                                    Height="20"
+                                    Width="25"
+                                    Height="25"
                                     Source="{Binding Icon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                                     Visibility="Collapsed" />
                             </Grid>
@@ -477,7 +477,7 @@
                             <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
                         </Trigger>
                         <Trigger Property="IsChecked" Value="true">
-                            <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="Red" />
                             <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
                         </Trigger>
                         <Trigger Property="IsChecked" Value="{x:Null}">
@@ -498,6 +498,68 @@
         <Setter Property="Height" Value="80" />
         <Setter Property="HorizontalContentAlignment" Value="Center" />
         <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type RadioButton}">
+                    <Grid
+                        x:Name="templateRoot"
+                        Background="Transparent"
+                        SnapsToDevicePixels="True">
+                        <Border
+                            x:Name="radioButtonBorder"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            CornerRadius="4">
+                            <Rectangle
+                                x:Name="optionMark"
+                                Width="{TemplateBinding Width}"
+                                Height="{TemplateBinding Height}"
+                                Opacity="0" />
+                        </Border>
+                        <ContentPresenter
+                            x:Name="contentPresenter"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                    </Grid>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+        <Style.Triggers>
+            <Trigger Property="IsMouseOver" Value="true">
+                <Setter Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
+                <Setter Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
+            </Trigger>
+            <Trigger Property="IsEnabled" Value="false">
+                <Setter Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
+                <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
+            </Trigger>
+            <Trigger Property="IsChecked" Value="True">
+                <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+            </Trigger>
+            <Trigger Property="IsPressed" Value="true">
+                <Setter Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
+                <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
+            </Trigger>
+        </Style.Triggers>
+    </Style>
+
+    <!--  带有蓝色边框的单选按钮  -->
+    <Style x:Key="BlueBorderRadionButtonWithCorner" TargetType="{x:Type RadioButton}">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="BorderBrush" Value="Transparent" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Width" Value="72" />
+        <Setter Property="Height" Value="80" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type RadioButton}">
@@ -530,8 +592,6 @@
                     </Grid>
                     <ControlTemplate.Triggers>
                         <Trigger Property="IsMouseOver" Value="true">
-                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
-                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
                             <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
                         </Trigger>
                         <Trigger Property="IsEnabled" Value="false">
@@ -540,13 +600,11 @@
                             <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
                         </Trigger>
                         <Trigger Property="IsPressed" Value="true">
-                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
-                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
+
                             <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
                         </Trigger>
                         <Trigger Property="IsChecked" Value="true">
-                            <Setter TargetName="optionMark" Property="Opacity" Value="1" />
-                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="blue" />
                         </Trigger>
                         <Trigger Property="IsChecked" Value="{x:Null}">
                             <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
@@ -557,6 +615,33 @@
         </Setter>
     </Style>
 
+    <!--  Design Token SubToolbar lv2 radionbutton  -->
+    <Style
+        x:Key="SubToolbarRdb"
+        BasedOn="{StaticResource RectangleRadionButtonWithCorner}"
+        TargetType="{x:Type RadioButton}">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="FontSize" Value="12" />
+        <Setter Property="FontFamily" Value="Segoe UI" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <!--<Style.Triggers>
+        <Trigger Property="IsMouseOver" Value="True">
+        <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+        </Trigger>
+        <Trigger Property="IsPressed" Value="True">
+        <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+        </Trigger>
+        <Trigger Property="IsChecked" Value="True">
+        <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+        </Trigger>
+        <Trigger Property="IsEnabled" Value="False">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
+        </Trigger>
+        </Style.Triggers>-->
+    </Style>
+
     <Style x:Key="HomePageCompressBtn" TargetType="Button">
         <Setter Property="Background" Value="White" />
         <Setter Property="BorderBrush" Value="White" />

+ 98 - 0
PDF Office/Styles/ImageButtonStyle.xaml

@@ -0,0 +1,98 @@
+<ResourceDictionary
+    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">
+    <Style TargetType="{x:Type customControl:ImageButton}">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type customControl:ImageButton}">
+
+                    <Border
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}">
+                        <Grid x:Name="grid" Background="{TemplateBinding Background}">
+                            <Border
+                                x:Name="PART_Border"
+                                Background="{TemplateBinding Background}"
+                                BorderBrush="{TemplateBinding BorderBrush}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                CornerRadius="{TemplateBinding CornerRadius}" />
+
+                            <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
+                                <StackPanel
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="Center"
+                                    Orientation="{TemplateBinding IconContentOrientation}">
+                                    <Grid HorizontalAlignment="Center" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
+                                        <Image
+                                            x:Name="PART_Icon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding Icon}" />
+                                        <Image
+                                            x:Name="PART_MouseOverIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding IconMouseOver}"
+                                            Visibility="Collapsed" />
+                                        <Image
+                                            x:Name="PART_PressIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding IconPress}"
+                                            Visibility="Collapsed" />
+                                    </Grid>
+                                    <TextBlock
+                                        x:Name="PART_Content"
+                                        Margin="{TemplateBinding IconContentMargin}"
+                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                        Foreground="{TemplateBinding Foreground}"
+                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+                                        Text="{TemplateBinding Content}"
+                                        TextTrimming="CharacterEllipsis" />
+                                </StackPanel>
+                            </Grid>
+                        </Grid>
+                    </Border>
+
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseOverBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageButton}}}" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter Property="Opacity" Value="0.5" />
+                        </Trigger>
+
+                        <Trigger SourceName="PART_Content" Property="Text" Value="">
+                            <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger SourceName="PART_Content" Property="Text" Value="{x:Null}">
+                            <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

+ 116 - 0
PDF Office/Styles/ImageRadioButtonDictionary.xaml

@@ -0,0 +1,116 @@
+<ResourceDictionary
+    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">
+
+    <Style TargetType="{x:Type customControl:ImageRadioButton}">
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type customControl:ImageRadioButton}">
+
+                    <Border
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}">
+                        <Grid x:Name="grid" Background="{TemplateBinding Background}">
+                            <Border
+                                x:Name="PART_Border"
+                                Background="{TemplateBinding Background}"
+                                BorderBrush="{TemplateBinding BorderBrush}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                CornerRadius="{TemplateBinding CornerRadius}" />
+
+                            <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
+                                <StackPanel
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="Center"
+                                    Orientation="{TemplateBinding IconContentOrientation}">
+                                    <Grid HorizontalAlignment="Center" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
+                                        <Image
+                                            x:Name="PART_Icon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding Icon}" />
+                                        <Image
+                                            x:Name="PART_MouseOverIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding IconMouseOver}"
+                                            Visibility="Collapsed" />
+                                        <Image
+                                            x:Name="PART_PressIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding IconPress}"
+                                            Visibility="Collapsed" />
+                                        <Image
+                                            x:Name="PART_CheckedIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Source="{TemplateBinding IconChecked}"
+                                            Visibility="Collapsed" />
+                                    </Grid>
+                                    <TextBlock
+                                        x:Name="PART_Content"
+                                        Margin="{TemplateBinding IconContentMargin}"
+                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                        Foreground="{TemplateBinding Foreground}"
+                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+                                        Text="{TemplateBinding Content}"
+                                        TextTrimming="CharacterEllipsis" />
+                                </StackPanel>
+                            </Grid>
+                        </Grid>
+                    </Border>
+
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter Property="Opacity" Value="0.5" />
+                        </Trigger>
+
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:ImageRadioButton}}}" />
+                            <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" />
+                        </Trigger>
+
+                        <Trigger SourceName="PART_Content" Property="Text" Value="">
+                            <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger SourceName="PART_Content" Property="Text" Value="{x:Null}">
+                            <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

Разлика између датотеке није приказан због своје велике величине
+ 1 - 0
PDF Office/Styles/OutLineItemStyle.xaml


+ 7 - 0
PDF Office/Styles/PathButtonStyle.xaml

@@ -74,6 +74,13 @@
                                         Text="{TemplateBinding Content}"
                                         TextTrimming="CharacterEllipsis" />
                                 </StackPanel>
+                                <ContentPresenter
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Focusable="False"
+                                    RecognizesAccessKey="True"
+                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                             </Grid>
                         </Grid>
                     </Border>

+ 137 - 0
PDF Office/Styles/PathRadioButtonDictionary.xaml

@@ -0,0 +1,137 @@
+<ResourceDictionary
+    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">
+    <Style TargetType="{x:Type customControl:PathRadioButton}">
+        <Setter Property="IconOpacity" Value="1" />
+        <Setter Property="IconMouseOverOpacity" Value="1" />
+        <Setter Property="IconPressOpacity" Value="1" />
+        <Setter Property="IconCheckedOpacity" Value="1" />
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type customControl:PathRadioButton}">
+
+                    <Border
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}">
+                        <Grid x:Name="grid" Background="{TemplateBinding Background}">
+                            <Border
+                                x:Name="PART_Border"
+                                Background="{TemplateBinding Background}"
+                                BorderBrush="{TemplateBinding BorderBrush}"
+                                BorderThickness="{TemplateBinding BorderThickness}"
+                                CornerRadius="{TemplateBinding CornerRadius}" />
+
+                            <Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
+                                <StackPanel
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="Center"
+                                    VerticalAlignment="Center"
+                                    Orientation="{TemplateBinding IconContentOrientation}">
+                                    <Grid HorizontalAlignment="Center" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
+                                        <Path
+                                            x:Name="PART_Icon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Data="{TemplateBinding Icon}"
+                                            Fill="{TemplateBinding IconFill}"
+                                            Opacity="{TemplateBinding IconOpacity}" />
+                                        <Path
+                                            x:Name="PART_MouseOverIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Data="{TemplateBinding IconMouseOver}"
+                                            Fill="{TemplateBinding IconMouseOverFill}"
+                                            Opacity="{TemplateBinding IconMouseOverOpacity}"
+                                            Visibility="Collapsed" />
+                                        <Path
+                                            x:Name="PART_PressIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Data="{TemplateBinding IconPress}"
+                                            Fill="{TemplateBinding IconPressFill}"
+                                            Opacity="{TemplateBinding IconPressOpacity}"
+                                            Visibility="Collapsed" />
+                                        <Path
+                                            x:Name="PART_CheckedIcon"
+                                            Width="{TemplateBinding IconWidth}"
+                                            Height="{TemplateBinding IconHeight}"
+                                            Data="{TemplateBinding IconChecked}"
+                                            Fill="{TemplateBinding IconCheckedFill}"
+                                            Opacity="{TemplateBinding IconCheckedOpacity}"
+                                            Visibility="Collapsed" />
+                                    </Grid>
+                                    <TextBlock
+                                        x:Name="PART_Content"
+                                        Margin="{TemplateBinding IconContentMargin}"
+                                        HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                        VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                        Foreground="{TemplateBinding Foreground}"
+                                        SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
+                                        Text="{TemplateBinding Content}"
+                                        TextTrimming="CharacterEllipsis" />
+                                </StackPanel>
+                                <ContentPresenter
+                                    Margin="{TemplateBinding Padding}"
+                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                    Focusable="False"
+                                    RecognizesAccessKey="True"
+                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                            </Grid>
+                        </Grid>
+                    </Border>
+
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="IsMouseOver" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseOverForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseOverBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseOverBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseOverBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseDownBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_PressIcon" Property="Visibility" Value="Visible" />
+                            <Setter TargetName="PART_Icon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_MouseOverIcon" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_CheckedIcon" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter Property="Opacity" Value="0.5" />
+                        </Trigger>
+
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="PART_Content" Property="Foreground" Value="{Binding MouseDownForeground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Background" Value="{Binding MouseDownBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="Opacity" Value="{Binding MouseDownBackgroundOpacity, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <Setter TargetName="PART_Border" Property="BorderBrush" Value="{Binding MouseDownBorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type customControl:PathRadioButton}}}" />
+                            <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" />
+                        </Trigger>
+                        <Trigger SourceName="PART_Content" Property="Text" Value="">
+                            <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+
+                        <Trigger SourceName="PART_Content" Property="Text" Value="{x:Null}">
+                            <Setter TargetName="PART_Content" Property="Visibility" Value="Collapsed" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
+</ResourceDictionary>

+ 106 - 27
PDF Office/Styles/RadioButtonStyle.xaml

@@ -50,7 +50,7 @@
         <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
         <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
         <Setter Property="BorderThickness" Value="0" />
-        <Setter Property="Width" Value="60" />
+        <Setter Property="Width" Value="68" />
         <Setter Property="Height" Value="80" />
         <Setter Property="HorizontalContentAlignment" Value="Center" />
         <Setter Property="VerticalContentAlignment" Value="Center" />
@@ -67,7 +67,8 @@
                             VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                             Background="{TemplateBinding Background}"
                             BorderBrush="{TemplateBinding BorderBrush}"
-                            BorderThickness="{TemplateBinding BorderThickness}">
+                            BorderThickness="{TemplateBinding BorderThickness}"
+                            CornerRadius="4">
                             <Rectangle
                                 x:Name="optionMark"
                                 Width="{TemplateBinding Width}"
@@ -120,7 +121,78 @@
         <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
         <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
         <Setter Property="BorderThickness" Value="0" />
-        <Setter Property="Width" Value="78" />
+        <Setter Property="Width" Value="76" />
+        <Setter Property="Height" Value="80" />
+        <Setter Property="HorizontalContentAlignment" Value="Center" />
+        <Setter Property="VerticalContentAlignment" Value="Center" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type RadioButton}">
+                    <Grid
+                        x:Name="templateRoot"
+                        Background="Transparent"
+                        SnapsToDevicePixels="True">
+                        <Border
+                            x:Name="radioButtonBorder"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Background="{TemplateBinding Background}"
+                            BorderBrush="{TemplateBinding BorderBrush}"
+                            BorderThickness="{TemplateBinding BorderThickness}">
+                            <Rectangle
+                                x:Name="optionMark"
+                                Width="{TemplateBinding Width}"
+                                Height="{TemplateBinding Height}"
+                                Opacity="0" />
+                        </Border>
+                        <ContentPresenter
+                            x:Name="contentPresenter"
+                            Margin="{TemplateBinding Padding}"
+                            HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                            VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                            Focusable="False"
+                            RecognizesAccessKey="True"
+                            SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                    </Grid>
+                    <ControlTemplate.Triggers>
+                        <Trigger Property="HasContent" Value="true">
+                            <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
+                            <Setter Property="Padding" Value="4,-1,0,0" />
+                        </Trigger>
+                        <Trigger Property="IsMouseOver" Value="true">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.MouseOver.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.MouseOver.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.MouseOver.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="false">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Disabled.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Disabled.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Disabled.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="true">
+                            <Setter TargetName="radioButtonBorder" Property="Background" Value="{StaticResource RadioButton.Pressed.Background}" />
+                            <Setter TargetName="radioButtonBorder" Property="BorderBrush" Value="{StaticResource RadioButton.Pressed.Border}" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="true">
+                            <Setter TargetName="optionMark" Property="Opacity" Value="1" />
+                            <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource RadioButton.Pressed.Glyph}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="{x:Null}">
+                            <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+    <Style x:Key="ViewModeViewRadioBtn" TargetType="{x:Type RadioButton}">
+        <Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisual}" />
+        <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
+        <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Width" Value="72" />
         <Setter Property="Height" Value="80" />
         <Setter Property="HorizontalContentAlignment" Value="Center" />
         <Setter Property="VerticalContentAlignment" Value="Center" />
@@ -240,7 +312,6 @@
                                 RecognizesAccessKey="True"
                                 SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                         </Grid>
-
                     </Border>
 
                     <ControlTemplate.Triggers>
@@ -277,7 +348,7 @@
                             <Setter TargetName="root" Property="Border.Background" Value="White" />
                         </Trigger>
                         <Trigger Property="IsChecked" Value="{x:Null}">
-                            <Setter Property="Opacity" TargetName="optionMark" Value="0.56"/>
+                            <Setter TargetName="optionMark" Property="Opacity" Value="0.56" />
                         </Trigger>
                     </ControlTemplate.Triggers>
                 </ControlTemplate>
@@ -285,7 +356,7 @@
         </Setter>
     </Style>
 
-    <Style x:Key="LocationRadioBtnStyle"  TargetType="{x:Type RadioButton}">
+    <Style x:Key="LocationRadioBtnStyle" TargetType="{x:Type RadioButton}">
         <Setter Property="Background" Value="{StaticResource RadioButton.Static.Background}" />
         <Setter Property="BorderBrush" Value="{StaticResource RadioButton.Static.Border}" />
         <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
@@ -374,7 +445,6 @@
                             Focusable="False"
                             RecognizesAccessKey="True"
                             SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
-
                     </Border>
                     <ControlTemplate.Triggers>
                         <Trigger Property="HasContent" Value="true">
@@ -383,7 +453,6 @@
                         </Trigger>
                         <Trigger Property="IsMouseOver" Value="true">
                             <Setter TargetName="templateRoot" Property="Background" Value="#EDEEF0" />
-
                         </Trigger>
                         <Trigger Property="IsEnabled" Value="false">
                             <Setter TargetName="templateRoot" Property="Opacity" Value="0.5" />
@@ -406,36 +475,46 @@
     </Style>
 
     <Style x:Key="BatchButton" TargetType="{x:Type RadioButton}">
-        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
-        <Setter Property="Background" Value="#F7F8FA"/>
-        <Setter Property="BorderThickness" Value="0"/>
-        <Setter Property="Cursor" Value="Hand"/>
+        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
+        <Setter Property="Background" Value="#F7F8FA" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Cursor" Value="Hand" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type RadioButton}">
                     <ControlTemplate.Resources>
                         <Storyboard x:Key="Storyboard1">
-                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="bd">
-                                <EasingColorKeyFrame KeyTime="0" Value="White"/>
-                                <EasingColorKeyFrame KeyTime="0:0:0.3" Value="#FFAFAFAF"/>
+                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
+                                <EasingColorKeyFrame KeyTime="0" Value="White" />
+                                <EasingColorKeyFrame KeyTime="0:0:0.3" Value="#FFAFAFAF" />
                             </ColorAnimationUsingKeyFrames>
                         </Storyboard>
                         <Storyboard x:Key="Storyboard2">
-                            <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)" Storyboard.TargetName="bd">
-                                <EasingColorKeyFrame KeyTime="0" Value="#FFAFAFAF"/>
-                                <EasingColorKeyFrame KeyTime="0:0:0.5" Value="#D3D3D3"/>
+                            <ColorAnimationUsingKeyFrames Storyboard.TargetName="bd" Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
+                                <EasingColorKeyFrame KeyTime="0" Value="#FFAFAFAF" />
+                                <EasingColorKeyFrame KeyTime="0:0:0.5" Value="#D3D3D3" />
                             </ColorAnimationUsingKeyFrames>
                         </Storyboard>
                     </ControlTemplate.Resources>
                     <BulletDecorator Background="Transparent">
-                        <Border x:Name="bd"  HorizontalAlignment="Center" Background="White" CornerRadius="5">
+                        <Border
+                            x:Name="bd"
+                            HorizontalAlignment="Center"
+                            Background="White"
+                            CornerRadius="5">
                             <Border.OpacityMask>
-                                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
-                                    <GradientStop Color="Black" Offset="0"/>
-                                    <GradientStop Color="White" Offset="1"/>
+                                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
+                                    <GradientStop Offset="0" Color="Black" />
+                                    <GradientStop Offset="1" Color="White" />
                                 </LinearGradientBrush>
                             </Border.OpacityMask>
-                            <ContentPresenter Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                            <ContentPresenter
+                                Width="{TemplateBinding Width}"
+                                Height="{TemplateBinding Height}"
+                                Margin="{TemplateBinding Padding}"
+                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
+                                RecognizesAccessKey="True" />
                         </Border>
                     </BulletDecorator>
                     <ControlTemplate.Triggers>
@@ -447,17 +526,17 @@
                         </Trigger>
                         <Trigger Property="IsChecked" Value="true">
                             <Trigger.EnterActions>
-                                <BeginStoryboard x:Name="Storyboard2_BeginStoryboard" Storyboard="{StaticResource Storyboard2}"/>
+                                <BeginStoryboard x:Name="Storyboard2_BeginStoryboard" Storyboard="{StaticResource Storyboard2}" />
                             </Trigger.EnterActions>
                             <Setter TargetName="bd" Property="Background" Value="#FF606060" />
                         </Trigger>
                         <MultiTrigger>
                             <MultiTrigger.EnterActions>
-                                <BeginStoryboard Storyboard="{StaticResource Storyboard1}"/>
+                                <BeginStoryboard Storyboard="{StaticResource Storyboard1}" />
                             </MultiTrigger.EnterActions>
                             <MultiTrigger.Conditions>
-                                <Condition Property="IsMouseOver" Value="True"/>
-                                <Condition Property="IsChecked" Value="False"/>
+                                <Condition Property="IsMouseOver" Value="True" />
+                                <Condition Property="IsChecked" Value="False" />
                             </MultiTrigger.Conditions>
                             <Setter TargetName="bd" Property="Background" Value="Red" />
                         </MultiTrigger>

+ 23 - 0
PDF Office/Styles/SeparatorStyle.xaml

@@ -0,0 +1,23 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
+
+    <Style
+        x:Key="VerticalSeparatorStyle"
+        BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"
+        TargetType="{x:Type Separator}">
+        <Setter Property="Background" Value="{StaticResource color.sys.layout.divider}" />
+        <Setter Property="Height" Value="16" />
+        <Setter Property="Width" Value="1" />
+        <Setter Property="HorizontalAlignment" Value="Stretch" />
+        <Setter Property="Margin" Value="12,0" />
+    </Style>
+
+    <Style
+        x:Key="HorizontalSeparatorStyle"
+        BasedOn="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}"
+        TargetType="{x:Type Separator}">
+        <Setter Property="Background" Value="{StaticResource color.sys.layout.divider}" />
+        <Setter Property="Height" Value="1" />
+        <Setter Property="HorizontalAlignment" Value="Stretch" />
+        <Setter Property="Margin" Value="8,4" />
+    </Style>
+</ResourceDictionary>

+ 12 - 6
PDF Office/Styles/TabControlStyle.xaml

@@ -110,14 +110,15 @@
         <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />
     </Style>
 
-    <Style x:Key="TabItem_WithUnderLineStyle" TargetType="{x:Type cus:IconAndTextTabItem}">
-        <Setter Property="Foreground" Value="Black" />
+    <!--  Design Token  -->
+    <Style x:Key="ToolbarTabs" TargetType="{x:Type cus:IconAndTextTabItem}">
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv2}" />
         <Setter Property="Background" Value="White" />
         <Setter Property="BorderBrush" Value="#FFACACAC" />
         <Setter Property="HorizontalContentAlignment" Value="Stretch" />
         <Setter Property="VerticalContentAlignment" Value="Stretch" />
         <Setter Property="AllowDrop" Value="True" />
-        <Setter Property="SelectedForeground" Value="Black" />
+        <Setter Property="SelectedForeground" Value="{StaticResource color.sys.text.neutral.lv1}" />
         <Setter Property="FontSize" Value="14" />
         <Setter Property="Height" Value="40" />
         <Setter Property="Template">
@@ -130,9 +131,13 @@
                         SnapsToDevicePixels="True">
                         <Border
                             x:Name="_underline"
+                            Height="3"
+                            Margin="9,0"
                             HorizontalAlignment="Stretch"
-                            BorderBrush="#FF477EDE"
-                            BorderThickness="0" />
+                            VerticalAlignment="Bottom"
+                            Background="{StaticResource color.sys.layout.accent}"
+                            CornerRadius="2"
+                            Visibility="Collapsed" />
                         <StackPanel Orientation="Horizontal">
                             <Path
                                 x:Name="NormalPathIcon"
@@ -216,7 +221,7 @@
                             </MultiDataTrigger.Conditions>
                             <Setter Property="Panel.ZIndex" Value="1" />
                             <Setter TargetName="txt" Property="Foreground" Value="{Binding SelectedForeground, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
-                            <Setter TargetName="_underline" Property="BorderThickness" Value="0,0,0,2" />
+                            <Setter TargetName="_underline" Property="Visibility" Value="Visible" />
                             <Setter TargetName="SelectedIcon" Property="Visibility" Value="Collapsed" />
                             <Setter TargetName="NormalPathIcon" Property="Visibility" Value="Visible" />
                         </MultiDataTrigger>
@@ -478,6 +483,7 @@
                         <Border
                             Grid.Row="0"
                             Grid.Column="0"
+                            HorizontalAlignment="Center"
                             Background="{StaticResource color.sys.layout.fg.dark}"
                             CornerRadius="4">
                             <TabPanel

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

@@ -0,0 +1,49 @@
+<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="SubToolbarTgb" TargetType="{x:Type ToggleButton}">
+        <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+        <Setter Property="Background" Value="Transparent" />
+        <Setter Property="BorderThickness" Value="0" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate TargetType="{x:Type ToggleButton}">
+                    <Border
+                        x:Name="border"
+                        Background="{TemplateBinding Panel.Background}"
+                        BorderBrush="{TemplateBinding Border.BorderBrush}"
+                        BorderThickness="{TemplateBinding Border.BorderThickness}"
+                        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="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+                        </Trigger>
+                        <Trigger Property="IsPressed" Value="True">
+                            <Setter TargetName="border" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+                        </Trigger>
+                        <Trigger Property="IsChecked" Value="True">
+                            <Setter TargetName="border" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
+                        </Trigger>
+                        <Trigger Property="IsEnabled" Value="False">
+                            <Setter TargetName="border" Property="Panel.Background" Value="Transparent" />
+                            <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
+                        </Trigger>
+                    </ControlTemplate.Triggers>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+</ResourceDictionary>

+ 13 - 4
PDF Office/Styles/WindowsStyle.xaml

@@ -55,10 +55,19 @@
                         Background="{TemplateBinding Background}"
                         BorderBrush="{TemplateBinding BorderBrush}"
                         BorderThickness="{TemplateBinding BorderThickness}"
-                        CornerRadius="8">
-                        <AdornerDecorator>
-                            <ContentPresenter x:Name="win_content" />
-                        </AdornerDecorator>
+                        CornerRadius="8"
+                        Effect="{StaticResource shadow.black-2-2}">
+                        <Grid>
+                            <!--  esc关闭窗体按钮  -->
+                            <Button
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Background="Transparent"
+                                IsCancel="True" />
+                            <AdornerDecorator>
+                                <ContentPresenter x:Name="win_content" />
+                            </AdornerDecorator>
+                        </Grid>
                     </Border>
                     <ControlTemplate.Triggers>
                         <Trigger Property="WindowState" Value="Maximized">

+ 17 - 13
PDF Office/Themes/Generic.xaml

@@ -12,26 +12,25 @@
                     <Border Background="White" CornerRadius="8">
                         <Grid Background="Transparent">
                             <Grid.RowDefinitions>
-                                <RowDefinition Height="48" />
+                                <RowDefinition Height="50" />
                                 <RowDefinition Height="*" />
                                 <RowDefinition Height="64" />
                             </Grid.RowDefinitions>
-                            <Border Background="Transparent" BorderThickness="0,0,0,1">
-                                <Border.BorderBrush>
-                                    <SolidColorBrush Opacity="0.2" Color="Gray" />
-                                </Border.BorderBrush>
+                            <Border Background="Transparent">
                                 <TextBlock
-                                    Margin="16,0,0,0"
+                                    Margin="16,0"
                                     VerticalAlignment="Center"
                                     FontSize="16"
                                     FontWeight="SemiBold"
                                     Text="{TemplateBinding Header}" />
                             </Border>
-                            <ContentPresenter Grid.Row="1" Content="{TemplateBinding Content}" />
-                            <Border Grid.Row="2" BorderThickness="0,1,0,0">
-                                <Border.BorderBrush>
-                                    <SolidColorBrush Opacity="0.2" Color="Gray" />
-                                </Border.BorderBrush>
+                            <ContentPresenter
+                                Grid.Row="1"
+                                Content="{TemplateBinding Content}"
+                                Focusable="False"
+                                RecognizesAccessKey="True"
+                                SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                            <Border Grid.Row="2">
                                 <ContentControl Content="{TemplateBinding BottmBar}" />
                             </Border>
                         </Grid>
@@ -48,13 +47,14 @@
         <Setter Property="VerticalContentAlignment" Value="Center" />
         <Setter Property="BorderThickness" Value="1" />
         <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+        <Setter Property="Height" Value="32" />
         <Setter Property="Template">
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type cus:TextBoxEx}">
                     <Border
                         x:Name="border"
                         Width="{TemplateBinding Width}"
-                        Height="32"
+                        Height="{TemplateBinding Height}"
                         Background="{TemplateBinding Background}"
                         BorderBrush="{TemplateBinding BorderBrush}"
                         BorderThickness="{TemplateBinding BorderThickness}"
@@ -73,7 +73,7 @@
 
                             <ScrollViewer
                                 x:Name="PART_ContentHost"
-                                Margin="8,0,25,0"
+                                Margin="4,5,25,5"
                                 Focusable="false"
                                 Foreground="{TemplateBinding Foreground}"
                                 HorizontalScrollBarVisibility="Hidden"
@@ -130,6 +130,10 @@
                             <Setter TargetName="placeholder" Property="Visibility" Value="Visible" />
                             <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
                         </Trigger>
+                        <Trigger Property="ShowClose" Value="False">
+                            <Setter TargetName="PART_BtnClear" Property="Visibility" Value="Collapsed" />
+                            <Setter TargetName="PART_ContentHost" Property="Margin" Value="4,5" />
+                        </Trigger>
                         <MultiTrigger>
                             <MultiTrigger.Conditions>
                                 <Condition Property="Text" Value="" />

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

@@ -423,7 +423,7 @@ namespace PDF_Office.ViewModels.BOTA
             if (AnnotationListItems.Count > 0)
             {
                 IsEmptyPanelVisibility = Visibility.Collapsed;
-                await Task.Delay(10);
+                await Task.Delay(2);
                 //展开数据
                 ExpandGroupHeader(AnnotationListItems, listBox);
             }

+ 1 - 0
PDF Office/ViewModels/BOTA/BOTAContentViewModel.cs

@@ -11,6 +11,7 @@ using Prism.Commands;
 using System.Windows.Controls;
 using DryIoc;
 using Prism.Services.Dialogs;
+using PDF_Office.Views.PageEdit;
 
 namespace PDF_Office.ViewModels.BOTA
 {

+ 3 - 3
PDF Office/ViewModels/BOTA/OutLineControlViewModel.cs

@@ -502,7 +502,7 @@ namespace PDF_Office.ViewModels.BOTA
         /// <summary>
         /// 获取对应大纲所需的缩略图数据
         /// </summary>
-        public WriteableBitmap LoadPreview(OutlineNode outlineNode)
+        public WriteableBitmap LoadPreview(OutlineNode outlineNode,int Width,int Height)
         {
             CPDFPage page = PDFViewer.Document.PageAtIndex(Convert.ToInt32(outlineNode.PageIndex) - 1);
             Size size = PDFViewer.Document.GetPageSize(Convert.ToInt32(outlineNode.PageIndex) - 1);
@@ -516,7 +516,7 @@ namespace PDF_Office.ViewModels.BOTA
             {
                 zoomXY.Y = 0;
             }
-            Size zoomSize = new Size((int)(size.Width * outlineNode.Zoom), (int)(size.Height * outlineNode.Zoom));
+            Size zoomSize = new Size((int)(Width * outlineNode.Zoom), (int)(Height * outlineNode.Zoom));
             bmpData = new byte[(int)(zoomSize.Width * zoomSize.Height * 4)];
             WirteBitmap = new WriteableBitmap((int)zoomSize.Width, (int)zoomSize.Height, 96, 96, PixelFormats.Bgra32, null);
 
@@ -524,7 +524,7 @@ namespace PDF_Office.ViewModels.BOTA
             {
                 return null;
             }
-            page.RenderPageBitmapWithMatrix((float)outlineNode.Zoom, new Rect(zoomXY.X, zoomXY.Y, zoomSize.Width, zoomSize.Height), 0xFFFFFFFF, bmpData, 1, true);
+            page.RenderPageBitmapWithMatrix((float)outlineNode.Zoom, new Rect(zoomXY.X, size.Height-zoomXY.Y, zoomSize.Width, zoomSize.Height), 0xFFFFFFFF, bmpData, 1, true);
             WirteBitmap.WritePixels(new Int32Rect(0, 0, (int)zoomSize.Width, (int)zoomSize.Height), bmpData, WirteBitmap.BackBufferStride, 0);
             WirteBitmap.Freeze();
             return WirteBitmap;

+ 15 - 10
PDF Office/ViewModels/BottomToolContentViewModel.cs

@@ -124,7 +124,7 @@ namespace PDF_Office.ViewModels
                 }
             }
         }
-
+        
         private int pageCount;
 
         public int PageCount
@@ -168,7 +168,7 @@ namespace PDF_Office.ViewModels
 
         public CPDFViewer PDFViewer { get; set; }
 
-        private ViewContentViewModel viewContentViewModel { get; set; }
+        public ViewContentViewModel ViewContentViewModel { get; set; }
 
         private IRegionManager region;
 
@@ -195,9 +195,9 @@ namespace PDF_Office.ViewModels
 
         private void ShowViewModularEvent(object obj)
         {
-            if (viewContentViewModel.IsPropertyOpen == false)
+            if (ViewContentViewModel.IsPropertyOpen == false)
             {
-                viewContentViewModel.IsPropertyOpen = true;
+                ViewContentViewModel.IsPropertyOpen = true;
 
                 NavigationParameters param = new NavigationParameters();
                 param.Add(ParameterNames.PDFViewer, PDFViewer);
@@ -206,9 +206,9 @@ namespace PDF_Office.ViewModels
             }
             else
             {
-                viewContentViewModel.IsPropertyOpen = false;
+                ViewContentViewModel.IsPropertyOpen = false;
             }
-            IsShowViewModular = viewContentViewModel.IsPropertyOpen;
+            IsShowViewModular = ViewContentViewModel.IsPropertyOpen;
         }
 
         /// <summary>
@@ -341,7 +341,8 @@ namespace PDF_Office.ViewModels
             if (PDFViewer != null)
             {
                 PDFViewer.GoToPage(PDFViewer.CurrentIndex + 1);
-                if (((int)PDFViewer.Mode % 2) == 0)
+                //双页模式 一次性跳两页
+                if (((int)PDFViewer.ModeView > 2))
                 {
                     PDFViewer.GoToPage(PDFViewer.CurrentIndex + 2);
                 }
@@ -461,8 +462,12 @@ namespace PDF_Office.ViewModels
         {
             if (e.Key == "PageNum")
             {
-                CurrentPage = (int)e.Value;
-                PageCount = PDFViewer.Document.PageCount;
+                RenderData renderData = e.Value as RenderData;
+                if (renderData != null)
+                {
+                    CurrentPage = renderData.PageIndex;
+                    PageCount = PDFViewer.Document.PageCount;
+                }
             }
             if (e.Key == "ViewMode")
             {
@@ -559,7 +564,7 @@ namespace PDF_Office.ViewModels
             var viewContentViewModel = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as ViewContentViewModel;
             if (viewContentViewModel != null)
             {
-                this.viewContentViewModel = viewContentViewModel;
+                this.ViewContentViewModel = viewContentViewModel;
                 IsShowViewModular = viewContentViewModel.IsPropertyOpen;
             }
 

+ 71 - 68
PDF Office/ViewModels/Dialog/BOTA/ScreenAnnotationDialogViewModel.cs

@@ -138,6 +138,20 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
             }
         }
 
+        /// <summary>
+        /// 链接
+        /// </summary>
+        private Visibility annotLinkVisible;
+
+        public Visibility AnnotLinkVisible
+        {
+            get { return annotLinkVisible; }
+            set
+            {
+                SetProperty(ref annotLinkVisible, value);
+            }
+        }
+
         /// <summary>
         /// 矩形
         /// </summary>
@@ -237,9 +251,12 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
         private CustomIconToggleBtn btnAnnotFreeText = null;
         private CustomIconToggleBtn btnAnnotStrikeout = null;
         private CustomIconToggleBtn btnUnderLine = null;
+        private CustomIconToggleBtn btnAnnotLink = null;
+
         private ListBox _ListColor = null;
         private ListBox _ListAuthor = null;
 
+        private List<CustomIconToggleBtn> iconToggleBtns = new List<CustomIconToggleBtn>();
         private List<string> colors = new List<string>();
         private List<string> authors = new List<string>();
         private List<AnnotArgsType> annotArgsTypes = new List<AnnotArgsType>();
@@ -273,6 +290,11 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
                     btnAnnotFreeText = arrys[8] as CustomIconToggleBtn;
                     btnAnnotStrikeout = arrys[9] as CustomIconToggleBtn;
                     btnUnderLine = arrys[10] as CustomIconToggleBtn;
+                    btnAnnotLink = arrys[11] as CustomIconToggleBtn;
+                    for (int i = 0; i < arrys.Length - 2; i++)
+                    {
+                        iconToggleBtns.Add(arrys[i] as CustomIconToggleBtn);
+                    }
                     SetBtnSelectedState(arrys);
                 }
             }
@@ -359,6 +381,7 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
                             break;
 
                         case AnnotArgsType.AnnotLink:
+                            SetBtnType(btnAnnotLink, false);
                             break;
 
                         case AnnotArgsType.AnnotSelectTool:
@@ -388,7 +411,7 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
                 }
             }
 
-            if (arrys[11] is System.Windows.Controls.ListBox listColor)
+            if (arrys[12] is System.Windows.Controls.ListBox listColor)
             {
                 this._ListColor = listColor;
 
@@ -408,7 +431,7 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
                     }
                 }
             }
-            if (arrys[12] is System.Windows.Controls.ListBox listAuthor)
+            if (arrys[13] is System.Windows.Controls.ListBox listAuthor)
             {
                 this._ListAuthor = listAuthor;
 
@@ -436,44 +459,22 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
         /// <param name="obj"></param>
         private void CleanEvent(Object obj)
         {
-            if (obj is Object[] arrys)
-            {
-                //CustomIconToggleBtn btnHighlight = arrys[0] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnFreeHand = arrys[1] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnAnnotSticky = arrys[2] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnAnnotStamp = arrys[3] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnSharpLine = arrys[4] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnSharpArrow = arrys[5] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnAnnotCircle = arrys[6] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnAnnotSquare = arrys[7] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnAnnotFreeText = arrys[8] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnAnnotStrikeout = arrys[9] as CustomIconToggleBtn;
-                //CustomIconToggleBtn btnUnderLine = arrys[10] as CustomIconToggleBtn;
-
-                SetBtnType(btnHighlight, true);
-                SetBtnType(btnFreeHand, true);
-                SetBtnType(btnAnnotSticky, true);
-                SetBtnType(btnAnnotStamp, true);
-                SetBtnType(btnSharpLine, true);
-                SetBtnType(btnSharpArrow, true);
-                SetBtnType(btnAnnotCircle, true);
-                SetBtnType(btnAnnotSquare, true);
-                SetBtnType(btnAnnotFreeText, true);
-                SetBtnType(btnAnnotStrikeout, true);
-                SetBtnType(btnUnderLine, true);
-
-                if (this._ListColor != null)
-                {
-                    this._ListColor.SelectedItems.Clear();
-                }
-                if (this._ListAuthor != null)
-                {
-                    this._ListAuthor.SelectedItems.Clear();
-                }
-                DialogParameters valuePairs = new DialogParameters();
-                valuePairs.Add(ParameterNames.AnnotationCleanState, true);
-                RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
-            }
+            //for (int i = 0; i < iconToggleBtns.Count; i++)
+            //{
+            //    SetBtnType(iconToggleBtns[i], true);
+            //}
+
+            //if (this._ListColor != null)
+            //{
+            //    this._ListColor.SelectedItems.Clear();
+            //}
+            //if (this._ListAuthor != null)
+            //{
+            //    this._ListAuthor.SelectedItems.Clear();
+            //}
+            DialogParameters valuePairs = new DialogParameters();
+            valuePairs.Add(ParameterNames.AnnotationCleanState, true);
+            RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
         }
 
         /// <summary>
@@ -497,43 +498,40 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
         /// <param name="obj"></param>
         private void OkEvent(Object obj)
         {
-            if (obj is Object[] arrys)
+            List<AnnotArgsType> styleDic = GetAnnotArgsType();
+            //ListBox listColor = arrys[11] as ListBox;
+            //ListBox listAuthor = arrys[12] as ListBox;
+            List<string> colors = new List<string>();
+            List<string> authors = new List<string>();
+            if (this._ListColor != null)
             {
-                List<AnnotArgsType> styleDic = GetAnnotArgsType(arrys);
-                //ListBox listColor = arrys[11] as ListBox;
-                //ListBox listAuthor = arrys[12] as ListBox;
-                List<string> colors = new List<string>();
-                List<string> authors = new List<string>();
-                if (this._ListColor != null)
+                if (this._ListColor.SelectedItems.Count > 0)
                 {
-                    if (this._ListColor.SelectedItems.Count > 0)
+                    foreach (var item in this._ListColor.SelectedItems)
                     {
-                        foreach (var item in this._ListColor.SelectedItems)
-                        {
-                            ColorItem color = item as ColorItem;
-                            colors.Add(color.Color.ToString());
-                        }
+                        ColorItem color = item as ColorItem;
+                        colors.Add(color.Color.ToString());
                     }
                 }
-                if (this._ListAuthor != null)
+            }
+            if (this._ListAuthor != null)
+            {
+                if (this._ListAuthor.SelectedItems.Count > 0)
                 {
-                    if (this._ListAuthor.SelectedItems.Count > 0)
+                    foreach (var item in this._ListAuthor.SelectedItems)
                     {
-                        foreach (var item in this._ListAuthor.SelectedItems)
-                        {
-                            AuthorItem author = item as AuthorItem;
-                            authors.Add(author.Name);
-                        }
+                        AuthorItem author = item as AuthorItem;
+                        authors.Add(author.Name);
                     }
                 }
-
-                DialogParameters valuePairs = new DialogParameters();
-                valuePairs.Add(ParameterNames.AnnotArgsTypes, styleDic);
-                valuePairs.Add(ParameterNames.AnnotationColors, colors);
-                valuePairs.Add(ParameterNames.AnnotationAuthor, authors);
-                valuePairs.Add(ParameterNames.AnnotationCleanState, false);
-                RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
             }
+
+            DialogParameters valuePairs = new DialogParameters();
+            valuePairs.Add(ParameterNames.AnnotArgsTypes, styleDic);
+            valuePairs.Add(ParameterNames.AnnotationColors, colors);
+            valuePairs.Add(ParameterNames.AnnotationAuthor, authors);
+            valuePairs.Add(ParameterNames.AnnotationCleanState, false);
+            RequestClose.Invoke(new DialogResult(ButtonResult.OK, valuePairs));
         }
 
         /// <summary>
@@ -541,7 +539,7 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
         /// </summary>
         /// <param name="arrys"></param>
         /// <returns></returns>
-        private List<AnnotArgsType> GetAnnotArgsType(object[] arrys)
+        private List<AnnotArgsType> GetAnnotArgsType()
         {
             List<AnnotArgsType> styleDic = new List<AnnotArgsType>();
             //CustomIconToggleBtn btnHighlight = arrys[0] as CustomIconToggleBtn;
@@ -566,6 +564,7 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
             GetBtnAnnotArgsTypeState(btnAnnotFreeText, styleDic, AnnotArgsType.AnnotFreeText);
             GetBtnAnnotArgsTypeState(btnAnnotStrikeout, styleDic, AnnotArgsType.AnnotStrikeout);
             GetBtnAnnotArgsTypeState(btnUnderLine, styleDic, AnnotArgsType.AnnotUnderline);
+            GetBtnAnnotArgsTypeState(btnAnnotLink, styleDic, AnnotArgsType.AnnotLink);
             return styleDic;
         }
 
@@ -747,6 +746,10 @@ namespace PDF_Office.ViewModels.Dialog.BOTA
                         }
                         AnnotCircleVisibility = Visibility.Visible;
                         break;
+
+                    case AnnotArgsType.AnnotLink:
+                        AnnotLinkVisible = Visibility.Visible;
+                        break;
                 }
             }
 

+ 24 - 9
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs

@@ -37,7 +37,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string PageRangeSelectIndex { set; get; } = "0";
 
-        public List<string> ImageTypeFamily { set; get; } =new List<string>();
+        public List<string> ImageTypeFamily { set; get; } = new List<string>();
 
         private int imageTypeSelectedIndex;
         /// <summary>
@@ -50,7 +50,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             set
             {
                 SetProperty(ref imageTypeSelectedIndex, value);
-                
+
                 UpdateImageType(ImageTypeSelectedIndex);
             }
         }
@@ -66,7 +66,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             set
             {
                 SetProperty(ref imageDPISelectedIndex, value);
-                
+
                 UpdateImageDPI(ImageDPISelectedIndex);
             }
         }
@@ -121,20 +121,34 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         /// <param name="index"></param>
         private void UpdateImageType(int index)
         {
+            this.ConverterImgModel.Type = ImgType.PNG;
             switch (index)
             {
                 //case结果是同样的情况下,case可堆叠在一起,表示处理方式一样
                 case 0:
-                case 1:
+                    this.ConverterImgModel.imageType = ".jpeg";
+                    break;
+                case 7:
+                    this.ConverterImgModel.imageType = ".jp2";
+                    break;
                 case 3:
+                    this.ConverterImgModel.imageType = ".gif";
+                    break;
                 case 4:
+                    this.ConverterImgModel.imageType = ".tiff";
+                    break;
                 case 5:
+                    this.ConverterImgModel.imageType = ".tga";
+                    break;
                 case 6:
-                case 7:
-                    this.ConverterImgModel.Type = ImgType.JPEG;
+                    this.ConverterImgModel.imageType = ".bmp";
                     break;
                 case 2:
-                    this.ConverterImgModel.Type = ImgType.PNG;
+                    this.ConverterImgModel.imageType = ".png";
+                    break;
+                case 1:
+                    this.ConverterImgModel.imageType = ".jpg";
+                    this.ConverterImgModel.Type = ImgType.JPEG;
                     break;
                 default:
                     break;
@@ -173,8 +187,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
         }
 
-        private  void converter()
+        private void converter()
         {
+
             FolderBrowserDialog dlg = new FolderBrowserDialog();
             if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
@@ -189,7 +204,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 MessageBoxEx.Show("输入不对");
                 return;
             }
-           
+
             DialogParameters value = new DialogParameters();
             value.Add(ParameterNames.ConverterType, "Img");
             value.Add(ParameterNames.ConverterTypeModel, ConverterImgModel);

+ 34 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs

@@ -9,8 +9,10 @@ using Prism.Mvvm;
 using Prism.Services.Dialogs;
 using System;
 using System.Collections.Generic;
+using System.Diagnostics;
 using System.Linq;
 using System.Net.Mime;
+using System.Windows.Media;
 using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
 
 namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
@@ -89,6 +91,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     if (ConverterCSVModel != null)
                     {
                         PageNumber = ConverterCSVModel.PageIndexLists.Count().ToString();
+                        for (int i = 0; ConverterCSVModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterCSVModel.PageIndexLists[i] = ConverterCSVModel.PageIndexLists[i] + 1;
+                        }
                         result = await ConverterHelper.CSVConvert(ConverterCSVModel.InputPath, ConverterCSVModel.OutputPath, GetProgress, ConverterCSVModel.PageIndexLists, ConverterCSVModel.Pawssword);
                        
                     }
@@ -99,6 +105,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     if (ConverterExcelModel != null)
                     {
                         PageNumber = ConverterExcelModel.PageIndexLists.Count().ToString();
+                        for (int i = 0; ConverterExcelModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterExcelModel.PageIndexLists[i] = ConverterExcelModel.PageIndexLists[i] + 1;
+                        }
                         result = await ConverterHelper.ExcelConvert(ConverterExcelModel.InputPath, ConverterExcelModel.OutputPath, GetProgress, ConverterExcelModel.PageIndexLists, ConverterExcelModel.Pawssword, ConverterExcelModel.excelOption);
                     }
                     break;
@@ -108,6 +118,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     if (ConverterHTMLModel != null)
                     {
                         PageNumber = ConverterHTMLModel.PageIndexLists.Count().ToString();
+                        for (int i = 0; ConverterHTMLModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterHTMLModel.PageIndexLists[i] = ConverterHTMLModel.PageIndexLists[i] + 1;
+                        }
                         result = await ConverterHelper.HTMLConvert(ConverterHTMLModel.InputPath, ConverterHTMLModel.OutputPath, GetProgress, ConverterHTMLModel.PageIndexLists, ConverterHTMLModel.Pawssword, ConverterHTMLModel.htmlOption);
                     }
                     break;
@@ -117,7 +131,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     if (ConverterImgModel != null)
                     {
                         PageNumber = ConverterImgModel.PageIndexLists.Count().ToString();
-                        result = await ConverterHelper.ImgConvert(ConverterImgModel.InputPath, ConverterImgModel.OutputPath, GetProgress, ConverterImgModel.PageIndexLists, ConverterImgModel.Pawssword, ConverterImgModel.Type);
+                        for (int i=0; ConverterImgModel.PageIndexLists.Count>i;i++) {
+                            ConverterImgModel.PageIndexLists[i] = ConverterImgModel.PageIndexLists[i] + 1;
+                        }
+                        result = await ConverterHelper.ImgConvert(ConverterImgModel.InputPath, ConverterImgModel.OutputPath, GetProgress, ConverterImgModel.PageIndexLists, ConverterImgModel.Pawssword, ConverterImgModel.Type,ConverterImgModel.imageType);
                     }
                     break;
                 case "PPT":
@@ -126,6 +143,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     if (ConverterPPTModel != null)
                     {
                         PageNumber = ConverterPPTModel.PageIndexLists.Count().ToString();
+                        for (int i = 0; ConverterPPTModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterPPTModel.PageIndexLists[i] = ConverterPPTModel.PageIndexLists[i] + 1;
+                        }
                         result = await ConverterHelper.PPTConvert(ConverterPPTModel.InputPath, ConverterPPTModel.OutputPath, GetProgress, ConverterPPTModel.PageIndexLists, ConverterPPTModel.Pawssword);
                     }
                     break;
@@ -135,6 +156,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     if (ConverterRTFModel != null)
                     {
                         PageNumber = ConverterRTFModel.PageIndexLists.Count().ToString();
+                        for (int i = 0; ConverterRTFModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterRTFModel.PageIndexLists[i] = ConverterRTFModel.PageIndexLists[i] + 1;
+                        }
                         result = await ConverterHelper.RTFConvert(ConverterRTFModel.InputPath, ConverterRTFModel.OutputPath, GetProgress, ConverterRTFModel.PageIndexLists, ConverterRTFModel.Pawssword);
                     }
                         break;
@@ -144,6 +169,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     if (ConverterTextModel != null)
                     {
                         PageNumber = ConverterTextModel.PageIndexLists.Count().ToString();
+                        for (int i = 0; ConverterTextModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterTextModel.PageIndexLists[i] = ConverterTextModel.PageIndexLists[i] + 1;
+                        }
                         result = await ConverterHelper.TxtConvert(ConverterTextModel.InputPath, ConverterTextModel.OutputPath, GetProgress, ConverterTextModel.PageIndexLists, ConverterTextModel.Pawssword);
                     }
                     break;
@@ -152,6 +181,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     parameters.TryGetValue<ConverterWordDialogModel>(ParameterNames.ConverterTypeModel, out ConverterWordModel);
                     if (ConverterWordModel != null) {
                         PageNumber = ConverterWordModel.PageIndexLists.Count().ToString();
+                        for (int i = 0; ConverterWordModel.PageIndexLists.Count > i; i++)
+                        {
+                            ConverterWordModel.PageIndexLists[i] = ConverterWordModel.PageIndexLists[i] + 1;
+                        }
                         result = await ConverterHelper.WordConvert(ConverterWordModel.InputPath, ConverterWordModel.OutputPath, GetProgress, ConverterWordModel.PageIndexLists, ConverterWordModel.Pawssword);
                     }
                     break;

PDF Office/ViewModels/PropertyPanel/AnnotPanel/CustomCreateDialogViewModel.cs → PDF Office/ViewModels/Dialog/CustomCreateDialogViewModel.cs


+ 0 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/DynamicPropertyDialogViewModel.cs


Неке датотеке нису приказане због велике количине промена