Browse Source

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

liuaoran 2 years ago
parent
commit
d45a33c6ab
48 changed files with 1624 additions and 741 deletions
  1. 1 0
      PDF Office/App.xaml.cs
  2. 22 1
      PDF Office/CustomControl/CompositeControl/ColorContent.xaml.cs
  3. 39 19
      PDF Office/CustomControl/PageTurningPreview.xaml
  4. 9 4
      PDF Office/Helper/PopControlHelper.cs
  5. 126 23
      PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs
  6. 9 1
      PDF Office/PDF Office.csproj
  7. 12 1
      PDF Office/Properties/Settings.Designer.cs
  8. 3 0
      PDF Office/Properties/Settings.settings
  9. 3 2
      PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs
  10. 9 9
      PDF Office/ViewModels/Dialog/CustomCreateDialogViewModel.cs
  11. 13 1
      PDF Office/ViewModels/Dialog/ToolsDialogs/CompressDialogs/CompressProgressBarDialogViewModel.cs
  12. 19 19
      PDF Office/ViewModels/Form/FormsToolContentViewModel.cs
  13. 2 1
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs
  14. 203 199
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs
  15. 41 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/MultiSelectAnnotPropertyViewModel.cs
  16. 53 39
      PDF Office/ViewModels/PropertyPanel/FontSetModeVM.cs
  17. 12 12
      PDF Office/ViewModels/PropertyPanel/PDFEdit/ImageEditPropertyViewModel.cs
  18. 1 1
      PDF Office/ViewModels/PropertyPanel/PDFEdit/PDFEditVM.cs
  19. 71 35
      PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs
  20. 24 16
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  21. 211 74
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  22. 23 0
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  23. 4 4
      PDF Office/ViewModels/Tools/TextEditToolContentViewModel.cs
  24. 202 76
      PDF Office/Views/BOTA/OutLineControl.xaml
  25. 25 4
      PDF Office/Views/BOTA/OutLineControl.xaml.cs
  26. 11 9
      PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml
  27. 6 6
      PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml
  28. 7 7
      PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml
  29. 8 7
      PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml
  30. 7 7
      PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml
  31. 40 10
      PDF Office/Views/Dialog/ConverterDialogs/ConverterProgressBarDialog.xaml
  32. 7 7
      PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml
  33. 7 7
      PDF Office/Views/Dialog/ConverterDialogs/ConverterTextDialog.xaml
  34. 7 7
      PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml
  35. 7 16
      PDF Office/Views/Dialog/DynamicPropertyDialog.xaml
  36. 15 21
      PDF Office/Views/Dialog/ToolsDialogs/CompressDialogs/CompressDialog.xaml
  37. 45 14
      PDF Office/Views/Dialog/ToolsDialogs/CompressDialogs/CompressProgressBarDialog.xaml
  38. 3 1
      PDF Office/Views/Dialog/ToolsDialogs/CompressDialogs/CompressProgressBarDialog.xaml.cs
  39. 31 1
      PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml.cs
  40. 23 34
      PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml
  41. 35 7
      PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml.cs
  42. 15 0
      PDF Office/Views/PropertyPanel/AnnotPanel/MultiSelectAnnotProperty.xaml
  43. 28 0
      PDF Office/Views/PropertyPanel/AnnotPanel/MultiSelectAnnotProperty.xaml.cs
  44. 149 31
      PDF Office/Views/PropertyPanel/AnnotPanel/StampAnnotProperty.xaml
  45. 1 1
      PDF Office/Views/PropertyPanel/AnnotPanel/StampAnnotProperty.xaml.cs
  46. 7 7
      PDF Office/Views/PropertyPanel/PDFEdit/TextEditProperty.xaml
  47. 1 0
      PDFSettings/PDFSettings.csproj
  48. 27 0
      PDFSettings/PresetFontList.cs

+ 1 - 0
PDF Office/App.xaml.cs

@@ -232,6 +232,7 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<WatermarkCreateFileContent>();
             containerRegistry.RegisterForNavigation<WatermarkDocumentContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModMultipleContent>();
+            containerRegistry.RegisterForNavigation<MultiSelectAnnotProperty>();
             containerRegistry.RegisterForNavigation<FreehandAnnotProperty>();
             containerRegistry.RegisterForNavigation<FreetextAnnotProperty>();
             containerRegistry.RegisterForNavigation<StickyNoteProperty>();

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

@@ -85,7 +85,7 @@ namespace PDF_Office.CustomControl.CompositeControl
         }
 
         public static readonly DependencyProperty SelectedColorProperty =
-            DependencyProperty.Register("SelectedColor", typeof(Color), typeof(ColorContent), new PropertyMetadata((Color)ColorConverter.ConvertFromString("#6C33F8CC")));
+            DependencyProperty.Register("SelectedColor", typeof(Color), typeof(ColorContent), new PropertyMetadata((Color)ColorConverter.ConvertFromString("#6C33F8CC"), SelectedColorPropertyChanged));
 
 
         public Visibility ShowColorList
@@ -98,6 +98,27 @@ namespace PDF_Office.CustomControl.CompositeControl
         public static readonly DependencyProperty ShowColorListProperty =
             DependencyProperty.Register("ShowColorList", typeof(Visibility), typeof(ColorContent), new PropertyMetadata(Visibility.Visible));
 
+        private static void SelectedColorPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as ColorContent;
+            var co = (Color)e.NewValue;
+            if(control != null)
+            {
+                foreach(var item in control.colors)
+                {
+                    var colorItem = (item.Color as SolidColorBrush).Color;
+                    if(colorItem.A == co.A && colorItem.G == co.G && colorItem.B == co.B && colorItem.R == co.R)
+                    {
+                        control.ListColor.SelectedItem = item;
+                        break;
+                    }
+                    else
+                    {
+                        control.ListColor.SelectedItem = null;
+                    }
+                }
+            }
+        }
 
         public ColorContent()
         {

+ 39 - 19
PDF Office/CustomControl/PageTurningPreview.xaml

@@ -5,25 +5,45 @@
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:PDF_Office.CustomControl"
              mc:Ignorable="d" 
-             Height="280" Width="200">
-    <Grid Width="200" Height="280">
-        <StackPanel Orientation="Vertical" Height="280">
-        <Border  Margin="0,16,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Background="LightGray"  Height="218" Width="176">
-            <Viewbox>
-                    <Image Name="Image" Height="218" Width="176"></Image>
-            </Viewbox>
-        </Border>
-        <StackPanel Orientation="Horizontal"  Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,16,0,0">
-            <Button Name="PrePage" Width="24" Click="PrePage_Click" Height="24" HorizontalAlignment="Left" FontSize="16" Background="WhiteSmoke" HorizontalContentAlignment="Center" VerticalContentAlignment="Center">
-                <TextBlock Text="&lt;" VerticalAlignment="Center" ></TextBlock>
-            </Button>
-            <TextBox x:Name="CurrentPage" Width="48" Height="24" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="11,0,2,0" Text="1" InputMethod.IsInputMethodEnabled="False"   PreviewTextInput="CountTextBox_PreviewTextInput" KeyDown="CurrentPage_KeyDown" LostFocus="CurrentPage_LostFocus"></TextBox>
-            <TextBlock  Text="of" Margin="0,0,2,0"  HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
-                <TextBlock  x:Name="PageIndex" VerticalAlignment="Center" Block.TextAlignment="Center"  Width="23"/>
-                <Button Name="NextPage" Click="NextPage_Click" Width="24" Height="24" HorizontalAlignment="Left" FontSize="16"  Background="WhiteSmoke"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Margin="17,0,0,0">
-                <TextBlock Text=">" VerticalAlignment="Center"></TextBlock>
-            </Button>
-        </StackPanel>
+             Height="320" Width="212">
+    <Grid Width="212" Height="320">
+        <StackPanel Orientation="Vertical" Height="320">
+            <Border  Margin="0,16,0,0" HorizontalAlignment="Center" VerticalAlignment="Top" Background="LightGray"  Height="248" Width="180">
+                <Viewbox>
+                    <Image Name="Image" Height="248" Width="180"></Image>
+                </Viewbox>
+            </Border>
+            <StackPanel Orientation="Horizontal"  Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,16,0,0" Width="155">
+                <Button Name="PrePage" Width="24" Click="PrePage_Click" Height="24" HorizontalAlignment="Left" FontSize="16" BorderBrush="{StaticResource color.field.border.norm}"  Background="{StaticResource color.field.bg.def}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" >
+                    <Path  Data="M8.11144 11.2499L10.4311 8.93029L9.37043 7.86963L5.77045 11.4696C5.47756 11.7625 5.47756 12.2374 5.77045 12.5303L9.37043 16.1302L10.4311 15.0696L8.11144 12.7499H19.5008V11.2499H8.11144Z" Fill="#616469"  Width="13.95" Height="8.28" Stretch="Fill" />
+                    <Button.Template>
+                        <ControlTemplate TargetType="{x:Type Button}">
+                            <Border BorderThickness="1" CornerRadius="4" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
+                                <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                            </Border>
+                        </ControlTemplate>
+                    </Button.Template>
+                </Button>
+                <TextBox x:Name="CurrentPage" Width="54" Height="24" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Margin="8,0,8,0" Text="1"  InputMethod.IsInputMethodEnabled="False"   PreviewTextInput="CountTextBox_PreviewTextInput" Padding="8,0,8,0" KeyDown="CurrentPage_KeyDown" Background="{StaticResource color.field.bg.def}"  BorderBrush="{StaticResource color.field.border.norm}" LostFocus="CurrentPage_LostFocus">
+                    <TextBox.Resources>
+                        <Style TargetType="{x:Type Border}">
+                            <Setter Property="CornerRadius" Value="4"/>
+                        </Style>
+                    </TextBox.Resources>
+                </TextBox>
+                <TextBlock  Text="/" Margin="0,0,2,0" Width="5"  HorizontalAlignment="Left" VerticalAlignment="Center"></TextBlock>
+                <TextBlock  x:Name="PageIndex" VerticalAlignment="Center" Block.TextAlignment="Center"  Width="30" />
+                <Button x:Name="NextPage"  Click="NextPage_Click" Width="24" Height="24" FontSize="16"  Background="{StaticResource color.field.bg.def}"  HorizontalContentAlignment="Center" VerticalContentAlignment="Center"   BorderBrush="{StaticResource color.field.border.norm}">
+                    <Path  Data="M11.8893 4.24992L0.5 4.24992V5.74992L11.8893 5.74992L9.56967 8.06958L10.6303 9.13024L14.2303 5.53026C14.5232 5.23737 14.5232 4.7625 14.2303 4.4696L10.6303 0.869629L9.56967 1.93029L11.8893 4.24992Z" Fill="#616469" Width="13.95" Height="8.28" Stretch="Fill"/>
+                    <Button.Template>
+                        <ControlTemplate TargetType="{x:Type Button}">
+                            <Border BorderThickness="1" CornerRadius="4" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}">
+                                <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Center"/>
+                            </Border>
+                        </ControlTemplate>
+                    </Button.Template>
+                </Button>
+            </StackPanel>
         </StackPanel>
     </Grid>
 </UserControl>

+ 9 - 4
PDF Office/Helper/PopControlHelper.cs

@@ -223,10 +223,11 @@ namespace PDF_Office.Helper
     {
         public ContextMenu PopMenu { get; private set; }
         public List<MenuItem> MenuItems { get; private set; }
-
-        public CustomPopMenu(ContextMenu popMenu)
+        private object CommandTarget { get; set; }
+        public CustomPopMenu(ContextMenu popMenu,object commandTarget)
         {
             PopMenu = popMenu;
+            CommandTarget = commandTarget;
             GetMenuItems();
         }
 
@@ -310,13 +311,17 @@ namespace PDF_Office.Helper
             }
         }
 
-        public void SetMenuBinding(int index, object commandTarget, ICommand command)
+        public void SetMenuBinding(int index, ICommand command,object commandTarget = null)
         {
             var menuItem = ContainterOfIndex(index);
 
             if (menuItem != null)
             {
-                menuItem.CommandTarget = (UIElement)commandTarget;
+                if (commandTarget != null)
+                    menuItem.CommandTarget = (UIElement)commandTarget;
+                else
+                    menuItem.CommandTarget = (UIElement)CommandTarget;
+
                 menuItem.Command = command;
             }
 

+ 126 - 23
PDF Office/Model/PropertyPanel/AnnotPanel/FontStyleItem.cs

@@ -1,4 +1,6 @@
 using PDF_Office.CustomControl.CompositeControl;
+using PDF_Office.Properties;
+using PDFSettings;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -9,29 +11,130 @@ using System.Windows.Media;
 
 namespace PDF_Office.Model.PropertyPanel.AnnotPanel
 {
-    #region 自定义文字样式选项
 
-    public class FontStyleItem
+    public class TextFont
     {
-        public string mTag { get; set; }
-
-        public string mTagContent { get; set; }
-        public int mFontSize { get; set; }
-        public FontFamily mFontFamily { get; set; }
-        public FontStyle mFontStyle { get; set; }
-        public FontWeight mFontWeight { get; set; }
+        //获取本地缓存数据
+        public static List<PresetFontItem> GetCachePresetFontList()
+        {
+            List<PresetFontItem> cacheTempList = new List<PresetFontItem>();
+
+            if (Settings.Default.PresetFontList == null)
+                Settings.Default.PresetFontList = new PresetFontList();
+
+            if (Settings.Default.PresetFontList.Count == 0)
+            {
+                cacheTempList = GetPresetFontStyle();
+                foreach(var cacheItem in cacheTempList)
+                {
+                    var newItem = new PresetFontItem();
+                    newItem.mTag = cacheItem.mTag;
+                    newItem.mTagContent = cacheItem.mTagContent;
+                    newItem.mFontStyle = cacheItem.mFontStyle;
+                    newItem.mFontWeight = cacheItem.mFontWeight;
+                    newItem.mFontSize = cacheItem.mFontSize;
+                    Settings.Default.PresetFontList.Add(newItem);
+                }
+
+                Settings.Default.Save();
+            }
+            else
+            {
+                foreach (var item in Settings.Default.PresetFontList)
+                {
+                    var newItem = new PresetFontItem();
+                    newItem.mTag = item.mTag;
+                    newItem.mTagContent = item.mTagContent;
+                    newItem.mFontStyle = item.mFontStyle;
+                    newItem.mFontWeight = item.mFontWeight;
+                    newItem.mFontSize = item.mFontSize;
+                    cacheTempList.Add(newItem);
+                }
+            }
+
+            return cacheTempList;
+        }
 
-    }
+        //保存到本地缓存数据
+        public static void SavePresetFontList(List<PresetFontItem> list)
+        {
+            if (list == null) return;
+
+           if(Settings.Default.PresetFontList == null)
+                Settings.Default.PresetFontList = new PresetFontList();
+
+            bool isCanSave = false;
+            List<PresetFontItem> TempLists = new List<PresetFontItem>();
+
+           foreach (var item in list)
+            {
+                var cacheItem = Settings.Default.PresetFontList.FirstOrDefault(temp => temp.mTag == item.mTag);
+                if (cacheItem != null)
+                {
+                    if(cacheItem.mFontFamily != item.mFontFamily ||
+                       cacheItem.mFontSize != item.mFontSize ||
+                       cacheItem.mFontStyle != item.mFontStyle ||
+                       cacheItem.mFontWeight != item.mFontWeight
+                        )
+                    {
+                        isCanSave = true;
+                        
+                    }
+                    break;
+                }
+                else
+                {
+                    TempLists.Add(item);
+                }
+            }
+
+            foreach(var itemTemp in TempLists)
+            {
+                Settings.Default.PresetFontList.Add(itemTemp);
+            }
+
+            if (isCanSave)
+                Settings.Default.Save();
+        }
 
-    #endregion
+        public static void BackDefaultPresetFontStyle(string tag)
+        {
+            bool isCanSave = false;
+           var list = GetPresetFontStyle();
+            var itemDefault = list.FirstOrDefault(temp => temp.mTag == tag);
+            if (Settings.Default.PresetFontList == null)
+                Settings.Default.PresetFontList = new PresetFontList();
+            if(Settings.Default.PresetFontList.Count == 0)
+            {
+                Settings.Default.PresetFontList.Add(itemDefault);
+                isCanSave = true;
+            }
+            else
+            {
+                foreach (var item in Settings.Default.PresetFontList)
+                {
+                    if (item.mTag == itemDefault.mTag)
+                    {
+                        item.mFontFamily = itemDefault.mFontFamily;
+                        item.mFontWeight = itemDefault.mFontWeight;
+                        item.mFontStyle = itemDefault.mFontStyle;
+                        item.mFontSize = itemDefault.mFontSize;
+                        isCanSave = true;
+                        break;
+                    }
+                }
+            }
+
+            if (isCanSave == true)
+                Settings.Default.Save();
 
+        }
 
-    public class TextFont
-    {
-        public static List<FontStyleItem> GetPresetFontStyle()
+        //获取拟定的预设样式
+        private static List<PresetFontItem> GetPresetFontStyle()
         {
-            List<FontStyleItem> fontStyleList = new List<FontStyleItem>();
-            FontStyleItem custom = new FontStyleItem();
+            List<PresetFontItem> fontStyleList = new List<PresetFontItem>();
+            PresetFontItem custom = new PresetFontItem();
             custom.mTag = "custom";
             custom.mTagContent = "自定义";
 
@@ -40,7 +143,7 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
             custom.mFontStyle = FontStyles.Normal;
             custom.mFontWeight = FontWeights.Normal;
 
-            FontStyleItem h1 = new FontStyleItem();
+            PresetFontItem h1 = new PresetFontItem();
             h1.mTag = "H1";
             h1.mTagContent = "H1大标题";
 
@@ -49,17 +152,17 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
             h1.mFontStyle = FontStyles.Normal;
             h1.mFontWeight = FontWeights.Normal;
 
-            FontStyleItem h2 = new FontStyleItem();
+            PresetFontItem h2 = new PresetFontItem();
             h2.mTag = "H2";
             h2.mTagContent = "h2(标准)";
 
-            h2.mFontSize = 1248;
+            h2.mFontSize = 24;
             h2.mFontFamily = new FontFamily("Helvatica");
             h2.mFontStyle = FontStyles.Normal;
             h2.mFontWeight = FontWeights.Bold;
 
 
-            FontStyleItem h3 = new FontStyleItem();
+            PresetFontItem h3 = new PresetFontItem();
             h3.mTag = "H3";
             h3.mTagContent = "H3小标题";
 
@@ -68,7 +171,7 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
             h3.mFontStyle = FontStyles.Normal;
             h3.mFontWeight = FontWeights.Bold;
 
-            FontStyleItem b1 = new FontStyleItem();
+            PresetFontItem b1 = new PresetFontItem();
             b1.mTag = "B1";
             b1.mTagContent = "B1标题";
 
@@ -78,7 +181,7 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
             b1.mFontWeight = FontWeights.Normal;
 
 
-            FontStyleItem b2 = new FontStyleItem();
+            PresetFontItem b2 = new PresetFontItem();
             b2.mTag = "B2";
             b2.mTagContent = "B2标题";
 
@@ -87,7 +190,7 @@ namespace PDF_Office.Model.PropertyPanel.AnnotPanel
             b2.mFontStyle = FontStyles.Normal;
             b2.mFontWeight = FontWeights.Normal;
 
-            FontStyleItem b3 = new FontStyleItem();
+            PresetFontItem b3 = new PresetFontItem();
             b3.mTag = "B3";
             b3.mTagContent = "B3标题";
 

+ 9 - 1
PDF Office/PDF Office.csproj

@@ -492,11 +492,12 @@
     <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\MultiSelectAnnotPropertyViewModel.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\AnnotPanel\StickyNotePropertyViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\FontSetModeVM.cs" />
+    <Compile Include="ViewModels\PropertyPanel\FontBoardVM.cs" />
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\ImageEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\ImageTextEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\PDFEditVM.cs" />
@@ -995,6 +996,9 @@
     <Compile Include="Views\PropertyPanel\AnnotPanel\LinkAnnotProperty.xaml.cs">
       <DependentUpon>LinkAnnotProperty.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\PropertyPanel\AnnotPanel\MultiSelectAnnotProperty.xaml.cs">
+      <DependentUpon>MultiSelectAnnotProperty.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\SharpsAnnotProperty.xaml.cs">
       <DependentUpon>SharpsAnnotProperty.xaml</DependentUpon>
     </Compile>
@@ -1718,6 +1722,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\PropertyPanel\AnnotPanel\MultiSelectAnnotProperty.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\SharpsAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 12 - 1
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", "17.1.0.0")]
     internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
         
         private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
@@ -202,5 +202,16 @@ namespace PDF_Office.Properties {
                 this["RedactionsSettings"] = value;
             }
         }
+        
+        [global::System.Configuration.UserScopedSettingAttribute()]
+        [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+        public global::PDFSettings.PresetFontList PresetFontList {
+            get {
+                return ((global::PDFSettings.PresetFontList)(this["PresetFontList"]));
+            }
+            set {
+                this["PresetFontList"] = value;
+            }
+        }
     }
 }

+ 3 - 0
PDF Office/Properties/Settings.settings

@@ -50,5 +50,8 @@
     <Setting Name="RedactionsSettings" Type="PDFSettings.RedactionSettings" Scope="User">
       <Value Profile="(Default)" />
     </Setting>
+    <Setting Name="PresetFontList" Type="PDFSettings.PresetFontList" Scope="User">
+      <Value Profile="(Default)" />
+    </Setting>
   </Settings>
 </SettingsFile>

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

@@ -792,8 +792,9 @@ namespace PDF_Office.ViewModels.BOTA
         public async void UpdateAddedAnnot(int pageIndex, int annotIndex)
         {
             var annots = PdfViewer.GetAnnotCommentList(pageIndex, PdfViewer.Document);
-            foreach (var item in annots)
+            for (int i = 0; i < annots.Count; i++)
             {
+                AnnotHandlerEventArgs item = annots[i];
                 if (item.AnnotIndex == annotIndex && item.EventType != AnnotArgsType.AnnotRedaction)
                 {
                     AnnotationHandlerEventArgs args = GetAddAnnotEventArgs(item);
@@ -1111,7 +1112,7 @@ namespace PDF_Office.ViewModels.BOTA
                     int drawWidth = (int)paintRect.Width;
                     int drawHeight = (int)paintRect.Height;
                     byte[] bitmapArray = new byte[drawWidth * drawHeight * 4];
-
+                    annot.UpdateAp();
                     annot.RenderAnnot(drawWidth, drawHeight, bitmapArray);
                     WriteableBitmap wirteBitmap = new WriteableBitmap(drawWidth, drawHeight, 96, 96, PixelFormats.Bgra32, null);
                     wirteBitmap.WritePixels(new Int32Rect(0, 0, drawWidth, drawHeight), bitmapArray, wirteBitmap.BackBufferStride, 0);

+ 9 - 9
PDF Office/ViewModels/Dialog/CustomCreateDialogViewModel.cs

@@ -177,39 +177,39 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_RECT;
                     break;
                 case 3:
-                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_GREEN;
+                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_BLUE;
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_RECT;
                     break;
                 case 4:
-                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_RED;
+                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_GREEN;
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_RECT;
                     break;
                 case 5:
-                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_BLUE;
+                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_RED;
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_RECT;
                     break;
                 case 6:
-                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_GREEN;
+                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_BLUE;
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_LEFT_TRIANGLE;
                     break;
                 case 7:
-                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_RED;
+                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_GREEN;
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_LEFT_TRIANGLE;
                     break;
                 case 8:
-                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_BLUE;
+                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_RED;
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_LEFT_TRIANGLE;
                     break;
                 case 9:
-                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_GREEN;
+                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_BLUE;
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_RIGHT_TRIANGLE;
                     break;
                 case 10:
-                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_RED;
+                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_GREEN;
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_RIGHT_TRIANGLE;
                     break;
                 case 11:
-                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_GREEN;
+                    Color = C_TEXTSTAMP_COLOR.TEXTSTAMP_RED;
                     Shape = C_TEXTSTAMP_SHAPE.TEXTSTAMP_RIGHT_TRIANGLE;
                     break;
                 default:

+ 13 - 1
PDF Office/ViewModels/Dialog/ToolsDialogs/CompressDialogs/CompressProgressBarDialogViewModel.cs

@@ -10,6 +10,8 @@ using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
 using PDF_Office.Helper;
+using Prism.Commands;
+using static System.Windows.Forms.VisualStyles.VisualStyleElement.ToolTip;
 
 namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs
 {
@@ -20,7 +22,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs
         private CPDFDocument.GetPageIndexDelegate indexDelegate = null;
         private CPDFDocument tempDocument;
         private string _pageIndex = "0";
-
+        
         /// <value>
         /// 当前页
         /// </value>
@@ -47,6 +49,16 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs
         }
         #endregion
 
+        public DelegateCommand CloseCompressCommand { get; set; }
+
+        public CompresProgressBarDialogViewModel() {
+
+            CloseCompressCommand = new DelegateCommand(Close);
+        }
+
+        public void Close() {
+            RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
+        }
         #region 逻辑函数
         private int GetIndex(int pageindex)
         {

+ 19 - 19
PDF Office/ViewModels/Form/FormsToolContentViewModel.cs

@@ -484,55 +484,55 @@ namespace PDF_Office.ViewModels.Form
             }
         }
 
-        private void InitMenu(CustomPopMenu customMenu,object sender)
+        private void InitMenu(CustomPopMenu customMenu)
         {
             int index= 0;
             //属性
-            customMenu.SetMenuBinding(index, sender, PropertyMenuCommand);
+            customMenu.SetMenuBinding(index, PropertyMenuCommand);
             customMenu.SetTagProperty(index, "Property");
             index++;
             //复制
-            customMenu.SetMenuBinding(index, sender, ApplicationCommands.Copy);
+            customMenu.SetMenuBinding(index, ApplicationCommands.Copy);
             customMenu.SetTagProperty(index, "Copy");
             index++;
             //剪切
-            customMenu.SetMenuBinding(index, sender, ApplicationCommands.Cut);
+            customMenu.SetMenuBinding(index, ApplicationCommands.Cut);
             customMenu.SetTagProperty(index, "Cut");
             index++;
             //粘贴
-            customMenu.SetMenuBinding(index, sender, ApplicationCommands.Paste);
+            customMenu.SetMenuBinding(index, ApplicationCommands.Paste);
             customMenu.SetTagProperty(index, "Paste");
             index++;
             //删除
-            customMenu.SetMenuBinding(index, sender, ApplicationCommands.Delete);
+            customMenu.SetMenuBinding(index, ApplicationCommands.Delete);
             customMenu.SetTagProperty(index, "Delete");
             index++;
             //创建多个副本
-            customMenu.SetMenuBinding(index, sender, ApplicationCommands.Delete);
+            customMenu.SetMenuBinding(index, ApplicationCommands.Delete);
             customMenu.SetTagProperty(index, "CreateCopy");
             index++;
             //跨页复制
-            customMenu.SetMenuBinding(index, sender, CrossPageMenuCommand);
+            customMenu.SetMenuBinding(index, CrossPageMenuCommand);
             customMenu.SetTagProperty(index, "CrossPage");
             index++;
             //显示跳位编号
-            customMenu.SetMenuBinding(index, sender, JumpPosMenuCommand);
+            customMenu.SetMenuBinding(index, JumpPosMenuCommand);
             customMenu.SetTagProperty(index, "JumpPos");
             index++;
             //隐藏名称
-            customMenu.SetMenuBinding(index, sender, HideNameMenuCommand);
+            customMenu.SetMenuBinding(index, HideNameMenuCommand);
             customMenu.SetTagProperty(index, "HideName");
             index++;
             //查找
-            customMenu.SetMenuBinding(index, sender, SearchFormMenuCommand);
+            customMenu.SetMenuBinding(index, SearchFormMenuCommand);
             customMenu.SetTagProperty(index, "SearchForm");
             index++;
             //打印
-            customMenu.SetMenuBinding(index, sender, PrintMenuCommand);
+            customMenu.SetMenuBinding(index, PrintMenuCommand);
             customMenu.SetTagProperty(index, "print");
             index++;
             //设置当前属性为默认值
-            customMenu.SetMenuBinding(index, sender, DefaultValueMenuCommand);
+            customMenu.SetMenuBinding(index, DefaultValueMenuCommand);
             customMenu.SetTagProperty(index, "DefaultValue");
             index++;
             customMenu.AllMenuVisibility(true);
@@ -543,8 +543,8 @@ namespace PDF_Office.ViewModels.Form
         private ContextMenu BlankReaMenu(object sender)
         {
             var popMenu = App.Current.FindResource("FormContentMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu);
-            InitMenu(customMenu, sender);
+            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
+            InitMenu(customMenu);
             customMenu.SetVisibilityProperty("Property", false);
             customMenu.SetVisibilityProperty("Copy", false);
             customMenu.SetVisibilityProperty("Cut", false);
@@ -559,8 +559,8 @@ namespace PDF_Office.ViewModels.Form
         private ContextMenu SelectedFormMenu(object sender)
         {
             var popMenu = App.Current.FindResource("FormContentMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu);
-            InitMenu(customMenu, sender);
+            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
+            InitMenu(customMenu);
             customMenu.SetVisibilityProperty("SearchForm", false);
             customMenu.SetVisibilityProperty("print", false);
             return popMenu;
@@ -570,8 +570,8 @@ namespace PDF_Office.ViewModels.Form
         private ContextMenu MultiSelectedFormMenu(object sender)
         {
             var popMenu = App.Current.FindResource("FormContentMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu);
-            InitMenu(customMenu, sender);
+            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
+            InitMenu(customMenu);
             customMenu.SetVisibilityProperty("CreateCopy", false);
             customMenu.SetVisibilityProperty("DefaultValue", false);
             customMenu.SetVisibilityProperty("SearchForm", false);

+ 2 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -107,7 +107,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public DelegateCommand<object> LineModeCheckedCommand { get; set; }
         public DelegateCommand<object> SelectedOpacityValueCommand { get; set; }
 
-        
+        public event EventHandler<object> LoadPropertyHandler;
 
 
         public FreehandAnnotPropertyViewModel()
@@ -261,6 +261,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 Annot = PropertyPanel.annot;
                 GetAnnotProperty();
+                LoadPropertyHandler?.Invoke(null, (Annot as FreehandAnnotArgs).InkColor);
             }
         }
 

+ 203 - 199
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -4,6 +4,7 @@ using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
+using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
@@ -18,8 +19,15 @@ using System.Windows.Media;
 
 namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 {
-    public class FreetextAnnotPropertyViewModel : BindableBase, INavigationAware
+    public class FreetextAnnotPropertyViewModel : FontBoard, INavigationAware
     {
+        private bool isSelectedEmpty;
+        public bool IsSelectedEmpty
+        {
+            get { return isSelectedEmpty; }
+            set { SetProperty(ref isSelectedEmpty, value); }
+        }
+
         private double fillOpacity = 1;
         public double FillOpacity
         {
@@ -30,18 +38,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-        private Brush selectColor = new SolidColorBrush(Colors.Black);
-        public Brush SelectColor
-        {
-            get { return selectColor; }
-            set
-            {
-                SetProperty(ref selectColor, value);
-                AnnotEvent?.UpdateAttrib(AnnotAttrib.FontColor, (selectColor as SolidColorBrush).Color);
-                AnnotEvent?.UpdateAnnot();
-            }
-        }
-
         private Brush fillColor = new SolidColorBrush(Colors.Transparent);
         public Brush FillColor
         {
@@ -54,147 +50,71 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
-        private FontFamily fontFamily = new FontFamily("Courier");
-        public FontFamily TextFontFamily
-        {
-            get { return fontFamily; }
-            set
-            {
-                SetProperty(ref fontFamily, value);
-            }
-        }
-
-        private FontWeight fontWeights = FontWeights.Normal;
-        public FontWeight TextFontWeights
-        {
-            get { return fontWeights; }
-            set
-            {
-                SetProperty(ref fontWeights, value);
-            }
-        }
-
-        private FontStyle fontStyle = FontStyles.Normal;
-        public FontStyle TextFontStyle
-        {
-            get { return fontStyle; }
-            set
-            {
-                SetProperty(ref fontStyle, value);
-            }
-        }
-
-
-        private int fontSize = 24;
-        public int TextFontSize
-        {
-            get { return fontSize; }
-            set
-            {
-                SetProperty(ref fontSize, value);
-            }
-        }
-
-        private List<FontStyleItem> fontStyleList = new List<FontStyleItem>();
-        public List<FontStyleItem> FontStyleList
-        {
-            get { return fontStyleList; }
-            set
-            {
-                SetProperty(ref fontStyleList, value);
-            }
-        }
-
-        private ComboDataItem _presetTextData;
-        public ComboDataItem PresetTextData
-        {
-            get { return _presetTextData; }
-            set
-            {
-                SetProperty(ref _presetTextData, value);
-                if (_presetTextData != null && FontStyleList != null)
-                {
-
-                }
-            }
-        }
-
-        private ComboDataItem _fontSizeData = new ComboDataItem(6);
-        public ComboDataItem FontSizeData
-        {
-            get { return _fontSizeData; }
-            set
-            {
-                SetProperty(ref _fontSizeData, value);
-            }
-        }
-
-        private ComboDataItem _fontFamilyData;
-        public ComboDataItem FontFamilyData
-        {
-            get { return _fontFamilyData; }
-            set
-            {
-                SetProperty(ref _fontFamilyData, value);
-            }
-        }
-
-        private FontStyle _fontStyle;
-        public FontStyle FontStyleItem
-        {
-            get { return _fontStyle; }
-            set { SetProperty(ref _fontStyle, value); }
-        }
-
-        private FontWeight _fontWeight;
-        public FontWeight FontWeightItem
-        {
-            get { return _fontWeight; }
-            set { SetProperty(ref _fontWeight, value); }
-        }
-
-
-        private ComboDataItem _fontWeightStyleItem;
-        public ComboDataItem FontWeightStyleItem
-        {
-            get { return _fontWeightStyleItem; }
-            set
-            {
-                SetProperty(ref _fontWeightStyleItem, value);
-                if (_fontWeightStyleItem.ValueStr != null && string.IsNullOrEmpty((string)_fontWeightStyleItem.ValueStr) == false)
-                {
-                    switch ((string)_fontWeightStyleItem.ValueStr)
-                    {
-                        case "Regular":
-                            FontStyleItem = FontStyles.Normal;
-                            FontWeightItem = FontWeights.Normal;
-                            break;
-
-                        case "Bold":
-                            FontStyleItem = FontStyles.Normal;
-                            FontWeightItem = FontWeights.Bold;
-                            break;
-
-                        case "Italic":
-                            FontStyleItem = FontStyles.Italic;
-                            FontWeightItem = FontWeights.Normal;
-                            break;
-
-                        case "Bold Italic":
-                            FontStyleItem = FontStyles.Italic;
-                            FontWeightItem = FontWeights.Bold;
-                            break;
-                    }
+        //private FontFamily fontFamily = new FontFamily("Courier");
+        //public FontFamily TextFontFamily
+        //{
+        //    get { return fontFamily; }
+        //    set
+        //    {
+        //        SetProperty(ref fontFamily, value);
+        //    }
+        //}
+
+        //private FontWeight fontWeights = FontWeights.Normal;
+        //public FontWeight TextFontWeights
+        //{
+        //    get { return fontWeights; }
+        //    set
+        //    {
+        //        SetProperty(ref fontWeights, value);
+        //    }
+        //}
+
+        //private FontStyle fontStyle = FontStyles.Normal;
+        //public FontStyle TextFontStyle
+        //{
+        //    get { return fontStyle; }
+        //    set
+        //    {
+        //        SetProperty(ref fontStyle, value);
+        //    }
+        //}
+
+        //private ComboDataItem _fontWeightStyleItem;
+        //public ComboDataItem FontWeightStyleItem
+        //{
+        //    get { return _fontWeightStyleItem; }
+        //    set
+        //    {
+        //        SetProperty(ref _fontWeightStyleItem, value);
+        //        if (_fontWeightStyleItem.ValueStr != null && string.IsNullOrEmpty((string)_fontWeightStyleItem.ValueStr) == false)
+        //        {
+        //            switch ((string)_fontWeightStyleItem.ValueStr)
+        //            {
+        //                case "Regular":
+        //                    FontStyleItem = FontStyles.Normal;
+        //                    FontWeightItem = FontWeights.Normal;
+        //                    break;
+
+        //                case "Bold":
+        //                    FontStyleItem = FontStyles.Normal;
+        //                    FontWeightItem = FontWeights.Bold;
+        //                    break;
+
+        //                case "Italic":
+        //                    FontStyleItem = FontStyles.Italic;
+        //                    FontWeightItem = FontWeights.Normal;
+        //                    break;
+
+        //                case "Bold Italic":
+        //                    FontStyleItem = FontStyles.Italic;
+        //                    FontWeightItem = FontWeights.Bold;
+        //                    break;
+        //            }
                     
-                }
-            }
-        }
-
-
-        public List<ComboDataItem> PresetTextItems { get; private set; }
-        public List<ComboDataItem> FontFamilyItems { get; private set; }
-        public List<ComboDataItem> FontStyleItems { get; private set; }
-
+        //        }
+        //    }
+        //}
         public DelegateCommand<object> SelectedFillOpacityCommand { get; set; }
         public DelegateCommand<object> SelectedFontStyleCommand { get; set; }
         public DelegateCommand<object> SelectedColorCommand { get; set; }
@@ -205,8 +125,11 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public DelegateCommand<object> TextAlignCheckedCommand { get; set; }
         public DelegateCommand<object> LineModeCheckedCommand { get; set; }
         public DelegateCommand<object> SelectedOpacityValueCommand { get; set; }
-        
 
+        public DelegateCommand CustomFontStyleCommand { get; set; }
+
+        public DelegateCommand ReDefineFontStyleCommand { get; set; }
+        public DelegateCommand RestoreDefaultStyleCommand { get; set; }
 
         public event EventHandler<object> LoadPropertyHandler;
 
@@ -222,6 +145,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             TextAlignCheckedCommand = new DelegateCommand<object>(TextAlignChecked);
             LineModeCheckedCommand = new DelegateCommand<object>(LineMode_Checked);
             SelectedOpacityValueCommand = new DelegateCommand<object>(SelectedOpacityValue);
+
+            CustomFontStyleCommand = new DelegateCommand(CustomFontStyle);
+            ReDefineFontStyleCommand = new DelegateCommand(ReDefineFontStyle);
+            RestoreDefaultStyleCommand = new DelegateCommand(RestoreDefaultStyle);
             InitVariable();
         }
 
@@ -244,13 +171,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         private void InitFontStyles()
         {
-            PresetTextItems = new List<ComboDataItem>();
-            FontStyleList = TextFont.GetPresetFontStyle();
+            PresetFontItems = new List<ComboDataItem>();
+            PresetFontList = TextFont.GetCachePresetFontList();
 
-            foreach (var item in FontStyleList)
+            foreach (var item in PresetFontList)
             {
                 ComboDataItem itemData = new ComboDataItem(item.mTag, item.mTagContent);
-                PresetTextItems.Add(itemData);
+                PresetFontItems.Add(itemData);
             }
         }
 
@@ -299,12 +226,11 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
         
-
         private void SelectedFontStyle(object obj)
         {
-            if (obj != null && (FontStyleItem)obj != null)
+            if (obj != null && (PresetFontItem)obj != null)
             {
-                var item = (FontStyleItem)obj;
+                var item = (PresetFontItem)obj;
 
                 AnnotEvent?.UpdateAttrib(AnnotAttrib.FontSize, item.mFontSize);
 
@@ -346,7 +272,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 if (content != null)
                 {
                     var intData = int.Parse(content);
-                    TextFontSize = intData;
                     AnnotEvent?.UpdateAttrib(AnnotAttrib.FontSize, intData);
                    
                     AnnotEvent?.UpdateAnnot();
@@ -366,8 +291,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.FontStyle, FontStyles.Normal);
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.FontWeight, FontWeights.Normal);
-                        TextFontWeights = FontWeights.Normal;
-                        TextFontStyle = FontStyles.Normal;
+                       // TextFontWeights = FontWeights.Normal;
+                        //TextFontStyle = FontStyles.Normal;
                     }
 
 
@@ -375,8 +300,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.FontStyle, FontStyles.Normal);
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.FontWeight, FontWeights.Bold);
-                        TextFontWeights = FontWeights.Bold;
-                        TextFontStyle = FontStyles.Normal;
+                        //TextFontWeights = FontWeights.Bold;
+                       // TextFontStyle = FontStyles.Normal;
                     }
 
 
@@ -384,16 +309,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.FontStyle, FontStyles.Italic);
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.FontWeight, FontWeights.Normal);
-                        TextFontWeights = FontWeights.Normal;
-                        TextFontStyle = FontStyles.Italic;
+                       // TextFontWeights = FontWeights.Normal;
+                       // TextFontStyle = FontStyles.Italic;
                     }
 
                     if (content == "Bold Italic")
                     {
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.FontStyle, FontStyles.Italic);
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.FontWeight, FontWeights.Bold);
-                        TextFontWeights = FontWeights.Bold;
-                        TextFontStyle = FontStyles.Italic;
+                        //TextFontWeights = FontWeights.Bold;
+                       // TextFontStyle = FontStyles.Italic;
                     }
 
                     AnnotEvent?.UpdateAnnot();
@@ -403,34 +328,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         private void FontFamilyChanged_Command(object obj)
         {
-            if (obj != null)
-            {
-                if ((int)obj > -1)
-                {
-                    if ((int)obj == 0)
-                    {
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.FontFamily, new FontFamily("Courier"));
-                        TextFontFamily = new FontFamily("Courier");
-                    }
-                        
-
-                    if ((int)obj == 1)
-                    {
-                        TextFontFamily = new FontFamily("Helvetica");
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.FontFamily, new FontFamily("Helvetica"));
-                    }
-                       
-
-                    if ((int)obj == 2)
-                    {
-                        TextFontFamily = new FontFamily("Times");
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.FontFamily, new FontFamily("Times"));
-                    }
-                       
-
-                    AnnotEvent?.UpdateAnnot();
-                }
-            }
 
         }
 
@@ -462,7 +359,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
                     SelectColor = new SolidColorBrush(colorValue);
                     SelectColor.Opacity = FillOpacity;
-
+                    
                     Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
                     changeData[AnnotArgsType.AnnotFreehand] = obj;
                     PropertyPanel.DataChangedInvoke(this, changeData);
@@ -470,6 +367,74 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private void CustomFontStyle()
+        {
+            if (CurrentPresetFont != null)
+            {
+                ContextMenu menu;
+                if (CurrentPresetFont.ValueStr == "custom")
+                {
+                    menu = SelectAnnotContextMenu(false);
+                }
+                else
+                {
+                    menu = SelectAnnotContextMenu(true);
+                }
+
+                if (menu != null)
+                {
+                    menu.IsOpen = true;
+                }
+            }
+
+        }
+
+        private ContextMenu SelectAnnotContextMenu(bool isEnable)
+        {
+            var popMenu = App.Current.FindResource("CustomFontStyleFlyoutMenu") as ContextMenu;
+            if (popMenu != null && popMenu.Items.Count == 2)
+            {
+                //用所选部分重新定义
+                MenuItem menuItem = popMenu.Items[0] as MenuItem;
+                menuItem.IsEnabled = isEnable;
+                menuItem.Command = ReDefineFontStyleCommand;
+                //恢复默认预设样式
+                menuItem = popMenu.Items[1] as MenuItem;
+                menuItem.IsEnabled = isEnable;
+                menuItem.Command = RestoreDefaultStyleCommand;
+            }
+            return popMenu;
+        }
+
+        public List<PresetFontItem> FontStyleList = new List<PresetFontItem>();
+        private void ReDefineFontStyle()
+        {
+            var item = FontStyleList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
+
+            if (CurrentFontFamily.ValueStr == "Bold")
+            {
+                item.mFontStyle = FontStyles.Normal;
+                item.mFontWeight = FontWeights.Bold;
+            }
+            else if (CurrentFontFamily.ValueStr == "Regular")
+            {
+                item.mFontStyle = FontStyles.Normal;
+                item.mFontWeight = FontWeights.Normal;
+            }
+            else
+            {
+                item.mFontStyle = FontStyles.Italic;
+                item.mFontWeight = FontWeights.Bold;
+            }
+
+            item.mFontSize = (int)CurrentFontSize.Value;
+        }
+
+        private void RestoreDefaultStyle()
+        {
+            var item = FontStyleList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
+        }
+
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
             return true;
@@ -477,6 +442,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
+            IsCanSave = false;
+            ChangedValue -= FontMode_ChangedValue;
         }
 
         public AnnotAttribEvent AnnotEvent { get; set; }
@@ -490,6 +457,43 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 Annot = PropertyPanel.annot as FreeTextAnnotArgs;
                 LoadPropertyHandler?.Invoke(this, Annot);
+                ChangedValue -= FontMode_ChangedValue;
+                ChangedValue += FontMode_ChangedValue;
+                IsCanSave = true;
+            }
+        }
+
+        private void FontMode_ChangedValue(object sender, FontSetModeType e)
+        {
+            if (sender != null)
+            {
+                switch (e)
+                {
+                    case FontSetModeType.PresetFontStyes:
+                        
+                        break;
+                    case FontSetModeType.FontFamilys:
+                      
+                        break;
+                    case FontSetModeType.FontSizes:
+                       
+                        break;
+                    case FontSetModeType.FontWeight_Style:
+                        UpdateFontWeight_Style();
+                    
+                        break;
+                    case FontSetModeType.FontColor:
+                        if (sender is Color == true)
+                        {
+                            AnnotEvent.UpdateAttrib(AnnotAttrib.FontColor, CurrentFontColor);
+                            AnnotEvent.UpdateAnnot();
+                        }
+
+                        break;
+
+                    case FontSetModeType.TextAlignment:
+                        break;
+                }
             }
         }
     }

+ 41 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/MultiSelectAnnotPropertyViewModel.cs

@@ -0,0 +1,41 @@
+using PDF_Office.Model;
+using PDF_Office.ViewModels.Tools;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
+{
+    public class MultiSelectAnnotPropertyViewModel : BindableBase, INavigationAware
+    {
+        private AnnotPropertyPanel PropertyPanel;
+        public MultiSelectAnnotPropertyViewModel()
+        {
+
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+
+        }
+
+
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+
+            navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
+          
+
+        }
+    }
+}

+ 53 - 39
PDF Office/ViewModels/PropertyPanel/FontSetModeVM.cs

@@ -1,6 +1,7 @@
 using ComPDFKit.PDFAnnotation;
 using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
+using PDFSettings;
 using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
@@ -23,16 +24,18 @@ namespace PDF_Office.ViewModels.PropertyPanel
         TextAlignment
 
     }
-    public class FontSetMode : BindableBase
+
+    //设置字体大小、字体内容排版、字体颜色、字体样式、字重
+    public class FontBoard : BindableBase
     {
         #region 变量
         protected event EventHandler<FontSetModeType> ChangedValue;
         protected bool IsCanSave = false;
         public List<ComboDataItem> FontFamilyItems { get; protected set; }
         public List<ComboDataItem> FontStyleItems { get; protected set; }
-        public List<ComboDataItem> PresetTextItems { get; protected set; }
+        public List<ComboDataItem> PresetFontItems { get; protected set; }
 
-        public List<FontStyleItem> FontStyleList = new List<FontStyleItem>();
+        public List<PresetFontItem> PresetFontList = new List<PresetFontItem>();
 
         #endregion
 
@@ -43,16 +46,17 @@ namespace PDF_Office.ViewModels.PropertyPanel
             InitBase_FontFamilys();
             InitBase_FontStyles();
         }
+
         //预设字体样式
         private void InitBase_PresetFontStyles()
         {
-            PresetTextItems = new List<ComboDataItem>();
-            FontStyleList = TextFont.GetPresetFontStyle();
+            PresetFontItems = new List<ComboDataItem>();
+            PresetFontList = TextFont.GetCachePresetFontList();
 
-            foreach (var item in FontStyleList)
+            foreach (var item in PresetFontList)
             {
                 ComboDataItem itemData = new ComboDataItem(item.mTag, item.mTagContent);
-                PresetTextItems.Add(itemData);
+                PresetFontItems.Add(itemData);
             }
 
         }
@@ -71,17 +75,17 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
         #region 属性
 
-        private ComboDataItem _presetTextData;
-        public ComboDataItem PresetTextData
+        private ComboDataItem _currentPresetFont;
+        public ComboDataItem CurrentPresetFont
         {
-            get { return _presetTextData; }
+            get { return _currentPresetFont; }
             set
             {
-                bool isChange = IsEqualStrComboData(_presetTextData, value);
-                SetProperty(ref _presetTextData, value);
+                bool isChange = IsEqualStrComboData(_currentPresetFont, value);
+                SetProperty(ref _currentPresetFont, value);
                 if (isChange)
                 {
-                    ChangedValue?.Invoke(_presetTextData.ValueStr, FontSetModeType.PresetFontStyes);
+                    ChangedValue?.Invoke(_currentPresetFont.ValueStr, FontSetModeType.PresetFontStyes);
                 }
             }
         }
@@ -89,18 +93,18 @@ namespace PDF_Office.ViewModels.PropertyPanel
         #region 字体样式
 
         //下拉框列表
-        private ComboDataItem _fontFamilyData;
-        public ComboDataItem FontFamilyData
+        private ComboDataItem _currentFontFamily;
+        public ComboDataItem CurrentFontFamily
         {
-            get { return _fontFamilyData; }
+            get { return _currentFontFamily; }
             set
             {
-                bool isChange = IsEqualStrComboData(_fontFamilyData, value);
-                SetProperty(ref _fontFamilyData, value);
+                bool isChange = IsEqualStrComboData(_currentFontFamily, value);
+                SetProperty(ref _currentFontFamily, value);
                 if (isChange)
                 {
 
-                    ChangedValue?.Invoke(_fontFamilyData.ValueStr, FontSetModeType.FontFamilys);
+                    ChangedValue?.Invoke(_currentFontFamily.ValueStr, FontSetModeType.FontFamilys);
                 }
             }
         }
@@ -108,20 +112,20 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
         #region 字体大小
         //下拉框列表:字体大小
-        private ComboDataItem _fontSizeData = new ComboDataItem(6);
-        public ComboDataItem FontSizeData
+        private ComboDataItem _currentFontSize = new ComboDataItem(6);
+        public ComboDataItem CurrentFontSize
         {
-            get { return _fontSizeData; }
+            get { return _currentFontSize; }
             set
             {
-                bool isChange = IsEqualComboData(_fontSizeData, value);
+                bool isChange = IsEqualComboData(_currentFontSize, value);
 
                 if(isChange && value.Value > 0)
-                SetProperty(ref _fontSizeData, value);
+                SetProperty(ref _currentFontSize, value);
 
                 if (isChange && value.Value > 0)
                 {
-                    ChangedValue?.Invoke(_fontSizeData.Value, FontSetModeType.FontSizes);
+                    ChangedValue?.Invoke(_currentFontSize.Value, FontSetModeType.FontSizes);
                 }
             }
         }
@@ -145,24 +149,24 @@ namespace PDF_Office.ViewModels.PropertyPanel
             set { SetProperty(ref _fontWeight, value); }
         }
 
-        private ComboDataItem _fontWeightStyleItem;
-        public ComboDataItem FontWeightStyleItem
+        private ComboDataItem _currrentFontWeightStyle;
+        public ComboDataItem CurrrentFontWeightStyle
         {
-            get { return _fontWeightStyleItem; }
+            get { return _currrentFontWeightStyle; }
             set
             {
-                bool isChange = IsEqualStrComboData(_fontWeightStyleItem, value);
-                SetProperty(ref _fontWeightStyleItem, value);
+                bool isChange = IsEqualStrComboData(_currrentFontWeightStyle, value);
+                SetProperty(ref _currrentFontWeightStyle, value);
                 if (isChange)
                 {
-                    ChangedValue?.Invoke(_fontWeightStyleItem, FontSetModeType.FontWeight_Style);
+                    ChangedValue?.Invoke(_currrentFontWeightStyle, FontSetModeType.FontWeight_Style);
                 }
             }
         }
 
         protected void UpdateFontWeight_Style()
         {
-            switch (FontWeightStyleItem.ValueStr)
+            switch (CurrrentFontWeightStyle.ValueStr)
             {
                 case "Regular":
                     FontStyleItem = FontStyles.Normal;
@@ -203,20 +207,20 @@ namespace PDF_Office.ViewModels.PropertyPanel
                 SetProperty(ref selectColor, value);
                 if (IsCanSave)
                 {
+                    CurrentFontColor = (selectColor as SolidColorBrush).Color;
                     ChangedValue?.Invoke((selectColor as SolidColorBrush).Color, FontSetModeType.FontColor);
-                    CurrentColor = (selectColor as SolidColorBrush).Color;
                 }
                     
             }
         }
 
-        private Color currentColor = Colors.Black;
-        public Color CurrentColor
+        private Color _currentFontColor = Colors.Black;
+        public Color CurrentFontColor
         {
-            get { return currentColor; }
+            get { return _currentFontColor; }
             set
             {
-                SetProperty(ref currentColor, value);
+                SetProperty(ref _currentFontColor, value);
             }
         }
 
@@ -249,7 +253,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
         #region 列表选中赋值
 
-        protected void SelectedFontWeights_Style(FontStyle fontStyle, FontWeight fontWeights)
+        protected void GetFontWeights_Style(FontStyle fontStyle, FontWeight fontWeights)
         {
             string strValue = "";
             string strContent = "";
@@ -283,9 +287,19 @@ namespace PDF_Office.ViewModels.PropertyPanel
                     
             }
 
-            FontWeightStyleItem = new ComboDataItem(strValue, strContent);
+            CurrrentFontWeightStyle = new ComboDataItem(strValue, strContent);
+        }
+
+
+        protected void GetCurrentFontSize(int size)
+        {
+            CurrentFontSize = new ComboDataItem(size);
         }
 
+        protected void GetCurrentFontFamily(string fontFamily,string uiStr)
+        {
+            CurrentFontFamily = new ComboDataItem(fontFamily, uiStr);
+        }
 
         #endregion
     }

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

@@ -365,13 +365,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
         private ContextMenu EmptyStateMenu(object sender)
         {
             var popMenu = App.Current.FindResource("NoneMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu);
+            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
             //粘贴
-            customMenu.SetMenuBinding(0, sender, ApplicationCommands.Paste);
+            customMenu.SetMenuBinding(0, ApplicationCommands.Paste);
             //添加文本
-            customMenu.SetMenuBinding(1, sender, AddTextCommand);
+            customMenu.SetMenuBinding(1, AddTextCommand);
             //添加图像
-            customMenu.SetMenuBinding(2, sender, AddImgCommand);
+            customMenu.SetMenuBinding(2, AddImgCommand);
 
             return popMenu;
         }
@@ -379,21 +379,21 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
         private ContextMenu SelectImgPDFEdit(object sender)
         {
             var popMenu = App.Current.FindResource("SelectImgMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu);
+            CustomPopMenu customMenu = new CustomPopMenu(popMenu,sender);
             //复制
-            customMenu.SetMenuBinding(0, sender, ApplicationCommands.Copy);
+            customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
             //剪切
-            customMenu.SetMenuBinding(1, sender, ApplicationCommands.Cut);
+            customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
             //粘贴
-            customMenu.SetMenuBinding(2, sender, ApplicationCommands.Paste);
+            customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
             //删除
-            customMenu.SetMenuBinding(3, sender, ApplicationCommands.Delete);
+            customMenu.SetMenuBinding(3, ApplicationCommands.Delete);
             //裁剪
-            customMenu.SetMenuBinding(4, sender, CropModeCommand);
+            customMenu.SetMenuBinding(4, CropModeCommand);
             //替换
-            customMenu.SetMenuBinding(5, sender, ReplaceImgCommand);
+            customMenu.SetMenuBinding(5, ReplaceImgCommand);
             //导出
-            customMenu.SetMenuBinding(6, sender, ExportImgCommand);
+            customMenu.SetMenuBinding(6, ExportImgCommand);
             return popMenu;
         }
 

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

@@ -16,7 +16,7 @@ using System.Windows.Media;
 namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
 {
 
-    public class PDFEditVM: FontSetMode
+    public class PDFEditVM: FontBoard
     {
        
         #region 变量

+ 71 - 35
PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs

@@ -5,6 +5,7 @@ using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
+using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
@@ -107,20 +108,53 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
 
         private void CustomFontStyle_Click()
         {
-            ContextMenu menu = SelectAnnotContextMenu();
-           if(menu != null)
+            if(CurrentPresetFont != null)
             {
-                menu.IsOpen = true;
+                ContextMenu menu;
+                if (CurrentPresetFont.ValueStr == "custom")
+                {
+                    menu = SelectAnnotContextMenu(false);
+                }
+                else
+                {
+                    menu = SelectAnnotContextMenu(true);
+                }
+               
+                if (menu != null)
+                {
+                    menu.IsOpen = true;
+                }
             }
+            
         }
         private void ReDefineFontStyle()
         {
 
+            var item = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
+
+            if (CurrentFontFamily.ValueStr == "Bold")
+            {
+                item.mFontStyle = FontStyles.Normal;
+                item.mFontWeight = FontWeights.Bold;
+            }
+            else if (CurrentFontFamily.ValueStr == "Regular")
+            {
+                item.mFontStyle = FontStyles.Normal;
+                item.mFontWeight = FontWeights.Normal;
+            }
+            else
+            {
+                item.mFontStyle = FontStyles.Italic;
+                item.mFontWeight = FontWeights.Bold;
+            }
+
+            item.mFontSize = (int)CurrentFontSize.Value;
+
         }
 
         private void RestoreDefaultStyle()
         {
-
+            var item = PresetFontList.FirstOrDefault(temp => temp.mTag == CurrentPresetFont.ValueStr);
         }
 
         private void LayoutAlignChecked(object obj)
@@ -205,9 +239,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
 
         private void SelectedFontStyle(object obj)
         {
-            if (obj != null && (FontStyleItem)obj != null)
+            if (obj != null && (PresetFontItem)obj != null)
             {
-                var item = (FontStyleItem)obj;
+                var item = (PresetFontItem)obj;
 
             }
         }
@@ -287,13 +321,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
         private ContextMenu EmptyStateMenu(object sender)
         {
             var popMenu = App.Current.FindResource("NoneMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu);
+            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
             //粘贴
-            customMenu.SetMenuBinding(0, sender, ApplicationCommands.Paste);
+            customMenu.SetMenuBinding(0, ApplicationCommands.Paste);
             //添加文本
-            customMenu.SetMenuBinding(1, sender, AddTextCommand);
+            customMenu.SetMenuBinding(1, AddTextCommand);
             //添加图像
-            customMenu.SetMenuBinding(2, sender, AddImgCommand);
+            customMenu.SetMenuBinding(2, AddImgCommand);
 
             return popMenu;
         }
@@ -302,17 +336,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
         private ContextMenu SelectTextBorder(object sender)
         {
             var popMenu = App.Current.FindResource("SelectTextMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu);
+            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
             //编辑
-            customMenu.SetMenuBinding(0, sender, EditTextModeCommand);
+            customMenu.SetMenuBinding(0, EditTextModeCommand);
             //复制
-            customMenu.SetMenuBinding(1, sender, ApplicationCommands.Copy);
+            customMenu.SetMenuBinding(1, ApplicationCommands.Copy);
             //剪切
-            customMenu.SetMenuBinding(2, sender, ApplicationCommands.Cut);
+            customMenu.SetMenuBinding(2, ApplicationCommands.Cut);
             //粘贴
-            customMenu.SetMenuBinding(3, sender, ApplicationCommands.Paste);
+            customMenu.SetMenuBinding(3, ApplicationCommands.Paste);
             //删除
-            customMenu.SetMenuBinding(4, sender, ApplicationCommands.Delete);
+            customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
          
             customMenu.SetVisibilityProperty(6, false);
 
@@ -323,19 +357,19 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
         private ContextMenu SelectTextContent(object sender)
         {
             var popMenu = App.Current.FindResource("SelectContentMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu);
+            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
             //复制
-            customMenu.SetMenuBinding(0, sender, ApplicationCommands.Copy);
+            customMenu.SetMenuBinding(0, ApplicationCommands.Copy);
             //剪切
-            customMenu.SetMenuBinding(1, sender, ApplicationCommands.Cut);
+            customMenu.SetMenuBinding(1, ApplicationCommands.Cut);
             //粘贴
-            customMenu.SetMenuBinding(2, sender, ApplicationCommands.Paste);
+            customMenu.SetMenuBinding(2, ApplicationCommands.Paste);
             //粘贴并匹配样式
             customMenu.SetVisibilityProperty(3, false);
             //删除
-            customMenu.SetMenuBinding(4, sender, ApplicationCommands.Delete);
+            customMenu.SetMenuBinding(4, ApplicationCommands.Delete);
             //全部选定
-            customMenu.SetMenuBinding(5, sender, ApplicationCommands.SelectAll);
+            customMenu.SetMenuBinding(5, ApplicationCommands.SelectAll);
 
             return popMenu;
         }
@@ -390,19 +424,19 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
             }
         }
         
-        private ContextMenu SelectAnnotContextMenu()
+        private ContextMenu SelectAnnotContextMenu(bool isEnable)
         {
             var popMenu = App.Current.FindResource("CustomFontStyleFlyoutMenu") as ContextMenu;
             if (popMenu != null && popMenu.Items.Count == 2)
             {
-                //剪切
+                //用所选部分重新定义
                 MenuItem menuItem = popMenu.Items[0] as MenuItem;
-               // menuItem.CommandTarget = (UIElement)sender;
-                //menuItem.Command = ApplicationCommands.Cut;
-                //复制
+                menuItem.IsEnabled = isEnable;
+                menuItem.Command = ReDefineFontStyleCommand;
+                //恢复默认预设样式
                 menuItem = popMenu.Items[1] as MenuItem;
-                //menuItem.CommandTarget = (UIElement)sender;
-               // menuItem.Command = ApplicationCommands.Copy;
+                menuItem.IsEnabled = isEnable;
+                menuItem.Command = RestoreDefaultStyleCommand;
             }
             return popMenu;
         }
@@ -462,9 +496,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
                 switch(e)
                 {
                     case FontSetModeType.PresetFontStyes:
-                        if(FontStyleList != null && sender  is string  == true)
+                        if(PresetFontList != null && sender  is string  == true)
                         {
-                            var item = FontStyleList.FirstOrDefault(temp => temp.mTag == (string)sender);
+                            var item = PresetFontList.FirstOrDefault(temp => temp.mTag == (string)sender);
                             if (item != null && TextEditEvent != null)
                             {
                                 if(TextEditEventList.Count == 1 && IsSelectedEmpty == false)
@@ -539,11 +573,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.PDFEdit
             if (TextEditEvent != null && TextEditEventList.Count == 1)
             {
                 SelectColor = new SolidColorBrush(TextEditEvent.FontColor);
-                FontSizeData = new ComboDataItem(TextEditEvent.FontSize);
+
+                GetCurrentFontSize((int)TextEditEvent.FontSize);
+
                 if(TextEditEvent.FontFamily != null)
-                FontFamilyData = new ComboDataItem(TextEditEvent.FontFamily.ToString(), TextEditEvent.FontFamily.ToString());
-               
-                SelectedFontWeights_Style(TextEditEvent.FontStyle, TextEditEvent.FontWeight);
+                    GetCurrentFontFamily(TextEditEvent.FontFamily.ToString(), TextEditEvent.FontFamily.ToString());
+                
+                GetFontWeights_Style(TextEditEvent.FontStyle, TextEditEvent.FontWeight);
                 TextAlign = TextEditEvent.TextAlign;
 
 

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

@@ -174,21 +174,31 @@ namespace PDF_Office.ViewModels.Tools
                             case AnnotArgsType.AnnotLink:
                                 //viewContentViewModel.IsCreateLink = false;
                                 GetLink(annot as LinkAnnotArgs, e);
+                                PDFViewer.SetToolParam(annot);
                                 break;
                         }
+                        //TODO: 设计已重新调整为(仅限高亮注释):修改注释后,会作用到之后添加的注释中。因此先把此逻辑“创建注释后,会自动回到默认值”注释掉
+                        if (annot.EventType != AnnotArgsType.AnnotStrikeout &&
+                            annot.EventType != AnnotArgsType.AnnotUnderline &&
+                            annot.EventType != AnnotArgsType.AnnotHighlight &&
+                            annot.EventType != AnnotArgsType.AnnotSquiggly
+                            )
+                        {
+                            if (ToolExpandDict.ContainsValue(e.AnnotItemsList[0].EventType))
+                            {
+                                foreach (var item in ToolExpandDict)
+                                {
+                                    if (item.Value == e.AnnotItemsList[0].EventType)
+                                    {
+                                        annot = null;//新建注释时,回到默认值
+                                        FindAnnotTypeKey(item.Key, ref annot);
+                                        break;
+                                    }
+                                }
+                            }
+                        }
+                        //else
                         PDFViewer.SetToolParam(annot);
-                        //TODO: 设计已重新调整为:修改注释后,会作用到之后添加的注释中。因此先把此逻辑“创建注释后,会自动回到默认值”注释掉
-                        //if (ToolExpandDict.ContainsValue(e.AnnotItemsList[0].EventType))
-                        //{
-                        //    foreach (var item in ToolExpandDict)
-                        //    {
-                        //        if (item.Value == e.AnnotItemsList[0].EventType)
-                        //        {
-                        //            FindAnnotTypeKey(item.Key, ref annot);
-                        //            break;
-                        //        }
-                        //    }
-                        //}
                         //设计重新调整,阅读页空白处,右键菜单,添加链接,和pro mac一样的效果,不显示属性栏
                         if (isRightMenuAddAnnot)
                         {
@@ -234,7 +244,7 @@ namespace PDF_Office.ViewModels.Tools
                     }
                     else
                     {
-                        if (e.PressOnSelectedText)
+                        if (e.PressOnSelectedText || e.CommandTarget == TargetType.ImageSelection)
                         {
                             e.PopupMenu = NoneSelectAnnotContextMenu(sender, e);
                             if (e.PopupMenu != null)
@@ -369,9 +379,7 @@ namespace PDF_Office.ViewModels.Tools
                     switch (editEvent.EditAction)
                     {
                         case ActionType.Add:
-                            BOTAContentViewModel bOTAContentViewModel = null;
-                            BOTAContent bOTAContent = null;
-                            bool isTabItemAnnotation = IsBOTATabItemShow(out bOTAContentViewModel, out bOTAContent, "TabItemAnnotation");
+                            bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
 
                             if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true)
                             {

+ 211 - 74
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -3,17 +3,22 @@ using ComPDFKit.PDFDocument;
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using ComPDFKitViewer.PdfViewer;
+using Microsoft.Office.Core;
 using Microsoft.Win32;
 using PDF_Office.CustomControl;
 using PDF_Office.Helper;
+using PDF_Office.Model.BOTA;
 using PDF_Office.Properties;
+using PDF_Office.ViewModels.BOTA;
 using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
+using PDF_Office.Views.BOTA;
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using PDFSettings;
 using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
+using System.IO;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -22,6 +27,7 @@ using System.Windows.Controls;
 using System.Windows.Forms;
 using System.Windows.Input;
 using System.Windows.Media;
+using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
 using ContextMenu = System.Windows.Controls.ContextMenu;
 using HorizontalAlignment = System.Windows.HorizontalAlignment;
 using MenuItem = System.Windows.Controls.MenuItem;
@@ -1041,10 +1047,7 @@ namespace PDF_Office.ViewModels.Tools
         {
             ContextMenu popMenu = new ContextMenu();
             popMenu.FontSize = 14;
-            //if (popMenu.Items.Count > 0)
-            //{
-            //    popMenu.Items.Clear();
-            //}
+
             MenuItem menuItem = new MenuItem();
             menuItem = new MenuItem();
             menuItem.CommandTarget = (UIElement)sender;
@@ -1056,104 +1059,136 @@ namespace PDF_Office.ViewModels.Tools
             menuItem.Command = ApplicationCommands.Paste;
             popMenu.Items.Add(menuItem);
 
-            //Separator separator = (Separator)App.Current.FindResource("Separator");
-            Separator separator = new Separator();
-            separator.Height = 1;
-            separator.BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#33000000"));
-            separator.BorderThickness = new Thickness(1);
-            separator.Width = popMenu.Width;
-            separator.Style = (Style)App.Current.FindResource(System.Windows.Controls.ToolBar.SeparatorStyleKey);
-            popMenu.Items.Add(separator);
+            Separator separator = null;
+            if (annotCommand.CommandTarget == TargetType.ImageSelection)
+            {
+                separator = SetSeparator();
+                popMenu.Items.Add(separator);
 
-            menuItem = new MenuItem();
-            SetSelectTextOrImageMenuItem("高亮", "HighLight", annotCommand, out menuItem);
-            popMenu.Items.Add(menuItem);
+                SetSelectTextOrImageMenuItem("导出图片...", "ExportPicture", annotCommand, out menuItem);
+                popMenu.Items.Add(menuItem);
+            }
+            else if (annotCommand.CommandTarget == TargetType.Annot)
+            {
+                separator = SetSeparator();
+                popMenu.Items.Add(separator);
 
-            menuItem = new MenuItem();
-            SetSelectTextOrImageMenuItem("下划线", "UnderLine", annotCommand, out menuItem);
-            popMenu.Items.Add(menuItem);
+                SetSelectTextOrImageMenuItem("高亮", "HighLight", annotCommand, out menuItem);
+                popMenu.Items.Add(menuItem);
 
-            menuItem = new MenuItem();
-            SetSelectTextOrImageMenuItem("删除线", "Strikeout", annotCommand, out menuItem);
-            popMenu.Items.Add(menuItem);
+                SetSelectTextOrImageMenuItem("下划线", "UnderLine", annotCommand, out menuItem);
+                popMenu.Items.Add(menuItem);
+
+                SetSelectTextOrImageMenuItem("删除线", "Strikeout", annotCommand, out menuItem);
+                popMenu.Items.Add(menuItem);
+            }
+            separator = SetSeparator();
+            popMenu.Items.Add(separator);
 
-            menuItem = new MenuItem();
             SetSelectTextOrImageMenuItem("文本", "Freetext", annotCommand, out menuItem);
             popMenu.Items.Add(menuItem);
 
-            menuItem = new MenuItem();
             SetSelectTextOrImageMenuItem("便签", "StickyNote", annotCommand, out menuItem);
             popMenu.Items.Add(menuItem);
 
-            menuItem = new MenuItem();
+            separator = SetSeparator();
+            popMenu.Items.Add(separator);
+
             SetSelectTextOrImageMenuItem("矩形", "Rect", annotCommand, out menuItem);
             popMenu.Items.Add(menuItem);
 
-            menuItem = new MenuItem();
+            SetSelectTextOrImageMenuItem("椭圆形", "Circle", annotCommand, out menuItem);
+            popMenu.Items.Add(menuItem);
+
+            SetSelectTextOrImageMenuItem("直线", "Line", annotCommand, out menuItem);
+            popMenu.Items.Add(menuItem);
+
+            separator = SetSeparator();
+            popMenu.Items.Add(separator);
+
             SetSelectTextOrImageMenuItem("添加链接", "Link", annotCommand, out menuItem);
             popMenu.Items.Add(menuItem);
 
-            //menuItem.CommandParameter = new object[] { this, annotCommand };
-            //menuItem.Command = viewContentViewModel.CreateLinkCommand;
-            //menuItem.Click -= AddLink_Click;
-            //menuItem.Click += AddLink_Click;
-            //popMenu.Items.Add(menuItem);
+            SetSelectTextOrImageMenuItem("添加大纲", "OutLine", annotCommand, out menuItem);
+            popMenu.Items.Add(menuItem);
+
             return popMenu;
         }
 
+        private void SetSelectTextOrImageMenuItem(string header, string tag, AnnotCommandArgs annotCommand, out MenuItem menuItem)
+        {
+            menuItem = new MenuItem();
+            menuItem.Header = header;
+            menuItem.Tag = tag;
+            menuItem.Click -= AnnotToolMenu_Click;
+            menuItem.Click += AnnotToolMenu_Click;
+            menuItem.CommandParameter = annotCommand;
+        }
+
+        private Separator SetSeparator()
+        {
+            Separator separator = new Separator
+            {
+                Height = 1,
+                BorderBrush = new SolidColorBrush((Color)ColorConverter.ConvertFromString("#33000000")),
+                BorderThickness = new Thickness(1),
+                Style = (Style)App.Current.FindResource(System.Windows.Controls.ToolBar.SeparatorStyleKey)
+            };
+            return separator;
+        }
+
         private void AnnotToolMenu_Click(object sender, RoutedEventArgs e)
         {
-            MenuItem clickMenu = sender as MenuItem;
-            if (clickMenu != null && clickMenu.CommandParameter is AnnotCommandArgs)
+            if (sender is MenuItem clickMenu && clickMenu.CommandParameter is AnnotCommandArgs)
             {
                 AnnotCommandArgs annotCommand = clickMenu.CommandParameter as AnnotCommandArgs;
-                //AnnotHandlerEventArgs annotHandlerEvent = null;
-                //FindAnnotTypeKey(clickMenu.Tag.ToString(), ref annotHandlerEvent, true);
 
                 switch (clickMenu.Tag.ToString())
                 {
-                    case "SnapshotEdit"://内容选择
-                        break;
-
                     case "HighLight"://字体高亮
                         TextHighlightAnnotArgs highlightArgs = (TextHighlightAnnotArgs)GetHighLight();
                         highlightArgs.ClientRect = annotCommand.TextRect;
                         highlightArgs.Content = annotCommand.Text;
-                        bool flag = PDFViewer.CreatePageAnnot(annotCommand.PageIndex, highlightArgs);
+                        highlightArgs.Author = Settings.Default.AppProperties.Description.Author;
+                        PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                        PDFViewer.SetToolParam(highlightArgs);
+                        PDFViewer.SetMouseMode(MouseModes.PanTool);
                         break;
 
                     case "UnderLine"://下划线
-
-                        break;
-
-                    case "Squiggly"://波浪线
+                        TextUnderlineAnnotArgs underlineArgs = (TextUnderlineAnnotArgs)GetUnderLine();
+                        underlineArgs.ClientRect = annotCommand.TextRect;
+                        underlineArgs.Content = annotCommand.Text;
+                        underlineArgs.Author = Settings.Default.AppProperties.Description.Author;
+                        PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                        PDFViewer.SetToolParam(underlineArgs);
+                        PDFViewer.SetMouseMode(MouseModes.PanTool);
                         break;
 
                     case "Strikeout"://删除线
-                        break;
-
-                    case "Freehand"://手绘
+                        TextStrikeoutAnnotArgs strikeoutArgs = (TextStrikeoutAnnotArgs)GetStrikeout();
+                        strikeoutArgs.ClientRect = annotCommand.TextRect;
+                        strikeoutArgs.Content = annotCommand.Text;
+                        strikeoutArgs.Author = Settings.Default.AppProperties.Description.Author;
+                        PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
+                        PDFViewer.SetToolParam(strikeoutArgs);
+                        PDFViewer.SetMouseMode(MouseModes.PanTool);
                         break;
 
                     case "Freetext"://文本
-                        FreeTextAnnotArgs textArgs = new FreeTextAnnotArgs();
+                        FreeTextAnnotArgs textArgs = (FreeTextAnnotArgs)GetFreetext();
                         textArgs.ClientRect = annotCommand.TextRect;
-                        textArgs.Transparency = 1;
-                        textArgs.BgColor = Colors.Transparent;
-                        textArgs.LineColor = Colors.Red;
-                        textArgs.LineWidth = 2;
-                        //textArgs.TextContent = annotCommand.Text;
+                        //textArgs.Transparency = 1;
+                        //textArgs.BgColor = Colors.Transparent;
+                        //textArgs.LineColor = Colors.Red;
+                        //textArgs.LineWidth = 2;
+                        textArgs.TextContent = annotCommand.Text;
+
                         PDFViewer.CreatePageAnnot(annotCommand.PageIndex, textArgs);
                         break;
 
                     case "StickyNote"://便签
                         StickyAnnotArgs stickyAnnotArgs = (StickyAnnotArgs)GetStickyNote();
-
-                        //stickyAnnotArgs.StickyNote = annotCommand.Text;
-                        //stickyAnnotArgs.Color = annotProperty.ForgoundColor;
-                        //stickyAnnotArgs.StickyNote = annotProperty.NoteText;
-                        //stickyAnnotArgs.Transparency = annotProperty.Opacity;
-
                         stickyAnnotArgs.ClientRect = annotCommand.TextRect;
                         PDFViewer.CreatePageAnnot(annotCommand.PageIndex, stickyAnnotArgs);
                         break;
@@ -1165,19 +1200,17 @@ namespace PDF_Office.ViewModels.Tools
                         break;
 
                     case "Circle"://圆
+                        CircleAnnotArgs circleAnnotArgs = (CircleAnnotArgs)GetCircle();
+                        circleAnnotArgs.ClientRect = annotCommand.TextRect;
+                        PDFViewer.CreatePageAnnot(annotCommand.PageIndex, circleAnnotArgs);
                         break;
 
-                    case "Arrow"://箭头
                     case "Line"://线
-                        break;
-
-                    case "Stamp"://图章
-                        break;
-
-                    case "Image":
-                        break;
-
-                    case "Signature"://签名
+                        LineAnnotArgs lineAnnotArgs = (LineAnnotArgs)GetArrowLine(clickMenu.Tag.ToString());
+                        lineAnnotArgs.ClientRect = annotCommand.TextRect;
+                        lineAnnotArgs.LinePoints.Add(new Point(annotCommand.TextRect.Left, annotCommand.TextRect.Top));
+                        lineAnnotArgs.LinePoints.Add(new Point(annotCommand.TextRect.Right, annotCommand.TextRect.Bottom));
+                        PDFViewer.CreatePageAnnot(annotCommand.PageIndex, lineAnnotArgs);
                         break;
 
                     case "Link"://链接
@@ -1193,18 +1226,122 @@ namespace PDF_Office.ViewModels.Tools
                         PDFViewer.SetToolParam(annotArgs);
                         viewContentViewModel.IsPropertyOpen = true;
                         break;
+
+                    case "OutLine":
+                        bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemOutLine");
+                        if (isTabItemAnnotation == false)
+                        {
+                            bOTAContent.TabItemOutLine.IsSelected = true;
+                        }
+                        OutLineControlViewModel outLineControlViewModel = GetOutLineControlViewModel(bOTAContentViewModel, out OutLineControl outLineControl);
+                        if (outLineControlViewModel != null && outLineControl != null)
+                        {
+                            string str = null;
+                            if (string.IsNullOrEmpty(annotCommand.Text))
+                            {
+                                str = (annotCommand.PageIndex + 1).ToString();
+                            }
+                            else
+                            {
+                                str = annotCommand.Text;
+                            }
+                            OutlineNode outline = outLineControl.AddOutlineNode(str);
+                            CPDFOutline result = outline.Outline;
+                            if (result != null)
+                            {
+                                outLineControlViewModel.SetTitle(result, str);
+                                outLineControlViewModel.Updata(false);
+
+                                //outLineControl.IsReName = true;
+                                //if (outLineControl.OutlineView.SelectedItem is OutlineNode selectOutLine)
+                                //{
+                                //    outLineControl.ReNameOutlineNode = outline;
+                                //}
+                            }
+                        }
+
+                        break;
+
+                    case "ExportPicture":
+                        ExportPicture_MenuItemClick();
+                        break;
                 }
+                //ShowPropertyPanel(false);
             }
         }
 
-        private void SetSelectTextOrImageMenuItem(string header, string tag, AnnotCommandArgs annotCommand, out MenuItem menuItem)
+        private void ExportPicture_MenuItemClick()
         {
-            menuItem = new MenuItem();
-            menuItem.Header = header;
-            menuItem.Tag = tag;
-            menuItem.Click -= AnnotToolMenu_Click;
-            menuItem.Click += AnnotToolMenu_Click;
-            menuItem.CommandParameter = annotCommand;
+            //图片提取
+
+            try
+            {
+                List<System.Drawing.Bitmap> imageList = new List<System.Drawing.Bitmap>();
+                Dictionary<int, List<System.Drawing.Bitmap>> imageDict = PDFViewer?.GetSelectedImages();
+                foreach (int pageIndex in imageDict.Keys)
+                {
+                    imageList = imageDict[pageIndex];
+                }
+                string path = PDFViewer.Document.FileName;
+                System.Windows.Forms.FolderBrowserDialog folderDialog = new FolderBrowserDialog();
+                if (folderDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+                {
+                    int i = 1;
+                    int pagenum = 1;
+                    string choosePath = folderDialog.SelectedPath;
+                    string sPath = choosePath + "\\" + path + "_Extract Image";
+                    sPath = GetExportPathName(sPath);
+
+                    if (!Directory.Exists(sPath))
+                    {
+                        Directory.CreateDirectory(sPath);
+                    }
+                    if (Directory.Exists(sPath))
+                    {
+                        foreach (System.Drawing.Bitmap image in imageList)
+                        {
+                            foreach (var item in imageDict.Keys)
+                            {
+                                pagenum = item;
+                            }
+                            string filename = path + "_" + "Page" + (pagenum + 1).ToString() + "_" + GetNum(i);
+                            string savePath = System.IO.Path.Combine(sPath, filename + ".jpg");
+                            image.Save(savePath, System.Drawing.Imaging.ImageFormat.Jpeg);
+                            i++;
+                        }
+                        System.Diagnostics.Process.Start("explorer", "/select,\"" + sPath + "\"");
+                    }
+                }
+            }
+            catch (Exception ex) { }
+        }
+
+        public string GetExportPathName(string path)
+        {
+            int i = 1;
+            string outpath = path;
+            while (Directory.Exists(outpath))
+            {
+                outpath = path + $"({i.ToString()})";
+                i++;
+            }
+            return outpath;
+        }
+
+        private string GetNum(int num)
+        {
+            if (num % 10 < 1)
+            {
+                return "00" + num.ToString();
+            }
+            if (num % 10 >= 1 && num % 10 < 10)
+            {
+                return "0" + num.ToString();
+            }
+            else
+            {
+                return num.ToString();
+            }
         }
 
         #endregion 菜单

+ 23 - 0
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -510,6 +510,29 @@ namespace PDF_Office.ViewModels.Tools
             return viewModel;
         }
 
+        private OutLineControlViewModel GetOutLineControlViewModel(BOTAContentViewModel bOTAContentViewModel, out OutLineControl outLineControl)
+        {
+            OutLineControlViewModel viewModel = null;
+            outLineControl = null;
+            if (bOTAContentViewModel != null)
+            {
+                if (region.Regions.ContainsRegionWithName(bOTAContentViewModel.BOTAContentRegionName))
+                {
+                    var views = region.Regions[bOTAContentViewModel.BOTAContentRegionName].Views;
+                    foreach (var item in views)
+                    {
+                        if (item is OutLineControl outLineControl1)
+                        {
+                            outLineControl = outLineControl1;
+                            viewModel = outLineControl1.DataContext as OutLineControlViewModel;
+                            break;
+                        }
+                    }
+                }
+            }
+            return viewModel;
+        }
+
         private void DisplayAnnot_Click(object sender, RoutedEventArgs e)
         {
             PDFViewer.SetDrawAnnot(true);

+ 4 - 4
PDF Office/ViewModels/Tools/TextEditToolContentViewModel.cs

@@ -230,14 +230,14 @@ namespace PDF_Office.ViewModels.Tools
         private ContextMenu EmptyStateMenu(object sender)
         {
             var popMenu = App.Current.FindResource("NoneMenu") as ContextMenu;
-            CustomPopMenu customMenu = new CustomPopMenu(popMenu);
+            CustomPopMenu customMenu = new CustomPopMenu(popMenu, sender);
 
             //粘贴
-            customMenu.SetMenuBinding(0, sender, ApplicationCommands.Paste);
+            customMenu.SetMenuBinding(0, ApplicationCommands.Paste);
             //添加文本
-            customMenu.SetMenuBinding(1, sender, AddTextCommand);
+            customMenu.SetMenuBinding(1, AddTextCommand);
             //添加图像
-            customMenu.SetMenuBinding(2, sender, AddImgCommand);
+            customMenu.SetMenuBinding(2, AddImgCommand);
 
             return popMenu;
         }

+ 202 - 76
PDF Office/Views/BOTA/OutLineControl.xaml

@@ -1,47 +1,66 @@
-<UserControl x:Class="PDF_Office.Views.BOTA.OutLineControl"
-             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.Views.BOTA"
-             xmlns:customcontrol="clr-namespace:PDF_Office.CustomControl"
-             xmlns:model="clr-namespace:PDF_Office.Model.BOTA"
-             xmlns:bota="clr-namespace:PDF_Office.ViewModels.BOTA" d:DataContext="{d:DesignInstance Type=bota:OutLineControlViewModel}"
-             mc:Ignorable="d" 
-             x:Name="ttt">
+<UserControl
+    x:Class="PDF_Office.Views.BOTA.OutLineControl"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:bota="clr-namespace:PDF_Office.ViewModels.BOTA"
+    xmlns:customcontrol="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.BOTA"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:model="clr-namespace:PDF_Office.Model.BOTA"
+    x:Name="ttt"
+    d:DataContext="{d:DesignInstance Type=bota:OutLineControlViewModel}"
+    mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/OutLineItemStyle.xaml"/>
+                <ResourceDictionary Source="pack://application:,,,/PDF Office;component/Styles/OutLineItemStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
         </ResourceDictionary>
     </UserControl.Resources>
-    <Grid  Background="Transparent">
+    <Grid Background="Transparent">
         <Grid.RowDefinitions>
-            <RowDefinition Height="40"/>
-            <RowDefinition/>
+            <RowDefinition Height="40" />
+            <RowDefinition />
         </Grid.RowDefinitions>
         <Grid x:Name="Header">
-            <TextBlock x:Name="TxtTitle" Margin="12,0,0,0" HorizontalAlignment="Left"
-                    VerticalAlignment="Center" FontSize="18" FontWeight="SemiBold" Text="Outline" />
-            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
+            <TextBlock
+                x:Name="TxtTitle"
+                Margin="12,0,0,0"
+                HorizontalAlignment="Left"
+                VerticalAlignment="Center"
+                FontSize="18"
+                FontWeight="SemiBold"
+                Text="Outline" />
+            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
                 <customcontrol:PathButton
-            x:Name="BtnAdd"
-            Click="BtnAdd_Click"
-            Height="24" Width="24"  IconHeight="20"  IconWidth="20" 
-            Icon="{StaticResource Ic_AddButtonPath}"  IconFill="#616469"
-            IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#616469"
-            IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#616469" />
+                    x:Name="BtnAdd"
+                    Width="24"
+                    Height="24"
+                    Click="BtnAdd_Click"
+                    Icon="{StaticResource Ic_AddButtonPath}"
+                    IconFill="#616469"
+                    IconHeight="20"
+                    IconMouseOver="{StaticResource Ic_AddButtonPath}"
+                    IconMouseOverFill="#616469"
+                    IconPress="{StaticResource Ic_AddButtonPath}"
+                    IconPressFill="#616469"
+                    IconWidth="20" />
                 <customcontrol:PathButton
-            x:Name="BtnMore"
-            Click="BtnMore_Click"
-            Height="24" Width="24"  IconHeight="20"  IconWidth="20" 
-            Icon="{StaticResource Ic_MoreButtonPath}"  IconFill="#616469"
-            IconPress="{StaticResource Ic_MoreButtonPath}" IconPressFill="#616469"
-            IconMouseOver="{StaticResource Ic_MoreButtonPath}" IconMouseOverFill="#616469" >
+                    x:Name="BtnMore"
+                    Width="24"
+                    Height="24"
+                    Click="BtnMore_Click"
+                    Icon="{StaticResource Ic_MoreButtonPath}"
+                    IconFill="#616469"
+                    IconHeight="20"
+                    IconMouseOver="{StaticResource Ic_MoreButtonPath}"
+                    IconMouseOverFill="#616469"
+                    IconPress="{StaticResource Ic_MoreButtonPath}"
+                    IconPressFill="#616469"
+                    IconWidth="20">
                     <customcontrol:PathButton.ContextMenu>
-                        <ContextMenu
-                            Name="MenuMore">
+                        <ContextMenu Name="MenuMore">
                             <ContextMenu.ItemContainerStyle>
                                 <Style TargetType="MenuItem">
                                     <Setter Property="Padding" Value="-25,7,-40,7" />
@@ -59,7 +78,7 @@
                                 Header="一键展开" />
                             <MenuItem
                                 Name="MenuCollapseAll"
-                               Command="{Binding CollapseAllCommand}"
+                                Command="{Binding CollapseAllCommand}"
                                 CommandParameter="{Binding Outlinelist}"
                                 Header="一键折叠" />
                         </ContextMenu>
@@ -68,81 +87,188 @@
             </StackPanel>
         </Grid>
 
-        <StackPanel Margin="10,0" x:Name="FirstOulineLine" Orientation="Horizontal"  VerticalAlignment="Bottom" Visibility="{Binding IsInsertHead,Converter={StaticResource BoolToVisible}}">
-            <Ellipse Width="8" Height="8" Fill="White" Stroke="#FF0078D7" StrokeThickness="1.5" HorizontalAlignment="Stretch" VerticalAlignment="Bottom"/>
-            <Rectangle Margin="-1,0,0,2" Width="{Binding ElementName=Header,Path=ActualWidth}" HorizontalAlignment="Stretch" Height="1.5" StrokeDashArray="2" VerticalAlignment="Bottom" Fill="#FF0078D7"/>
+        <StackPanel
+            x:Name="FirstOulineLine"
+            Margin="10,0"
+            VerticalAlignment="Bottom"
+            Orientation="Horizontal"
+            Visibility="{Binding IsInsertHead, Converter={StaticResource BoolToVisible}}">
+            <Ellipse
+                Width="8"
+                Height="8"
+                HorizontalAlignment="Stretch"
+                VerticalAlignment="Bottom"
+                Fill="White"
+                Stroke="#FF0078D7"
+                StrokeThickness="1.5" />
+            <Rectangle
+                Width="{Binding ElementName=Header, Path=ActualWidth}"
+                Height="1.5"
+                Margin="-1,0,0,2"
+                HorizontalAlignment="Stretch"
+                VerticalAlignment="Bottom"
+                Fill="#FF0078D7"
+                StrokeDashArray="2" />
         </StackPanel>
-        <Grid Grid.Row="1"
-               DragOver="Grid_DragOver"
-              DragLeave="Grid_DragLeave">
-            <StackPanel VerticalAlignment="Center" x:Name="NoOutlineStackPanel" Visibility="{Binding Outlinelist.Count, Converter={StaticResource ListCountToVisible}}">
+        <Grid
+            Grid.Row="1"
+            DragLeave="Grid_DragLeave"
+            DragOver="Grid_DragOver">
+            <StackPanel
+                x:Name="NoOutlineStackPanel"
+                VerticalAlignment="Center"
+                Visibility="{Binding Outlinelist.Count, Converter={StaticResource ListCountToVisible}}">
                 <Image Source="pack://application:,,,/PDF Office;component/Resources/BOTA/no_outline.png" />
-                <TextBlock Text="No outline found" FontSize="14" FontFamily="Segoe UI" Height="22" HorizontalAlignment="Center"/>
-                <TextBlock Text="Please right-click on the selected page and select Add Outline, or click the Add button on the upper right to create a outline." Width="168" FontSize="12" FontFamily="Segoe UI" TextWrapping="Wrap" Foreground="#94989C" HorizontalAlignment="Center"/>
+                <TextBlock
+                    Height="22"
+                    HorizontalAlignment="Center"
+                    FontFamily="Segoe UI"
+                    FontSize="14"
+                    Text="No outline found" />
+                <TextBlock
+                    Width="168"
+                    HorizontalAlignment="Center"
+                    FontFamily="Segoe UI"
+                    FontSize="12"
+                    Foreground="#94989C"
+                    Text="Please right-click on the selected page and select Add Outline, or click the Add button on the upper right to create a outline."
+                    TextWrapping="Wrap" />
             </StackPanel>
-            <TreeView x:Name="OutlineView" Grid.Row="1" ItemsSource="{Binding Outlinelist}"      
-                Visibility="{Binding ElementName=NoOutlineStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"
-                BorderThickness="0" AllowDrop="True"
-                VirtualizingPanel.ScrollUnit="Pixel"
+            <TreeView
+                x:Name="OutlineView"
+                Grid.Row="1"
+                AllowDrop="True"
+                BorderThickness="0"
                 Drop="OutlineView_Drop"
-                PreviewMouseMove="OutlineView_PreviewMouseMove" 
-                PreviewMouseLeftButtonUp="OutlineView_PreviewMouseLeftButtonUp"
+                ItemsSource="{Binding Outlinelist}"
                 PreviewMouseDoubleClick="OutlineView_PreviewMouseDoubleClick"
-                ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+                PreviewMouseLeftButtonUp="OutlineView_PreviewMouseLeftButtonUp"
+                PreviewMouseMove="OutlineView_PreviewMouseMove"
+                ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                VirtualizingPanel.ScrollUnit="Pixel"
+                Visibility="{Binding ElementName=NoOutlineStackPanel, Path=Visibility, Converter={StaticResource UnVisivleConvert}}">
                 <TreeView.ItemTemplate>
-                    <HierarchicalDataTemplate   DataType="{x:Type model:OutlineNode}" ItemsSource="{Binding Path=Chlidlist}">
+                    <HierarchicalDataTemplate DataType="{x:Type model:OutlineNode}" ItemsSource="{Binding Path=Chlidlist}">
                         <Grid>
                             <Grid.ContextMenu>
                                 <ContextMenu>
-                                    <MenuItem x:Name="AddMenu" Click="AddMenu_Click" Header="添加条目"/>
-                                    <MenuItem x:Name="AddChlidMenu" Click="AddChlidMenu_Click"  Header="添加子条目"/>
-                                    <MenuItem x:Name="AddParentMenu" Click="AddParentMenu_Click" Header="添加上一级条目" IsEnabled="{Binding CanAddParent}"/>
+                                    <MenuItem
+                                        x:Name="AddMenu"
+                                        Click="AddMenu_Click"
+                                        Header="添加条目" />
+                                    <MenuItem
+                                        x:Name="AddChlidMenu"
+                                        Click="AddChlidMenu_Click"
+                                        Header="添加子条目" />
+                                    <MenuItem
+                                        x:Name="AddParentMenu"
+                                        Click="AddParentMenu_Click"
+                                        Header="添加上一级条目"
+                                        IsEnabled="{Binding CanAddParent}" />
 
-                                    <MenuItem x:Name="DeleteMenu" Click="DeleteMenu_Click" Header="删除"/>
+                                    <MenuItem
+                                        x:Name="DeleteMenu"
+                                        Click="DeleteMenu_Click"
+                                        Header="删除" />
 
-                                    <MenuItem x:Name="RenameMenu" Click="RenameMenu_Click" Header="重命名"/>
-                                    <MenuItem x:Name="ChangeDestinationMenu" Click="ChangeDestinationMenu_Click" Header="更改目标位置"/>
+                                    <MenuItem
+                                        x:Name="RenameMenu"
+                                        Click="RenameMenu_Click"
+                                        Header="重命名" />
+                                    <MenuItem
+                                        x:Name="ChangeDestinationMenu"
+                                        Click="ChangeDestinationMenu_Click"
+                                        Header="更改目标位置" />
 
-                                    <MenuItem x:Name="UpgradeMenu" Click="UpgradeMenu_Click" Header="升级" IsEnabled="{Binding CanUp}"/>
-                                    <MenuItem x:Name="DowngradeMenu" Click="DowngradeMenu_Click" Header="降级" IsEnabled="{Binding CanDown}"/>
+                                    <MenuItem
+                                        x:Name="UpgradeMenu"
+                                        Click="UpgradeMenu_Click"
+                                        Header="升级"
+                                        IsEnabled="{Binding CanUp}" />
+                                    <MenuItem
+                                        x:Name="DowngradeMenu"
+                                        Click="DowngradeMenu_Click"
+                                        Header="降级"
+                                        IsEnabled="{Binding CanDown}" />
                                 </ContextMenu>
                             </Grid.ContextMenu>
-                            <Grid x:Name="ContentPanel" >
+                            <Grid x:Name="ContentPanel">
                                 <Grid.ToolTip>
-                                    <!--圆角 https://wpf.2000things.com/2012/05/11/556-clipping-to-a-border-using-an-opacity-mask -->
-                                    <ToolTip  Width="320" Height="120" Opened="ToolTip_Opened" Closed="ToolTip_Closed" Style="{StaticResource ErrorRoundedTooltip}">
-                                        <customcontrol:CustomImageControl Width="320" Height="120" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
+                                    <!--  圆角 https://wpf.2000things.com/2012/05/11/556-clipping-to-a-border-using-an-opacity-mask  -->
+                                    <ToolTip
+                                        Width="320"
+                                        Height="120"
+                                        Closed="ToolTip_Closed"
+                                        Opened="ToolTip_Opened"
+                                        Style="{StaticResource ErrorRoundedTooltip}">
+                                        <customcontrol:CustomImageControl
+                                            Width="320"
+                                            Height="120"
+                                            HorizontalAlignment="Stretch"
+                                            VerticalAlignment="Stretch" />
                                     </ToolTip>
                                 </Grid.ToolTip>
                                 <Grid.ColumnDefinitions>
                                     <ColumnDefinition />
                                     <ColumnDefinition Width="auto" />
                                 </Grid.ColumnDefinitions>
-                                <TextBlock x:Name="Content" Text="{Binding Outline.Title}" Visibility="{Binding IsReName,Mode=TwoWay}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
-                                <TextBlock x:Name="PageIndex" Grid.Column="1" HorizontalAlignment="Right"  VerticalAlignment="Center" Text="{Binding PageIndex}"/>
+                                <TextBlock
+                                    x:Name="Content"
+                                    VerticalAlignment="Center"
+                                    Text="{Binding Outline.Title}"
+                                    TextTrimming="CharacterEllipsis"
+                                    Visibility="{Binding IsReName, Mode=TwoWay}" />
+                                <TextBlock
+                                    x:Name="PageIndex"
+                                    Grid.Column="1"
+                                    HorizontalAlignment="Right"
+                                    VerticalAlignment="Center"
+                                    Text="{Binding PageIndex}" />
                             </Grid>
 
-                            <StackPanel  Orientation="Horizontal" HorizontalAlignment="Stretch" Visibility="{Binding IsInsertNextLayer, Converter={StaticResource BoolToVisible}}" >
-                                <Ellipse Margin="0,0,0,0" Width="8" Height="8" Fill="White" Stroke="#FF0078D7"  StrokeThickness="1.5" VerticalAlignment="Bottom"/>
-                                <Line Margin="-1,0,0,2" X1="0"  X2="{Binding ElementName=ContentPanel,Path=ActualWidth}" HorizontalAlignment="Stretch" StrokeThickness="1.5" StrokeDashArray="2" Stroke="#FF0078D7" VerticalAlignment="Bottom"/>
+                            <StackPanel
+                                HorizontalAlignment="Stretch"
+                                Orientation="Horizontal"
+                                Visibility="{Binding IsInsertNextLayer, Converter={StaticResource BoolToVisible}}">
+                                <Ellipse
+                                    Width="8"
+                                    Height="8"
+                                    Margin="0,0,0,0"
+                                    VerticalAlignment="Bottom"
+                                    Fill="White"
+                                    Stroke="#FF0078D7"
+                                    StrokeThickness="1.5" />
+                                <Line
+                                    Margin="-1,0,0,2"
+                                    HorizontalAlignment="Stretch"
+                                    VerticalAlignment="Bottom"
+                                    Stroke="#FF0078D7"
+                                    StrokeDashArray="2"
+                                    StrokeThickness="1.5"
+                                    X1="0"
+                                    X2="{Binding ElementName=ContentPanel, Path=ActualWidth}" />
                             </StackPanel>
-                            <Grid x:Name="RenameGrid"
-                                  LostFocus="RenameGrid_LostFocus"
-                                  Visibility="{Binding ElementName=Content,Path=Visibility,Mode=TwoWay,Converter={StaticResource UnVisivleConvert}}">
-                                <TextBox x:Name="ReName" HorizontalAlignment="Left" VerticalAlignment="Center"  
-                                         Style="{StaticResource TextBoxStyleRadius}"
-                                         IsVisibleChanged="ReName_IsVisibleChanged"/>
+                            <Grid
+                                x:Name="RenameGrid"
+                                LostFocus="RenameGrid_LostFocus"
+                                Visibility="{Binding ElementName=Content, Path=Visibility, Mode=TwoWay, Converter={StaticResource UnVisivleConvert}}">
+                                <TextBox
+                                    x:Name="ReName"
+                                    HorizontalAlignment="Left"
+                                    VerticalAlignment="Center"
+                                    IsVisibleChanged="ReName_IsVisibleChanged"
+                                    Style="{StaticResource TextBoxStyleRadius}" />
                             </Grid>
                         </Grid>
                     </HierarchicalDataTemplate>
                 </TreeView.ItemTemplate>
                 <TreeView.ItemContainerStyle>
                     <Style BasedOn="{StaticResource OutLineItemStyle}" TargetType="TreeViewItem">
-                        <EventSetter Event="PreviewMouseLeftButtonUp" Handler="TreeViewItem_PreviewMouseLeftButtonUp"/>
-                        <EventSetter Event="PreviewMouseLeftButtonDown" Handler="TreeViewItem_PreviewMouseLeftButtonDown"/>
+                        <EventSetter Event="PreviewMouseLeftButtonUp" Handler="TreeViewItem_PreviewMouseLeftButtonUp" />
+                        <EventSetter Event="PreviewMouseLeftButtonDown" Handler="TreeViewItem_PreviewMouseLeftButtonDown" />
                     </Style>
                 </TreeView.ItemContainerStyle>
             </TreeView>
         </Grid>
     </Grid>
-</UserControl>
+</UserControl>

+ 25 - 4
PDF Office/Views/BOTA/OutLineControl.xaml.cs

@@ -19,6 +19,8 @@ using System.Windows.Media;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
+using static Dropbox.Api.Files.WriteMode;
+using MenuItem = System.Windows.Controls.MenuItem;
 
 namespace PDF_Office.Views.BOTA
 {
@@ -31,19 +33,24 @@ namespace PDF_Office.Views.BOTA
         /// 当前显示了线段的Item
         /// </summary>
         private TreeViewItem Treeviewitem = null;
+
         /// <summary>
         /// 需要跳转页面的Item
         /// </summary>
         private TreeViewItem GotoPageItem = null;
+
         /// <summary>
         /// 需要重命名的Item的DataContext
         /// </summary>
-        private OutlineNode ReNameOutlineNode = null;
+        public OutlineNode ReNameOutlineNode = null;
+
         /// <summary>
         /// 正在拖拽
         /// </summary>
         private bool onDrop = false;
-        bool IsReName = false;
+
+        public bool IsReName = false;
+
         public OutLineControl()
         {
             InitializeComponent();
@@ -55,6 +62,7 @@ namespace PDF_Office.Views.BOTA
             MenuMore.PlacementTarget = BtnMore;
             MenuMore.IsOpen = true;
         }
+
         private void OutlineView_PreviewMouseMove(object sender, MouseEventArgs e)
         {
             if (e.LeftButton == MouseButtonState.Pressed && !IsReName)
@@ -340,12 +348,13 @@ namespace PDF_Office.Views.BOTA
                 }
             }
         }
+
         private void TreeViewItem_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
         {
             if (!onDrop)
             {
                 //因为点击按下事件是按照层级传递下来的,所以取到最后一次按下的对象进行跳转,以免跳转到父级
-                if (GotoPageItem!=null)
+                if (GotoPageItem != null)
                 {
                     (DataContext as OutLineControlViewModel).GoToPage(GotoPageItem);
                 }
@@ -399,13 +408,25 @@ namespace PDF_Office.Views.BOTA
         }
 
         private void BtnAdd_Click(object sender, RoutedEventArgs e)
+        {
+            AddOutlineNode();
+        }
+
+        public OutlineNode AddOutlineNode(string str = null)
         {
             int ItemIndex = (DataContext as OutLineControlViewModel).AddOutLine(OutlineView.SelectedItem as OutlineNode);
             OutlineView.UpdateLayout();
             OutlineNode node = (DataContext as OutLineControlViewModel).FindOutlineFromList((DataContext as OutLineControlViewModel).Outlinelist, OutlineView.SelectedItem as OutlineNode, ItemIndex);
+            //if (!string.IsNullOrEmpty(str))
+            //{
+            //    CPDFOutline result = node.Outline;
+            //    (DataContext as OutLineControlViewModel).SetTitle(result, str);
+            //    (DataContext as OutLineControlViewModel).Updata(false);
+            //}
             node.IsSelected = true;
             ReNameOutlineNode = node;
             node.IsReName = Visibility.Collapsed;
+            return node;
         }
 
         private void AddMenu_Click(object sender, RoutedEventArgs e)
@@ -447,4 +468,4 @@ namespace PDF_Office.Views.BOTA
             onDrop = false;
         }
     }
-}
+}

+ 11 - 9
PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml

@@ -10,19 +10,19 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
     xmlns:prism="http://prismlibrary.com/"
-    Width="529"
-    Height="416"
+    Width="468"
+    Height="454"
     d:DataContext="{d:DesignInstance Type=converterdialogs:ConverterCSVDialogViewModel}"
-    d:DesignHeight="416"
-    d:DesignWidth="529"
+    d:DesignHeight="454"
+    d:DesignWidth="468"
     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
     <cus:DialogContent Header="PDF转CSV">
         <cus:DialogContent.Content>
-            <Grid Grid.Row="1">
+            <Grid Grid.Row="1" >
                 <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="212" />
+                    <ColumnDefinition Width="212"/>
                     <ColumnDefinition Width="*" />
                 </Grid.ColumnDefinitions>
                 <Grid Grid.Column="0">
@@ -85,7 +85,7 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}">
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}"  Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
@@ -96,14 +96,16 @@
                     Margin="0,0,16,0"
                     HorizontalAlignment="Right"
                     Command="{Binding CancelCommand}"
-                    Content="取消" />
+                    Content="取消" 
+                     Style="{StaticResource btn.sec}"/>
                 <Button
                     Width="98"
                     Height="32"
                     Margin="124,0"
                     HorizontalAlignment="Right"
                     Command="{Binding ConverterCommnad}"
-                    Content="转换" />
+                    Content="转换" 
+                     Style="{StaticResource Btn.cta}"/>
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

+ 6 - 6
PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml

@@ -11,8 +11,8 @@
              Width="529"
              Height="482"
              d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
-             d:DesignHeight="482"
-             d:DesignWidth="529"
+             d:DesignHeight="498"
+             d:DesignWidth="586"
              prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d">
@@ -24,7 +24,7 @@
                     <ColumnDefinition Width="*"/>
                 </Grid.ColumnDefinitions>
                 <Grid Grid.Column="0">
-                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
+                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" VerticalAlignment="Top"></cus:PageTurningPreview>
                 </Grid>
                 <Grid Grid.Column="1">
                     <StackPanel Orientation="Vertical" Margin="18,16,0,0">
@@ -85,7 +85,7 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}">
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,400,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
@@ -96,14 +96,14 @@
                     Margin="0,0,16,0"
                     HorizontalAlignment="Right"
                     Content="取消" 
-                    Command="{Binding CancelCommand}"/>
+                    Command="{Binding CancelCommand}" Style="{StaticResource btn.sec}"/>
                 <Button
                     Width="98"
                     Height="32"
                     Margin="124,0"
                     HorizontalAlignment="Right"
                     Content="转换" 
-                    Command = "{Binding ConverterCommnad}"/>
+                    Command = "{Binding ConverterCommnad}" Style="{StaticResource Btn.cta}"/>
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

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

@@ -8,11 +8,11 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
              xmlns:prism="http://prismlibrary.com/"           
-             Width="480"
-             Height="416"
+             Width="468"
+    Height="454"
              d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
-             d:DesignHeight="416"
-             d:DesignWidth="480"
+             d:DesignHeight="454"
+             d:DesignWidth="468"
              prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d">
@@ -60,7 +60,7 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
@@ -71,14 +71,14 @@
                     Margin="0,0,16,0"
                     HorizontalAlignment="Right"
                     Content="取消" 
-                    Command="{Binding CancelCommand}"/>
+                    Command="{Binding CancelCommand}" Style="{StaticResource btn.sec}"/>
                 <Button
                     Width="98"
                     Height="32"
                     Margin="124,0"
                     HorizontalAlignment="Right"
                     Content="转换" 
-                    Command = "{Binding ConverterCommnad}"/>
+                    Command = "{Binding ConverterCommnad}" Style="{StaticResource Btn.cta}"/>
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

+ 8 - 7
PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml

@@ -10,11 +10,11 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
     xmlns:prism="http://prismlibrary.com/"
-    Width="480"
-    Height="416"
+    Width="468"
+             Height="454"
     d:DataContext="{d:DesignInstance Type=converterdialogs:ConverterImgDialogViewModel}"
-    d:DesignHeight="416"
-    d:DesignWidth="480"
+    d:DesignHeight="454"
+    d:DesignWidth="468"
     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
@@ -88,7 +88,7 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}"  Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
@@ -99,14 +99,15 @@
                     Margin="0,0,16,0"
                     HorizontalAlignment="Right"
                     Command="{Binding CancelCommand}"
-                    Content="取消" />
+                    Content="取消" Style="{StaticResource btn.sec}"/>
                 <Button
                     Width="98"
                     Height="32"
                     Margin="124,0"
                     HorizontalAlignment="Right"
                     Command="{Binding ConverterCommnad}"
-                    Content="转换" />
+                    Content="转换" 
+                    Style="{StaticResource Btn.cta}"/>
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

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

@@ -8,11 +8,11 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
              xmlns:prism="http://prismlibrary.com/"           
-             Width="480"
-             Height="416"
+            Width="468"
+    Height="454"
              d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
-             d:DesignHeight="416"
-             d:DesignWidth="480"
+             d:DesignHeight="454"
+             d:DesignWidth="468"
              prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d">
@@ -60,7 +60,7 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
@@ -71,14 +71,14 @@
                     Margin="0,0,16,0"
                     HorizontalAlignment="Right"
                     Content="取消" 
-                    Command="{Binding CancelCommand}"/>
+                    Command="{Binding CancelCommand}" Style="{StaticResource btn.sec}"/>
                 <Button
                     Width="98"
                     Height="32"
                     Margin="124,0"
                     HorizontalAlignment="Right"
                     Content="转换" 
-                    Command = "{Binding ConverterCommnad}"/>
+                    Command = "{Binding ConverterCommnad}" Style="{StaticResource Btn.cta}"/>
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

+ 40 - 10
PDF Office/Views/Dialog/ConverterDialogs/ConverterProgressBarDialog.xaml

@@ -4,16 +4,46 @@
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:prism="http://prismlibrary.com/"             
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             d:DesignHeight="40"
-             d:DesignWidth="220"
+            prism:ViewModelLocator.AutoWireViewModel="True"
+             prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+             d:DesignHeight="58"
+             d:DesignWidth="226"
+                Height="58"
+             Width="226"
              mc:Ignorable="d">
-    <Grid Height="40" Width="220">
-        <StackPanel>
-            <StackPanel Orientation="Horizontal" Margin="13,5,0,10">
-                <TextBlock Text="Converte  .  .  . "></TextBlock>
-            </StackPanel>
-            <ProgressBar Minimum="0" Maximum="{Binding PageNumber}" Value="{Binding PageIndex}"  Height="4" Width="194"/>
-        </StackPanel>
+    <Grid Height="58" Width="226">
+        <Border
+                    Width="226"
+                    Height="58"
+                    Background="{StaticResource color.sys.layout.dark.bg}"
+                    BorderThickness="0"
+                    CornerRadius="{StaticResource border-radius.8}"
+                    Effect="{StaticResource shadow.neutral.m}">
+            <Grid Margin="16,13" Background="Transparent">
+
+                <StackPanel Orientation="Horizontal" >
+                    <TextBlock Text="Converte  .  .  . "></TextBlock>
+                </StackPanel>
+                <Button
+                            Width="12"
+                            Height="12"
+                            HorizontalAlignment="Right"
+                            VerticalAlignment="Top"
+                            BorderThickness="0"
+                    Background="{StaticResource color.sys.layout.dark.bg}"
+                    Padding="0,0,1,1"
+                            Command="{Binding CloseCompressCommand}"
+                     >
+
+                    <Path Data="M6.00006 7.06066L9.46973 10.5303L10.5304 9.46967L7.06072 6L10.5304 2.53033L9.46973 1.46967L6.00006 4.93934L2.53039 1.46967L1.46973 2.53033L4.9394 6L1.46973 9.46967L2.53039 10.5303L6.00006 7.06066Z" Fill="#CED0D4"/>
+                </Button>
+                <ProgressBar Minimum="0" Maximum="{Binding PageNumber}" Value="{Binding PageIndex}" Height="4" Width="194"
+                         BorderThickness="0" 
+                            Margin="0,0,0,4" VerticalAlignment="Bottom" 
+                            Foreground="{StaticResource color.slider.track-filled.norm}"/>
+
+
+            </Grid>
+        </Border>
     </Grid>
 </UserControl>

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

@@ -8,11 +8,11 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
              xmlns:prism="http://prismlibrary.com/"           
-             Width="480"
-             Height="416"
+             Width="468"
+    Height="454"
              d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
-             d:DesignHeight="416"
-             d:DesignWidth="480"
+             d:DesignHeight="454"
+             d:DesignWidth="468"
              prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d">
@@ -60,7 +60,7 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
@@ -71,14 +71,14 @@
                     Margin="0,0,16,0"
                     HorizontalAlignment="Right"
                     Content="取消" 
-                    Command="{Binding CancelCommand}"/>
+                    Command="{Binding CancelCommand}" Style="{StaticResource btn.sec}"/>
                 <Button
                     Width="98"
                     Height="32"
                     Margin="124,0"
                     HorizontalAlignment="Right"
                     Content="转换" 
-                    Command = "{Binding ConverterCommnad}"/>
+                    Command = "{Binding ConverterCommnad}" Style="{StaticResource Btn.cta}"/>
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

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

@@ -8,11 +8,11 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
              xmlns:prism="http://prismlibrary.com/"           
-             Width="480"
-             Height="416"
+             Width="468"
+    Height="454"
              d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
-             d:DesignHeight="416"
-             d:DesignWidth="480"
+             d:DesignHeight="454"
+             d:DesignWidth="468"
              prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d">
@@ -60,7 +60,7 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
@@ -71,14 +71,14 @@
                     Margin="0,0,16,0"
                     HorizontalAlignment="Right"
                     Content="取消" 
-                    Command="{Binding CancelCommand}"/>
+                    Command="{Binding CancelCommand}" Style="{StaticResource btn.sec}"/>
                 <Button
                     Width="98"
                     Height="32"
                     Margin="124,0"
                     HorizontalAlignment="Right"
                     Content="转换" 
-                    Command = "{Binding ConverterCommnad}"/>
+                    Command = "{Binding ConverterCommnad}" Style="{StaticResource Btn.cta}"/>
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

+ 7 - 7
PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml

@@ -8,11 +8,11 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
              xmlns:prism="http://prismlibrary.com/"           
-             Width="480"
-             Height="416"
+             Width="468"
+             Height="454"
              d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
-             d:DesignHeight="416"
-             d:DesignWidth="480"
+             d:DesignHeight="454"
+             d:DesignWidth="468"
              prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
              prism:ViewModelLocator.AutoWireViewModel="True"
              mc:Ignorable="d">
@@ -73,7 +73,7 @@
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
-                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}">
+                <Button Background="WhiteSmoke" Width="98" Height="32" Margin="0,0,350,0" Command="{Binding BatchConverterCommand}" Style="{StaticResource btn.sec}">
                     <Border>
                         <TextBlock Text="批量处理" ></TextBlock>
                     </Border>
@@ -84,14 +84,14 @@
                     Margin="0,0,16,0"
                     HorizontalAlignment="Right"
                     Content="取消" 
-                    Command="{Binding CancelCommand}"/>
+                    Command="{Binding CancelCommand}" Style="{StaticResource btn.sec}"/>
                 <Button
                     Width="98"
                     Height="32"
                     Margin="124,0"
                     HorizontalAlignment="Right"
                     Content="转换" 
-                    Command = "{Binding ConverterCommnad}"/>
+                    Command = "{Binding ConverterCommnad}" Style="{StaticResource Btn.cta}"/>
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

+ 7 - 16
PDF Office/Views/Dialog/DynamicPropertyDialog.xaml

@@ -9,37 +9,28 @@
     xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
-    Width="500"
-    Height="300"
+    Width="432"
+    Height="162"
     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     d:DataContext="{d:DesignInstance Type={x:Type annotpanel:DynamicPropertyDialogViewModel}}"
     mc:Ignorable="d">
     <cus:DialogContent Header="动态图章">
         <cus:DialogContent.BottmBar>
-            <Grid>
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="50*" />
-                    <ColumnDefinition Width="50*" />
-                </Grid.ColumnDefinitions>
+            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                 <Button
-                    Grid.Column="0"
-                    Width="150"
+                    Width="80"
                     Height="32"
-                    Margin="25,0,0,0"
-                    HorizontalAlignment="Left"
                     Style="{StaticResource Btn.cta}"
                     Command="{Binding ApplyCommnad}"
                     Content="确定" />
                 <Button
-                    Grid.Column="1"
-                    Width="150"
+                    Width="80"
                     Height="32"
-                    Margin="0,0,25,0"
-                    HorizontalAlignment="Right"
+                    Margin="16,0"
                     Style="{StaticResource btn.sec}"
                     Command="{Binding CancelCommand}"
                     Content="取消" />
-            </Grid>
+            </StackPanel>
         </cus:DialogContent.BottmBar>
         <StackPanel
             Grid.Row="1"

+ 15 - 21
PDF Office/Views/Dialog/ToolsDialogs/CompressDialogs/CompressDialog.xaml

@@ -12,20 +12,20 @@
              mc:Ignorable="d">
     <cus:DialogContent Header="Compress">
         <cus:DialogContent.Content>
-            <Grid Grid.Row="1" Width="436">
+            <Grid Grid.Row="1" Width="436" Height="112">
                 <StackPanel>
-                    <RadioButton   Margin="0,10,0,8"  Command="{Binding LargeQualityCommand}" >
-                        <TextBlock Text="Large Fill Size"></TextBlock>
+                    <RadioButton   Margin="0,0,0,16"  Command="{Binding LargeQualityCommand}">
+                        <TextBlock Text="Large Fill Size" ></TextBlock>
                     </RadioButton>
 
-                    <RadioButton  Margin="0,0,0,8"  Command="{Binding StandardQualityCommand}">
-                        <TextBlock Text="Standard File Size"></TextBlock>
+                    <RadioButton  Margin="0,0,0,16"  Command="{Binding StandardQualityCommand}">
+                        <TextBlock Text="Standard File Size" ></TextBlock>
                     </RadioButton>
-                    <RadioButton  Margin="0,0,0,8"  Command="{Binding LittleQualityCommand}" IsChecked="True">
-                        <TextBlock Text="Small File Size"></TextBlock>
+                    <RadioButton  Margin="0,0,0,16"  Command="{Binding LittleQualityCommand}"  IsChecked="True" >
+                        <TextBlock Text="Small File Size" ></TextBlock>
                     </RadioButton>
-                    <RadioButton  Margin="0,0,0,0"  Command="{Binding MicroQualityCommand}">
-                        <TextBlock Text="Minimum File Size"></TextBlock>
+                    <RadioButton  Margin="0,0,0,0"  Command="{Binding MicroQualityCommand}" >
+                        <TextBlock Text="Minimum File Size" ></TextBlock>
                     </RadioButton>
                 </StackPanel>
             </Grid>
@@ -33,22 +33,16 @@
         <cus:DialogContent.BottmBar>
         <Grid Grid.Row="2" Width="468"  VerticalAlignment="Center">
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
-                <Button Background="WhiteSmoke" Width="100" Height="25" Margin="10,0,0,0" Command="{Binding BatchCompressCommand}">
-                    <Border>
-                        <TextBlock Text="批量处理" ></TextBlock>
-                    </Border>
+                    <Button Width="80" Height="32" Margin="16,0,0,0" Command="{Binding BatchCompressCommand}"  Style="{StaticResource btn.sec}" Content="Batch">
+                   
                 </Button>
             </StackPanel>
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
-                <Button Background="WhiteSmoke" Width="100" Height="25" Margin="0,0,10,0" Command="{Binding CompressCommand}">
-                    <Border>
-                        <TextBlock Text="压缩"></TextBlock>
-                    </Border>
+                    <Button  Width="80" Height="32" Margin="0,0,16,0" Command="{Binding CompressCommand}" Style="{StaticResource Btn.cta}" Content="Compress" >
+                   
                 </Button>
-                <Button Background="WhiteSmoke" Width="100" Height="25" Margin="0,0,10,0" Command="{Binding ConfirmCompressCommand}">
-                    <Border>
-                        <TextBlock Text="取消" ></TextBlock>
-                    </Border>
+                    <Button  Width="80" Height="32" Margin="0,0,16,0" Command="{Binding ConfirmCompressCommand}"  Style="{StaticResource btn.sec}" Content="取消">
+                   
                 </Button>
             </StackPanel>
         </Grid>

+ 45 - 14
PDF Office/Views/Dialog/ToolsDialogs/CompressDialogs/CompressProgressBarDialog.xaml

@@ -5,21 +5,52 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:prism="http://prismlibrary.com/"             
              prism:ViewModelLocator.AutoWireViewModel="True"
-             d:DesignHeight="40"
-             d:DesignWidth="220"
-             mc:Ignorable="d">
-    <Grid Height="40" Width="220">
-        <StackPanel>
-            <StackPanel Orientation="Horizontal" Margin="13,5,0,10">
-                <TextBlock Text="Compress  "></TextBlock>
-                <TextBlock Text="("></TextBlock>
-                <TextBlock Text="{Binding PageIndex}"></TextBlock>
-                <TextBlock Text="/"></TextBlock>
-                <TextBlock Text="{Binding PageNumber}"></TextBlock>
-                <TextBlock Text=")"></TextBlock>
+             prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+             d:DesignHeight="58"
+             d:DesignWidth="226"
+                Height="58"
+             Width="226"
+             mc:Ignorable="d"
+             >
+
+    <Grid Height="58" Width="226">
+        <Border
+                    Width="226"
+                    Height="58"
+                    Background="{StaticResource color.sys.layout.dark.bg}"
+                    BorderThickness="0"
+                    CornerRadius="{StaticResource border-radius.8}"
+                    Effect="{StaticResource shadow.neutral.m}">
+    <Grid Margin="16,13" Background="Transparent">
+
+        <StackPanel Orientation="Horizontal">
+            <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="Compress  "></TextBlock>
+            <TextBlock Text="("></TextBlock>
+            <TextBlock Text="{Binding PageIndex}"></TextBlock>
+            <TextBlock Text="/"></TextBlock>
+            <TextBlock Text="{Binding PageNumber}"></TextBlock>
+            <TextBlock Text=")"></TextBlock>
 
-            </StackPanel>
-            <ProgressBar Minimum="0" Maximum="{Binding PageNumber}" Value="{Binding PageIndex}"  Height="4" Width="194"/>
         </StackPanel>
+                <Button
+                            Width="12"
+                            Height="12"
+                            HorizontalAlignment="Right"
+                            VerticalAlignment="Top"
+                            BorderThickness="0"
+                    Background="{StaticResource color.sys.layout.dark.bg}"
+                    Padding="0,0,1,1"
+                            Command="{Binding CloseCompressCommand}"
+                     >
+
+                    <Path Data="M6.00006 7.06066L9.46973 10.5303L10.5304 9.46967L7.06072 6L10.5304 2.53033L9.46973 1.46967L6.00006 4.93934L2.53039 1.46967L1.46973 2.53033L4.9394 6L1.46973 9.46967L2.53039 10.5303L6.00006 7.06066Z" Fill="#CED0D4"/>
+                </Button>
+                <ProgressBar Minimum="0" Maximum="{Binding PageNumber}" Value="{Binding PageIndex}"  Height="4" Width="194"
+                         BorderThickness="0" 
+                            Margin="0,0,0,4" VerticalAlignment="Bottom"
+                            Foreground="{StaticResource color.slider.track-filled.norm}"/>
+
+    </Grid>
+    </Border>
     </Grid>
 </UserControl>

+ 3 - 1
PDF Office/Views/Dialog/ToolsDialogs/CompressDialogs/CompressProgressBarDialog.xaml.cs

@@ -10,6 +10,8 @@ namespace PDF_Office.Views.Dialog.ToolsDialogs.CompressDialogs
         public CompressProgressBarDialog()
         {
             InitializeComponent();
-        }
+        }
+
+       
     }
 }

+ 31 - 1
PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml.cs

@@ -21,13 +21,43 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
     /// </summary>
     public partial class FreehandAnnotProperty : UserControl
     {
+        private FreehandAnnotPropertyViewModel ViewModel => DataContext as FreehandAnnotPropertyViewModel;
         public FreehandAnnotProperty()
         {
             InitializeComponent();
+            this.Loaded += usercontrol_Loaded;
+            this.Unloaded += usercontrol_Unloaded;
+        }
+
+        private void usercontrol_Unloaded(object sender, RoutedEventArgs e)
+        {
+            if (ViewModel != null)
+            {
+                ViewModel.LoadPropertyHandler -= ViewModel_LoadPropertyHandler;
+            }
+            cusColor.SelectedColorHandler -= cusColor_SelectedColor;
+        }
+
+        private void usercontrol_Loaded(object sender, RoutedEventArgs e)
+        {
+            if (ViewModel != null)
+            {
+                ViewModel.LoadPropertyHandler -= ViewModel_LoadPropertyHandler;
+                ViewModel.LoadPropertyHandler += ViewModel_LoadPropertyHandler;
+            }
             cusColor.SelectedColorHandler += cusColor_SelectedColor;
-           // layerThick.SelectedValueChanged += layerThick_SelectedValue;
         }
 
+        private void ViewModel_LoadPropertyHandler(object sender, object e)
+        {
+            if(e != null && e is Color == true)
+            {
+                var color = (Color)e;
+                cusColor.SelectedColor = color;
+            }
+            
+
+        }
         private void layerThick_SelectedValue(object sender, double e)
         {
             var data = this.DataContext as FreehandAnnotPropertyViewModel;

+ 23 - 34
PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml

@@ -11,7 +11,7 @@
              prism:ViewModelLocator.AutoWireViewModel="True"
              xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
-             mc:Ignorable="d" 
+             mc:Ignorable="d"
              d:DesignHeight="850" d:DesignWidth="800">
     <UserControl.Resources>
         <ResourceDictionary>
@@ -41,20 +41,6 @@
                     </Setter.Value>
                 </Setter>
             </Style>
-            
-            <ContextMenu x:Key="BtnFlyoutMenu" FontSize="14"
-                        >
-                <ContextMenu.ItemContainerStyle>
-                    <Style TargetType="MenuItem">
-                        <Setter Property="Padding" Value="0,7,0,7"/>
-                        <Setter Property="VerticalContentAlignment" Value="Center"/>
-                    </Style>
-                </ContextMenu.ItemContainerStyle>
-                <MenuItem Name="ChangeStyleMenuItem"  Header="用所选部分重新定义" IsEnabled="True">
-                </MenuItem>
-                <MenuItem Name="BackStyleMenuItem"  Header="恢复默认预设样式" IsEnabled="True">
-                </MenuItem>
-            </ContextMenu>
 
             <DataTemplate x:Key="FontStyleData">
                 <Grid >
@@ -73,10 +59,10 @@
                             Background="{Binding FillColor}">
                         <TextBlock Name="SampleText"
                                    Foreground="{Binding SelectColor}" 
-                                   FontFamily="{Binding TextFontFamily}"
-                                   FontWeight="{Binding TextFontWeights}" 
-                                   FontStyle="{Binding TextFontStyle}"
-                                   FontSize="{Binding TextFontSize}" Opacity="{Binding FillOpacity}"
+                                   FontFamily="{Binding  CurrentFontFamily.ValueStr}"
+                                   FontWeight="{Binding FontWeightItem}" 
+                                   FontStyle="{Binding FontStyleItem}"
+                                   FontSize="{Binding CurrentFontSize.Value}" Opacity="{Binding FillOpacity}"
                                    Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center">
                         </TextBlock>
                     </Border>
@@ -99,25 +85,28 @@
 
             <Border
                     Height="32"
-                    Margin="0,8,0,18"
+                    Margin="15,8,15,18"
                     BorderBrush="#E2E3E6"
                     BorderThickness="0">
                 <Grid>
+                    <Grid.ColumnDefinitions>
+                        <ColumnDefinition/>
+                        <ColumnDefinition Width="auto"/>
+                    </Grid.ColumnDefinitions>
                     <CompositeControl:CustomComboControl
                             x:Name="FontTitleBox"
                             Width="188"
                             Height="32"
                             HorizontalAlignment="Left"
                             IsValueContent="True"
-                            ItemSource="{Binding PresetTextItems}"
-                            SelectedItems="{Binding PresetTextData, Mode=TwoWay}" />
+                            ItemSource="{Binding PresetFontItems}"
+                            SelectedItems="{Binding CurrentPresetFont, Mode=TwoWay}" />
 
 
-                    <Button
+                    <Button Grid.Column="1"
                             Width="32"
                             Height="32"
-                            HorizontalAlignment="Right"
-                            ContextMenu="{StaticResource BtnFlyoutMenu}"
+                            HorizontalAlignment="Left" Command="{Binding CustomFontStyleCommand}"
                             Style="{StaticResource btn.sec}">
                         <Path
                                 Width="16"
@@ -128,10 +117,7 @@
                 </Grid>
             </Border>
 
-
-            <TextBlock x:Name="FontText"  FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,18,0,0" >Font</TextBlock>
-
-            <StackPanel>
+            <StackPanel Margin="15,0,15,0">
                 <TextBlock
                         Margin="0,0,0,10"
                         Style="{StaticResource PropertyHeaderLv2}"
@@ -143,7 +129,8 @@
                             Height="32"
                             IsValueContent="True"
                             ItemSource="{Binding FontFamilyItems}"
-                            SelectedItems="{Binding FontFamilyData, Mode=TwoWay}" />
+                            IsSelectedEmpty ="{Binding IsSelectedEmpty}"
+                            SelectedItems="{Binding CurrentFontFamily, Mode=TwoWay}" />
 
                     <Grid Margin="0,8">
                         <CompositeControl:CustomComboControl
@@ -153,7 +140,8 @@
                                 HorizontalAlignment="Left"
                                 IsValueContent="True"
                                 ItemSource="{Binding FontStyleItems}"
-                                SelectedItems="{Binding FontWeightStyleItem, Mode=TwoWay}" />
+                                IsSelectedEmpty ="{Binding IsSelectedEmpty}"
+                                SelectedItems="{Binding CurrrentFontWeightStyle, Mode=TwoWay}" />
 
 
                         <CompositeControl:CustomComboControl
@@ -161,7 +149,8 @@
                                 Width="110"
                                 Height="32"
                                 HorizontalAlignment="Right"
-                                SelectedItems="{Binding FontSizeData, Mode=TwoWay}" />
+                                IsSelectedEmpty ="{Binding IsSelectedEmpty}"
+                                SelectedItems="{Binding CurrentFontSize, Mode=TwoWay}" />
                     </Grid>
                     <Grid>
                         <StackPanel Orientation="Horizontal">
@@ -370,7 +359,7 @@
                     </Grid>
                 </StackPanel>
             </StackPanel>
-            <Grid Margin="0,18,0,0">
+            <Grid Margin="15,18,15,0">
                 <Grid.RowDefinitions>
                     <RowDefinition Height="auto"/>
                     <RowDefinition/>
@@ -386,7 +375,7 @@
             </Grid>
 
 
-<!--MVP-->
+<!--MVP不上-->
 
             <TextBlock x:Name="thicknessText" Visibility="Collapsed" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
 

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

@@ -30,10 +30,10 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             //FontFamilyBox.SelectionChanged += FontFamilyBox_SelectionChanged;
             //FontStyleBox.SelectionChanged += FontStyleBox_SelectionChanged;
             //FontSizeBox.SelectionChanged += FontSizeBox_SelectionChanged;
-            ThicknessBox.SelectionChanged += ThicknessBox_SelectionChanged; 
+           
             this.Loaded += usercontrol_Loaded;
-            cusColor.SelectedColorHandler += cusColor_SelectedColorHandler;
-           // layerThick.SelectedValueChanged += layerThick_SelectedValue;
+            this.Unloaded += usercontrol_Unloaded;
+            // layerThick.SelectedValueChanged += layerThick_SelectedValue;
         }
 
         private void usercontrol_Loaded(object sender, RoutedEventArgs e)
@@ -42,6 +42,27 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             FontStyleBox.SelectedIndex = 0;
             FontSizeBox.SelectedIndex = 0;
             ThicknessBox.SelectedIndex = 0;
+            BindingEvent();
+        }
+
+        private void usercontrol_Unloaded(object sender, RoutedEventArgs e)
+        {
+            UnBindingEvent();
+        }
+
+        private void BindingEvent()
+        {
+            UnBindingEvent();
+            ThicknessBox.SelectionChanged += ThicknessBox_SelectionChanged;
+            cusColor.SelectedColorHandler += cusColor_SelectedColorHandler;
+            FontColorBox.SelectedColorHandler += FontColorBox_SelectedColorHandler;
+        }
+
+        private void UnBindingEvent()
+        {
+            ThicknessBox.SelectionChanged -= ThicknessBox_SelectionChanged;
+            cusColor.SelectedColorHandler -= cusColor_SelectedColorHandler;
+            FontColorBox.SelectedColorHandler -= FontColorBox_SelectedColorHandler;
         }
 
         private void ThicknessBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
@@ -128,14 +149,21 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
 
         private void FontColorBox_SelectedColorChanged(object sender, Color? e)
         {
-            var data = this.DataContext as FreetextAnnotPropertyViewModel;
-            data.SelectedColorCommand?.Execute(e);
+           
         }
 
         private void cusColor_SelectedColorHandler(object sender, Color e)
         {
-            var data = this.DataContext as FreetextAnnotPropertyViewModel; 
-            data.SelectedFillColorCommand?.Execute(e);
+            var data = this.DataContext as FreetextAnnotPropertyViewModel;
+            if (data != null)
+                data.SelectedFillColorCommand?.Execute(e);
+        }
+
+        private void FontColorBox_SelectedColorHandler(object sender, Color e)
+        {
+            var data = this.DataContext as FreetextAnnotPropertyViewModel;
+            if (data != null)
+                data.SelectedColorCommand?.Execute(e);
         }
 
 

+ 15 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/MultiSelectAnnotProperty.xaml

@@ -0,0 +1,15 @@
+<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.MultiSelectAnnotProperty"
+             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:prism="http://prismlibrary.com/"
+             xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+             mc:Ignorable="d" 
+             d:DesignHeight="450" d:DesignWidth="800">
+    <Grid>
+        <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"/>
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/MultiSelectAnnotProperty.xaml.cs

@@ -0,0 +1,28 @@
+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.Views.PropertyPanel.AnnotPanel
+{
+    /// <summary>
+    /// MultiSelectAnnotProperty.xaml 的交互逻辑
+    /// </summary>
+    public partial class MultiSelectAnnotProperty : UserControl
+    {
+        public MultiSelectAnnotProperty()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 149 - 31
PDF Office/Views/PropertyPanel/AnnotPanel/StampAnnotProperty.xaml

@@ -25,6 +25,12 @@
             <Setter Property="BorderThickness" Value="0" />
             <Setter Property="Template" Value="{StaticResource Segmented}" />
         </Style>
+        <SolidColorBrush x:Key="Item.MouseOver.Background" Color="#1F26A0DA"/>
+        <SolidColorBrush x:Key="Item.MouseOver.Border" Color="#a826A0Da"/>
+        <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3DDADADA"/>
+        <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FFDADADA"/>
+        <SolidColorBrush x:Key="Item.SelectedActive.Background" Color="#3D26A0DA"/>
+        <SolidColorBrush x:Key="Item.SelectedActive.Border" Color="#FF26A0DA"/>
     </UserControl.Resources>
     <Grid>
         <Grid.RowDefinitions>
@@ -57,32 +63,70 @@
                         HorizontalContentAlignment="Center"
                         FontSize="12"
                         IsSelected="True">
-                <ListBox ItemsSource="{Binding StandardStampList}" SelectionMode="Single"  Height="auto" VerticalAlignment="Top"  BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
-                    <ListBox.ItemTemplate>
-                        <DataTemplate >
-                            <Grid >
-                                <Grid.ContextMenu>
-                                    <ContextMenu>
-                                        <MenuItem Header="导出图章">
-                                            <MenuItem x:Name="SavePNG" Header="PNG" Tag="PNG" Click="Save_Click"/>
-                                            <MenuItem x:Name="SavePDF" Header="PDF" Tag="PDF" Click="Save_Click"/>
-                                        </MenuItem>
-                                    </ContextMenu>
-                                </Grid.ContextMenu>
-                                <Image Source="{Binding SourcePath}" Stretch="Uniform" Height="48"/>
-                            </Grid>
-                        </DataTemplate>
-                    </ListBox.ItemTemplate>
-                    <ListBox.ItemContainerStyle>
-                        <Style TargetType="ListBoxItem">
-                            <Setter Property="Height" Value="64"/>
-                            <!--<Setter Property="Padding" Value="12 5 12 5"/>-->
-                            <Setter Property="HorizontalContentAlignment" Value="Center"/>
-                            <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
-                        </Style>
-                    </ListBox.ItemContainerStyle>
-                </ListBox>
-
+                <Grid>
+                    <ListBox  ItemsSource="{Binding StandardStampList}" SelectionMode="Single"  Height="auto" VerticalAlignment="Top"  BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
+                        <ListBox.ItemTemplate>
+                            <DataTemplate >
+                                <Grid >
+                                    <Grid.ContextMenu>
+                                        <ContextMenu>
+                                            <MenuItem Header="导出图章">
+                                                <MenuItem x:Name="SavePNG" Header="PNG" Tag="PNG" Click="Save_Click"/>
+                                                <MenuItem x:Name="SavePDF" Header="PDF" Tag="PDF" Click="Save_Click"/>
+                                            </MenuItem>
+                                        </ContextMenu>
+                                    </Grid.ContextMenu>
+                                    <Image Source="{Binding SourcePath}" Stretch="Uniform" Height="40"/>
+                                </Grid>
+                            </DataTemplate>
+                        </ListBox.ItemTemplate>
+                        <ListBox.ItemContainerStyle>
+                            <Style TargetType="ListBoxItem">
+                                <Setter Property="Height" Value="65"/>
+                                <Setter Property="Padding" Value="8"/>
+                                <Setter Property="HorizontalContentAlignment" Value="Center"/>
+                                <Setter Property="Template">
+                                    <Setter.Value>
+                                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
+                                            <Border x:Name="Bd" CornerRadius="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
+                                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                                            </Border>
+                                            <ControlTemplate.Triggers>
+                                                <MultiTrigger>
+                                                    <MultiTrigger.Conditions>
+                                                        <Condition Property="IsMouseOver" Value="True"/>
+                                                    </MultiTrigger.Conditions>
+                                                    <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                                                    <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                                                </MultiTrigger>
+                                                <MultiTrigger>
+                                                    <MultiTrigger.Conditions>
+                                                        <Condition Property="Selector.IsSelectionActive" Value="False"/>
+                                                        <Condition Property="IsSelected" Value="True"/>
+                                                    </MultiTrigger.Conditions>
+                                                    <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}"/>
+                                                    <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}"/>
+                                                </MultiTrigger>
+                                                <MultiTrigger>
+                                                    <MultiTrigger.Conditions>
+                                                        <Condition Property="Selector.IsSelectionActive" Value="True"/>
+                                                        <Condition Property="IsSelected" Value="True"/>
+                                                    </MultiTrigger.Conditions>
+                                                    <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.sel.bg.lv3}"/>
+                                                    <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.sel.border.lv3}"/>
+                                                </MultiTrigger>
+                                                <Trigger Property="IsEnabled" Value="False">
+                                                    <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </Setter.Value>
+                                </Setter>
+                                <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
+                            </Style>
+                        </ListBox.ItemContainerStyle>
+                    </ListBox>
+                </Grid>
             </TabItem>
             <TabItem  x:Name="TabDydamic"
                         Header="Dynamic"
@@ -100,9 +144,46 @@
                     </ListBox.ItemTemplate>
                     <ListBox.ItemContainerStyle>
                         <Style TargetType="ListBoxItem">
-                            <Setter Property="Height" Value="64"/>
-                            <Setter Property="Padding" Value="12 5 12 5"/>
+                            <Setter Property="Height" Value="65"/>
+                            <Setter Property="Padding" Value="8"/>
                             <Setter Property="HorizontalContentAlignment" Value="Center"/>
+                            <Setter Property="Template">
+                                <Setter.Value>
+                                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
+                                        <Border x:Name="Bd" CornerRadius="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
+                                            <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                                        </Border>
+                                        <ControlTemplate.Triggers>
+                                            <MultiTrigger>
+                                                <MultiTrigger.Conditions>
+                                                    <Condition Property="IsMouseOver" Value="True"/>
+                                                </MultiTrigger.Conditions>
+                                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                                            </MultiTrigger>
+                                            <MultiTrigger>
+                                                <MultiTrigger.Conditions>
+                                                    <Condition Property="Selector.IsSelectionActive" Value="False"/>
+                                                    <Condition Property="IsSelected" Value="True"/>
+                                                </MultiTrigger.Conditions>
+                                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}"/>
+                                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}"/>
+                                            </MultiTrigger>
+                                            <MultiTrigger>
+                                                <MultiTrigger.Conditions>
+                                                    <Condition Property="Selector.IsSelectionActive" Value="True"/>
+                                                    <Condition Property="IsSelected" Value="True"/>
+                                                </MultiTrigger.Conditions>
+                                                <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.sel.bg.lv3}"/>
+                                                <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.sel.border.lv3}"/>
+                                            </MultiTrigger>
+                                            <Trigger Property="IsEnabled" Value="False">
+                                                <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
+                                            </Trigger>
+                                        </ControlTemplate.Triggers>
+                                    </ControlTemplate>
+                                </Setter.Value>
+                            </Setter>
                             <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
                         </Style>
                     </ListBox.ItemContainerStyle>
@@ -149,7 +230,7 @@
                                     </Grid.ContextMenu>
                                     <StackPanel Orientation="Horizontal">
                                         <Image Source="{Binding SourcePath}"/>
-                                        <Button x:Name="DeleteIcon" Width="20" Height="20" Click="Delete_Click" Visibility="Collapsed"/>
+                                        <Button HorizontalAlignment="Right" VerticalAlignment="Top" x:Name="DeleteIcon" Width="20" Height="20" Click="Delete_Click" Visibility="Hidden"/>
                                     </StackPanel>
                                 </Grid>
                                 <HierarchicalDataTemplate.Triggers>
@@ -163,8 +244,45 @@
 
                         <ListBox.ItemContainerStyle>
                             <Style TargetType="ListBoxItem">
-                                <Setter Property="Height" Value="64"/>
-                                <!--<Setter Property="Padding" Value="12 5 12 5"/>-->
+                                <Setter Property="Height" Value="65"/>
+                                <Setter Property="Padding" Value="8"/>
+                                <Setter Property="Template">
+                                    <Setter.Value>
+                                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
+                                            <Border x:Name="Bd" CornerRadius="8" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
+                                                <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+                                            </Border>
+                                            <ControlTemplate.Triggers>
+                                                <MultiTrigger>
+                                                    <MultiTrigger.Conditions>
+                                                        <Condition Property="IsMouseOver" Value="True"/>
+                                                    </MultiTrigger.Conditions>
+                                                    <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                                                    <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.hov.bg}"/>
+                                                </MultiTrigger>
+                                                <MultiTrigger>
+                                                    <MultiTrigger.Conditions>
+                                                        <Condition Property="Selector.IsSelectionActive" Value="False"/>
+                                                        <Condition Property="IsSelected" Value="True"/>
+                                                    </MultiTrigger.Conditions>
+                                                    <Setter Property="Background" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Background}"/>
+                                                    <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource Item.SelectedInactive.Border}"/>
+                                                </MultiTrigger>
+                                                <MultiTrigger>
+                                                    <MultiTrigger.Conditions>
+                                                        <Condition Property="Selector.IsSelectionActive" Value="True"/>
+                                                        <Condition Property="IsSelected" Value="True"/>
+                                                    </MultiTrigger.Conditions>
+                                                    <Setter Property="Background" TargetName="Bd" Value="{StaticResource color.item-state.sel.bg.lv3}"/>
+                                                    <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource color.item-state.sel.border.lv3}"/>
+                                                </MultiTrigger>
+                                                <Trigger Property="IsEnabled" Value="False">
+                                                    <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
+                                                </Trigger>
+                                            </ControlTemplate.Triggers>
+                                        </ControlTemplate>
+                                    </Setter.Value>
+                                </Setter>
                                 <Setter Property="HorizontalContentAlignment" Value="Center"/>
                                 <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
                             </Style>

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

@@ -34,7 +34,7 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             ListBox listBox = CommonHelper.FindVisualParent<ListBox>(sender as ListBoxItem);
             if (listBox != null)
             {
-                if (listBox.Tag.ToString() == "Dynamic")
+                if (listBox.Tag!=null&&listBox.Tag.ToString() == "Dynamic")
                 {
                     (DataContext as StampAnnotPropertyViewModel).SetDynamicStamp((sender as ListBoxItem).DataContext as Stamp);
                     return;

+ 7 - 7
PDF Office/Views/PropertyPanel/PDFEdit/TextEditProperty.xaml

@@ -75,8 +75,8 @@
                                 Name="SampleText"
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Center"
-                                FontFamily="{Binding FontFamilyData.ValueStr}"
-                                FontSize="{Binding FontSizeData.Value}"
+                                FontFamily="{Binding CurrentFontFamily.ValueStr}"
+                                FontSize="{Binding CurrentFontSize.Value}"
                                 FontStyle="{Binding FontStyleItem}"
                                 FontWeight="{Binding FontWeightItem}"
                                 Foreground="{Binding SelectColor}"
@@ -126,8 +126,8 @@
                             HorizontalAlignment="Left"
                             IsValueContent="True"
                             IsSelectedEmpty ="{Binding IsSelectedEmpty}"
-                            ItemSource="{Binding PresetTextItems}"
-                            SelectedItems="{Binding PresetTextData, Mode=TwoWay}" />
+                            ItemSource="{Binding PresetFontItems}"
+                            SelectedItems="{Binding CurrentPresetFont, Mode=TwoWay}" />
 
                         <Button
                             Width="32"
@@ -156,7 +156,7 @@
                             IsValueContent="True"
                             IsSelectedEmpty ="{Binding IsSelectedEmpty}"
                             ItemSource="{Binding FontFamilyItems}"
-                            SelectedItems="{Binding FontFamilyData, Mode=TwoWay}" />
+                            SelectedItems="{Binding CurrentFontFamily, Mode=TwoWay}" />
 
                         <Grid Margin="0,8">
                             <CompositeControl:CustomComboControl
@@ -167,7 +167,7 @@
                                 IsValueContent="True"
                                 IsSelectedEmpty ="{Binding IsSelectedEmpty}"
                                 ItemSource="{Binding FontStyleItems}"
-                                SelectedItems="{Binding FontWeightStyleItem, Mode=TwoWay}" />
+                                SelectedItems="{Binding CurrrentFontWeightStyle, Mode=TwoWay}" />
 
 
                             <CompositeControl:CustomComboControl
@@ -176,7 +176,7 @@
                                 Height="32"
                                 HorizontalAlignment="Right"
                                 IsSelectedEmpty ="{Binding IsSelectedEmpty}"
-                                SelectedItems="{Binding FontSizeData, Mode=TwoWay}" />
+                                SelectedItems="{Binding CurrentFontSize, Mode=TwoWay}" />
                         </Grid>
                         <Grid>
                             <StackPanel Orientation="Horizontal">

+ 1 - 0
PDFSettings/PDFSettings.csproj

@@ -62,6 +62,7 @@
     <Compile Include="DpiHelpers.cs" />
     <Compile Include="BackgroundTemplateList.cs" />
     <Compile Include="PDFToolsList.cs" />
+    <Compile Include="PresetFontList.cs" />
     <Compile Include="ProductActiveInfo.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="RecentOpenFiles.cs" />

+ 27 - 0
PDFSettings/PresetFontList.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Media;
+
+namespace PDFSettings
+{
+    public class PresetFontList : List<PresetFontItem>
+    {
+
+    }
+
+    public class PresetFontItem
+    {
+        public string mTag { get; set; }
+        public string mTagContent { get; set; }
+        public int mFontSize { get; set; }
+        public FontFamily mFontFamily { get; set; }
+        public FontStyle mFontStyle { get; set; }
+        public FontWeight mFontWeight { get; set; }
+
+    }
+
+}