Browse Source

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

# Conflicts:
#	PDF Office/ViewModels/MainWindowViewModel.cs
lvle 1 năm trước cách đây
mục cha
commit
d0d036a08b
80 tập tin đã thay đổi với 3137 bổ sung2037 xóa
  1. 4 2
      PDF Office/App.xaml.cs
  2. BIN
      PDF Office/ComPDFKit.Viewer.dll
  3. 14 19
      PDF Office/CustomControl/AlertsMessage.xaml
  4. 33 11
      PDF Office/CustomControl/PageTurningPreview.xaml.cs
  5. 1 1
      PDF Office/EventAggregators/FillAndSignEvent.cs
  6. 35 2
      PDF Office/EventAggregators/SplitEvent.cs
  7. 1 1
      PDF Office/Helper/CropPageUndoManager.cs
  8. 1 1
      PDF Office/Helper/PDFToolsHelper.cs
  9. 15 15
      PDF Office/Helper/SecurityHelper.cs
  10. 3 1
      PDF Office/Model/BOTA/SearchItem.cs
  11. 16 2
      PDF Office/Model/Dialog/ToolsDialogs/MergeObject.cs
  12. 19 2
      PDF Office/Model/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogModel.cs
  13. 26 0
      PDF Office/Model/FillAndSign/FillAndSignContentModel.cs
  14. 9 0
      PDF Office/PDF Office.csproj
  15. 3 0
      PDF Office/Strings/MainPage/MainPage.Designer.cs
  16. 8 17
      PDF Office/ViewModels/BOTA/SearchContentViewModel.cs
  17. 5 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs
  18. 45 11
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  19. 6 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  20. 43 9
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs
  21. 42 9
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs
  22. 6 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs
  23. 6 2
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs
  24. 42 9
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs
  25. 22 7
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs
  26. 8 4
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs
  27. 7 0
      PDF Office/ViewModels/Dialog/NoviceGuidDialogViewModel.cs
  28. 31 30
      PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs
  29. 5 11
      PDF Office/ViewModels/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogViewModel.cs
  30. 216 52
      PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs
  31. 127 30
      PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs
  32. 8 4
      PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs
  33. 16 5
      PDF Office/ViewModels/MainWindowViewModel.cs
  34. 19 34
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs
  35. 5 4
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs
  36. 3 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs
  37. 13 12
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs
  38. 13 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePopupViewModel.cs
  39. 4 3
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs
  40. 4 3
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs
  41. 1 5
      PDF Office/ViewModels/TipContent/FileRestrictedTipViewModel.cs
  42. 218 0
      PDF Office/ViewModels/Tools/AnnotManager/AnnotTransfer.cs
  43. 154 163
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  44. 14 13
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  45. 9 11
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs
  46. 3 140
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  47. 108 104
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  48. 11 12
      PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs
  49. 141 83
      PDF Office/ViewModels/ViewContentViewModel.cs
  50. 1 7
      PDF Office/Views/BOTA/AnnotationListItem.xaml
  51. 23 82
      PDF Office/Views/BOTA/AnnotationListItem.xaml.cs
  52. 1 0
      PDF Office/Views/BOTA/BookmarkContent.xaml
  53. 333 333
      PDF Office/Views/BOTA/BookmarkContent.xaml.cs
  54. 2 0
      PDF Office/Views/BOTA/SearchContent.xaml
  55. 14 0
      PDF Office/Views/BOTA/SearchContent.xaml.cs
  56. 1 2
      PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml.cs
  57. 1 1
      PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml.cs
  58. 1 1
      PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml.cs
  59. 1 1
      PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml.cs
  60. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml
  61. 12 2
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml.cs
  62. 1 0
      PDF Office/Views/Dialog/NoviceGuidDialog.xaml
  63. 1 1
      PDF Office/Views/Dialog/ToolsDialogs/MergeDialog.xaml
  64. 1 1
      PDF Office/Views/HomePanel/RecentFiles/DocItemControl.xaml.cs
  65. 2 2
      PDF Office/Views/MainWindow.xaml.cs
  66. 186 125
      PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml
  67. 459 304
      PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml
  68. 13 12
      PDF Office/Views/PropertyPanel/AnnotPanel/ImageAnnotProperty.xaml
  69. 3 2
      PDF Office/Views/PropertyPanel/AnnotPanel/LinkAnnotProperty.xaml
  70. 56 64
      PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml
  71. 50 50
      PDF Office/Views/PropertyPanel/AnnotPanel/SignatureAnnotProperty.xaml
  72. 55 58
      PDF Office/Views/PropertyPanel/AnnotPanel/StickyNoteProperty.xaml
  73. 116 65
      PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml
  74. 34 24
      PDF Office/Views/PropertyPanel/PropertyPanelContent.xaml
  75. 25 24
      PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml.cs
  76. 31 0
      PDF Office/Views/TipContent/EnterReadModeTip.xaml
  77. 28 0
      PDF Office/Views/TipContent/EnterReadModeTip.xaml.cs
  78. 0 1
      PDF Office/Views/Tools/AnnotToolContent.xaml
  79. 73 20
      PDF Office/Views/ViewContent.xaml
  80. 69 3
      PDF Office/Views/ViewContent.xaml.cs

+ 4 - 2
PDF Office/App.xaml.cs

@@ -113,6 +113,7 @@ namespace PDF_Office
         /// 是否是软件的第一个主窗体
         /// </summary>
         public static bool IsFirstOpen = true;
+
         public static bool IsBookMode = false;
 
         /// <summary>
@@ -152,7 +153,6 @@ namespace PDF_Office
 
         private void InitSettings()
         {
-
             //是否是更新后
             if (Settings.Default.UpdateSettings)
             {
@@ -193,7 +193,7 @@ namespace PDF_Office
             if (Settings.Default.QuickPDFToolsList == null)
                 Settings.Default.QuickPDFToolsList = new PDFSettings.QuickPDFToolsList();
 
-            if(App.IsGuidPDFUpdated)
+            if (App.IsGuidPDFUpdated)
             {
                 SettingHelper.SortRecentOpenFiles(GuidPDFPath);
             }
@@ -396,6 +396,7 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<LinkAnnotTip>();
             containerRegistry.RegisterForNavigation<ReadModelTip>();
             containerRegistry.RegisterForNavigation<RemoveSecuritySuccessTip>();
+            containerRegistry.RegisterForNavigation<EnterReadModeTip>();
 
             //轻会员
             containerRegistry.RegisterForNavigation<CodeRegion>();
@@ -467,6 +468,7 @@ namespace PDF_Office
             //新手引导弹窗
             containerRegistry.RegisterDialog<NoviceGuidDialog>(DialogNames.GuidDialog);
             containerRegistry.RegisterDialog<IAPCompareDialog>(DialogNames.IAPCompareDialog);
+
             #endregion 注册弹窗
         }
 

BIN
PDF Office/ComPDFKit.Viewer.dll


+ 14 - 19
PDF Office/CustomControl/AlertsMessage.xaml

@@ -2,6 +2,7 @@
     x:Class="PDF_Office.CustomControl.AlertsMessage"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero2"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
     xmlns:local="clr-namespace:PDF_Office.CustomControl"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
@@ -12,39 +13,33 @@
     ResizeMode="NoResize"
     ShowInTaskbar="False"
     SizeToContent="Height"
+    Style="{StaticResource DialogWindowStyle}"
     WindowStartupLocation="CenterScreen"
-    WindowStyle="None"
     mc:Ignorable="d">
     <Border
         Height="auto"
         Background="White"
-        BorderBrush="Gray"
-        BorderThickness="1"
         CornerRadius="6"
         MouseLeftButtonDown="Border_PreviewMouseLeftButtonDown">
-        <Grid Margin="20,24,20,0">
+        <Grid Margin="16,0">
             <Grid.RowDefinitions>
-                <RowDefinition Height="auto" />
-                <RowDefinition />
+                <RowDefinition Height="*" />
+                <RowDefinition Height="auto " />
             </Grid.RowDefinitions>
-            <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="Auto" />
-                <ColumnDefinition />
-            </Grid.ColumnDefinitions>
-            <StackPanel
-                Grid.Column="0"
-                Grid.ColumnSpan="2"
-                VerticalAlignment="Center">
+            <StackPanel VerticalAlignment="Center">
                 <TextBlock
                     x:Name="TitleText"
-                    FontSize="14"
+                    Margin="0,16,0,0"
+                    FontSize="16"
                     FontWeight="SemiBold"
+                    Foreground="{StaticResource color.sys.text.neutral.lv1}"
                     Text="Make sure to delete the selected material?"
                     TextWrapping="Wrap" />
                 <TextBlock
                     x:Name="ContentText"
-                    Margin="0,4,0,0"
-                    FontSize="12"
+                    Margin="0,16"
+                    FontSize="14"
+                    Foreground="{StaticResource color.sys.text.neutral.lv1}"
                     Text="Make sure to delete the selected material?"
                     TextWrapping="Wrap" />
             </StackPanel>
@@ -52,7 +47,7 @@
             <Grid
                 x:Name="BtnGrid"
                 Grid.Row="1"
-                Grid.ColumnSpan="2">
+                Height="64">
                 <Grid.ColumnDefinitions>
                     <ColumnDefinition />
                     <ColumnDefinition />
@@ -96,6 +91,6 @@
                     Style="{StaticResource Btn.cta}" />
             </Grid>
         </Grid>
-    </Border>
 
+    </Border>
 </Window>

+ 33 - 11
PDF Office/CustomControl/PageTurningPreview.xaml.cs

@@ -37,7 +37,10 @@ namespace PDF_Office.CustomControl
             {
                 currentIndex = value;
                 //合理的使用set方法来进行一些操作,可以帮助理清很多思路,且极大减少代码量
-                this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                //显示Doc页码
+                //this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                //显示位置
+                this.CurrentPage.Text = (CurrentIndex + 1).ToString();
                 if (document != null)
                 {
                     AwaitRenderBitmap(document);
@@ -93,23 +96,36 @@ namespace PDF_Office.CustomControl
             {
                 if (this.CurrentPage.Text == "" || !int.TryParse(this.CurrentPage.Text, out int _))
                 {
-                    this.CurrentPage.Text = (PageIndexLists[0] + 1).ToString();
+                    // this.CurrentPage.Text = (PageIndexLists[0] + 1).ToString();
+                    this.CurrentPage.Text = "1";
                 }
                 if (this.PageIndex != null)
                 {
-                    if (PageIndexLists.Contains( int.Parse(this.CurrentPage.Text)-1))
+                    //if (PageIndexLists.Contains( int.Parse(this.CurrentPage.Text)-1))
+                    //{
+                    //    CurrentIndex=PageIndexLists.IndexOf(int.Parse(this.CurrentPage.Text)-1);
+                    //    this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                    //    AwaitRenderBitmap(document);
+                    //}
+                    //else
+                    //{
+                    //    this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                    //    MessageBox.Show("超出页面范围");
+                    //}
+
+                    if (int.Parse(this.CurrentPage.Text)<=PageIndexLists.Count&&int.Parse(this.CurrentPage.Text) > 0)
                     {
-                        CurrentIndex=PageIndexLists.IndexOf(int.Parse(this.CurrentPage.Text)-1);
-                        this.CurrentPage.Text = (PageIndexLists[CurrentIndex]+1).ToString();
+                        CurrentIndex =int.Parse(this.CurrentPage.Text) - 1;
+                        this.CurrentPage.Text = (CurrentIndex + 1).ToString();
                         AwaitRenderBitmap(document);
                     }
                     else
                     {
-                        this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
-                        MessageBox.Show("超出页面范围");
+                        this.CurrentPage.Text = (CurrentIndex + 1).ToString();
+                        //MessageBox.Show("超出页面范围");
                     }
                 }
-                
+
             }
         }
 
@@ -129,13 +145,19 @@ namespace PDF_Office.CustomControl
                 if (PageIndexLists.Contains(int.Parse(this.CurrentPage.Text) - 1))
                 {
                     CurrentIndex = PageIndexLists.IndexOf(int.Parse(this.CurrentPage.Text) - 1);
-                    this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                    //显示Doc页码
+                    //this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                    //显示位置
+                    this.CurrentPage.Text = (CurrentIndex +1).ToString();
                     AwaitRenderBitmap(document);
                 }
                 else
                 {
-                    this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
-                   
+                    //显示Doc页码
+                    //this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                    //显示位置
+                    this.CurrentPage.Text = (CurrentIndex + 1).ToString();
+
                 }
             }
         }

+ 1 - 1
PDF Office/EventAggregators/FillAndSignEvent.cs

@@ -11,7 +11,7 @@ namespace PDF_Office.EventAggregators
 
     public class FillAndSigntEventArgs
     {
-        public string Unicode { get; set; }
+        public string Action { get; set; }
         public string AppUnicode { get; set; }
         public List<AnnotHandlerEventArgs> Annots { get; set; }
 

+ 35 - 2
PDF Office/EventAggregators/SplitEvent.cs

@@ -13,10 +13,12 @@ namespace PDF_Office.EventAggregators
         /// 垂直分屏
         /// </summary>
         Vertical,
+
         /// <summary>
         /// 水平分屏
         /// </summary>
         Horizontal,
+
         /// <summary>
         /// 单屏(退出分屏)
         /// </summary>
@@ -33,7 +35,38 @@ namespace PDF_Office.EventAggregators
     /// <summary>
     /// 通知分屏的事件
     /// </summary>
-    public class SplitEvent: PubSubEvent<SplitEventArgs>
+    public class SplitEvent : PubSubEvent<SplitEventArgs>
+    {
+    }
+
+    public class ReadModeArgs
+    {
+        public string Unicode { get; set; }
+        public bool IsReadMode { get; set; }
+
+        public bool IsBOTAShow  { get; set; }
+        public bool IsPropertyOpen { get; set; }
+    }
+
+    public class ReadModePropertyOpenArgs
+    {
+        public string Unicode { get; set; }
+        public bool IsPropertyOpen { get; set; }
+    }
+    public class ReadModeBOTAShowArgs
+    {
+        public string Unicode { get; set; }
+        public bool IsBOTAShow { get; set; }
+    }
+
+    public class ReadModeEvent : PubSubEvent<ReadModeArgs>
+    {
+    }
+
+    public class ReadModePropertyOpenEvent : PubSubEvent<ReadModePropertyOpenArgs>
+    {
+    }
+    public class ReadModeBOTAShowEvent : PubSubEvent<ReadModeBOTAShowArgs>
     {
     }
-}
+}

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

@@ -58,7 +58,7 @@ namespace PDF_Office.Helper
             if (cropPageEnumIndex != cropPageEnumList.Count - 1)
             {
                 cropPageEnumList.RemoveRange(cropPageEnumIndex+1, cropPageEnumList.Count - cropPageEnumIndex-1);
-                cropPageList.RemoveRange(cropPageList.Count - cropPageListInterval-37, cropPageListInterval);
+                cropPageList.RemoveRange(cropPageList.Count - cropPageListInterval- pdfviewer.Document.PageCount, cropPageListInterval);
                 cropPageListInterval = 0;
             }
             

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

@@ -200,7 +200,7 @@ namespace PDF_Office.Helper
             var pDFToPPT = new PDFToolsInit();
             pDFToPPT.SetFnType(PDFFnType.PDFToPPT);
             pDFToPPT.SetImagePath(@"pack://application:,,,/Resources/HomeIcon/PDFTools/pdf-to-ppt.png");
-            pDFToPPT.SetContent("To PPt", "Batch convert, compress, secure, watermark PDFs.");
+            pDFToPPT.SetContent("To PPT", "Batch convert, compress, secure, watermark PDFs.");
             //PDF转Excel
             var pDFToExcel = new PDFToolsInit();
             pDFToExcel.SetFnType(PDFFnType.PDFToExcel);

+ 15 - 15
PDF Office/Helper/SecurityHelper.cs

@@ -159,25 +159,25 @@ namespace PDF_Office.Helper
             {
                 verifyPasswordResult.IsDiscryptied = true;
                 verifyPasswordResult.Password = null;
-                return verifyPasswordResult;
-            }
-
-            DialogParameters value = new DialogParameters();
-            if (enumPermissionsSet == EnumPermissionsSet.None)
-            {
-                value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusOpenPassword);
-
             }
             else
             {
-                value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusPermissionsPassword);
+                DialogParameters value = new DialogParameters();
+                if (CheckHaveSelectedPermissions(document, enumPermissionsSet))
+                {
+                    value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusOpenPassword);
+                }
+                else
+                {
+                    value.Add(ParameterNames.PasswordKind, EnumPasswordKind.StatusPermissionsPassword);
+                }
+                value.Add(ParameterNames.PDFDocument, document);
+                dialogService.ShowDialog(DialogNames.CheckPasswordDialog, value, e =>
+                {
+                    verifyPasswordResult.IsDiscryptied = e.Parameters.GetValue<bool>(ParameterNames.PasswordResult);
+                    verifyPasswordResult.Password = e.Parameters.GetValue<string>(ParameterNames.Password);
+                });
             }
-            value.Add(ParameterNames.PDFDocument, document);
-            dialogService.ShowDialog(DialogNames.CheckPasswordDialog, value, e =>
-            {
-                verifyPasswordResult.IsDiscryptied = e.Parameters.GetValue<bool>(ParameterNames.PasswordResult);
-                verifyPasswordResult.Password = e.Parameters.GetValue<string>(ParameterNames.Password);
-            });
             return verifyPasswordResult;
         }
     }

+ 3 - 1
PDF Office/Model/BOTA/SearchItem.cs

@@ -1,4 +1,5 @@
-using Prism.Mvvm;
+using ComPDFKitViewer.PdfViewer;
+using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -17,6 +18,7 @@ namespace PDF_Office.Model.BOTA
         public string SearchWord { get; set; }
         public Rect TextRect { get; set; }
         public int PageRotate { get; set; }
+        public TextSearchItem SearchItem { get; set; }
 
 
         private Visibility itemVisibility;

+ 16 - 2
PDF Office/Model/Dialog/ToolsDialogs/MergeObject.cs

@@ -94,12 +94,12 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs
             }
         }
 
-        private string setPageRange;
+        private List<int> setPageRange;
 
         /// <summary>
         /// 设置的文档页面范围
         /// </summary>
-        public string SetPageRange
+        public List<int> SetPageRange
         {
             get { return setPageRange; }
             set
@@ -108,6 +108,20 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs
             }
         }
 
+        private string setPageRangeStr;
+
+        /// <summary>
+        /// 设置的文档页面范围
+        /// </summary>
+        public string SetPageRangeStr
+        {
+            get { return setPageRangeStr; }
+            set
+            {
+                SetProperty(ref setPageRangeStr, value);
+            }
+        }
+
         private string password="";
 
         /// <summary>

+ 19 - 2
PDF Office/Model/Dialog/ToolsDialogs/SaftyDialogs/CheckPasswordDialogModel.cs

@@ -1,4 +1,5 @@
-using System;
+using ComPDFKit.PDFDocument;
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,7 +9,23 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs
 {
     public class CheckPasswordDialogModel
     {
+        static public Dictionary<EnumPermissionsSet, bool> InitHavePermissionsInfo(CPDFDocument document)
+        {
+            Dictionary<EnumPermissionsSet, bool> GetHavePermissionsFromPermissionsSet = new Dictionary<EnumPermissionsSet, bool>();
+            GetHavePermissionsFromPermissionsSet.Clear();
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsDocumentChanges, document.GetPermissionsInfo().AllowsDocumentChanges);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsPrinting, document.GetPermissionsInfo().AllowsPrinting);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsHighQualityPrinting, document.GetPermissionsInfo().AllowsHighQualityPrinting);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsCopying, document.GetPermissionsInfo().AllowsCopying);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsDocumentAssembly, document.GetPermissionsInfo().AllowsDocumentAssembly);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsFormFieldEntry, document.GetPermissionsInfo().AllowsFormFieldEntry);
+            GetHavePermissionsFromPermissionsSet.Add(EnumPermissionsSet.StatusAllowsCommenting, document.GetPermissionsInfo().AllowsCommenting);
+            return GetHavePermissionsFromPermissionsSet;
+        }
     }
+
+
+
     public enum EnumPermissionsSet
     {
         None = 0,
@@ -20,5 +37,5 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs
         StatusAllowsFormFieldEntry  = 1<<6,
         StatusAllowsCommenting = 1<<7
     }
-    
+
 }

+ 26 - 0
PDF Office/Model/FillAndSign/FillAndSignContentModel.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.FillAndSign
+{
+    public class FillAndSignContentModel
+    {
+    }
+
+    public class FillAndSignIsShape
+    {
+        public FillAndSignIsShape(int PageIndex, int AnnotIndex, string Shape)
+        {
+            this.PageIndex = PageIndex;
+            this.AnnotIndex = AnnotIndex;
+            this.Shape = Shape;
+        }
+        public int PageIndex;
+        public int AnnotIndex;
+        public string Shape;
+
+    }
+}

+ 9 - 0
PDF Office/PDF Office.csproj

@@ -447,6 +447,7 @@
     <Compile Include="Model\EditTools\HeaderFooter\HeaderFooterCreateModel.cs" />
     <Compile Include="Model\EditTools\Watermark\WatermarkCreateModel.cs" />
     <Compile Include="Model\EditTools\Watermark\WatermarkTemplateListModel.cs" />
+    <Compile Include="Model\FillAndSign\FillAndSignContentModel.cs" />
     <Compile Include="Model\From\FormFieldType.cs" />
     <Compile Include="Model\PageEdit\CustomInsertModel.cs" />
     <Compile Include="Model\PageEdit\CustomPageItem.cs" />
@@ -606,6 +607,7 @@
     <Compile Include="ViewModels\TipContent\LinkAnnotTipViewModel.cs" />
     <Compile Include="ViewModels\TipContent\RemoveSecuritySuccessTipViewModel.cs" />
     <Compile Include="ViewModels\TipContent\SetPasswordSuccessfullyTipViewModel.cs" />
+    <Compile Include="ViewModels\Tools\AnnotManager\AnnotTransfer.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Command.cs" />
     <Compile Include="ViewModels\Tools\AnnotToolContentViewModel.Layout.cs" />
     <Compile Include="ViewModels\Tools\ConverterBarContentViewModel.cs" />
@@ -1204,6 +1206,9 @@
     <Compile Include="Views\Scan\ScanViwer.xaml.cs">
       <DependentUpon>ScanViwer.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\TipContent\EnterReadModeTip.xaml.cs">
+      <DependentUpon>EnterReadModeTip.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\TipContent\FileRestrictedTip.xaml.cs">
       <DependentUpon>FileRestrictedTip.xaml</DependentUpon>
     </Compile>
@@ -2144,6 +2149,10 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\TipContent\EnterReadModeTip.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\TipContent\FileRestrictedTip.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 3 - 0
PDF Office/Strings/MainPage/MainPage.Designer.cs

@@ -590,7 +590,10 @@ namespace PDF_Office.Strings.MainPage {
                 return ResourceManager.GetString("GlobalTip_ESCReadMode", resourceCulture);
             }
         }
+
+        
         
+
         /// <summary>
         ///   查找类似 Exit Read Mode 的本地化字符串。
         /// </summary>

+ 8 - 17
PDF Office/ViewModels/BOTA/SearchContentViewModel.cs

@@ -136,15 +136,8 @@ namespace PDF_Office.ViewModels.BOTA
                 List<TextSearchItem> pageTextList = new List<TextSearchItem>();
                 foreach (var item in SearchItemList)
                 {
-                    TextSearchItem textSearchItem = new TextSearchItem()
-                    {
-                        PageIndex = item.TextProperty.PageIndex,
-                        TextRect = item.TextProperty.TextRect,
-                        TextContent = item.TextProperty.TextContent,
-                        PageRotate = item.TextProperty.PageRotate
-                    };
-                    textSearchItem.PaintBrush = new SolidColorBrush(Color.FromArgb(0x99, 0xFF, 0xF7, 0x00));
-                    pageTextList.Add(textSearchItem);
+                    item.TextProperty.SearchItem.PaintBrush = new SolidColorBrush(Color.FromArgb(0x99, 0xFF, 0xF7, 0x00));
+                    pageTextList.Add(item.TextProperty.SearchItem);
                 }
                 PDFViewer.SetPageSelectText(pageTextList);
             });
@@ -166,6 +159,7 @@ namespace PDF_Office.ViewModels.BOTA
                         addItem.TextProperty.SearchWord = CurrentSearchText;
                         addItem.TextProperty.HighLightColor = Color.FromArgb(0x99, 0xFF, 0xF7, 0x00);
                         addItem.TextProperty.PageRotate = item.PageRotate;
+                        addItem.TextProperty.SearchItem = item;
                         SearchItemList.Add(addItem);
                     }
                 }
@@ -276,14 +270,11 @@ namespace PDF_Office.ViewModels.BOTA
                 if (currentItem != null && PDFViewer != null)
                 {
                     List<TextSearchItem> pageTextList = new List<TextSearchItem>();
-                    pageTextList.Add(new TextSearchItem()
-                    {
-                        PageIndex = currentItem.TextProperty.PageIndex,
-                        TextRect = currentItem.TextProperty.TextRect,
-                        TextContent = currentItem.TextProperty.TextContent,
-                        PageRotate = currentItem.TextProperty.PageRotate
-                    });
-                    PDFViewer.SetPageSelectText(pageTextList, new SolidColorBrush(Color.FromArgb(0x99, 0xFF, 0xF7, 0x00)));
+                    currentItem.TextProperty.SearchItem.BorderBrush = new SolidColorBrush(Color.FromArgb(0xFF, 0x17, 0x70, 0xF4));
+                    currentItem.TextProperty.SearchItem.Padding = new Thickness(3);
+                    currentItem.TextProperty.SearchItem.BorderThickness = 1;
+                    pageTextList.Add(currentItem.TextProperty.SearchItem);
+                    PDFViewer.HighLightSearchText(pageTextList);
                 }
             }
         }

+ 5 - 2
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs

@@ -87,6 +87,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string PageRangeSelectIndex { set; get; } = "0";
 
+        public bool IsCurrentPageIndex = true;
 
         private int maxPageRange = 0;
         public int MaxPageRange
@@ -201,7 +202,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.PageIndex.Text= ConverterPreview.PageIndexLists.Count.ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }
@@ -229,7 +231,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     else
                     {
-                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                         ConverterPreview.CurrentIndex = 0;
                     }
                 }

+ 45 - 11
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs

@@ -34,13 +34,15 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string CurrentPageIndex = "1";
 
+        public bool IsCurrentPageIndex = false;
+
         public IDialogService dialogs;
 
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
 
-        private int _anyContentSelectIndex=0;
+        private int _anyContentSelectIndex = 0;
         public int AnyContentSelectIndex
         {
             get { return _anyContentSelectIndex; }
@@ -52,7 +54,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private int _onlyTableSelectIndex=0;
+        private int _onlyTableSelectIndex = 0;
         public int OnlyTableSelectIndex
         {
             get { return _onlyTableSelectIndex; }
@@ -96,6 +98,32 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
             }
         }
+
+        private Dictionary<string, string> CheckPageSelect = new Dictionary<string, string>();
+
+        private void InitCheckPageSelect()
+        {
+
+            CheckPageSelect.Clear();
+            if (!IsCurrentPageIndex)
+            {
+                CheckPageSelect.Add("0", "0");
+                CheckPageSelect.Add("1", "1");
+                CheckPageSelect.Add("2", "2");
+                CheckPageSelect.Add("3", "3");
+                CheckPageSelect.Add("4", "3");
+            }
+            else
+            {
+
+                CheckPageSelect.Add("0", "0");
+                CheckPageSelect.Add("1", "-2");
+                CheckPageSelect.Add("2", "1");
+                CheckPageSelect.Add("3", "2");
+                CheckPageSelect.Add("4", "3");
+
+            }
+        }
         #endregion
 
         #region 委托声明
@@ -124,13 +152,14 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
             CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
             BatchConverterCommand = new DelegateCommand(BatchConverter);
+
             dialogs = dialogService;
         }
         #region 逻辑函数
 
         public void SetCustomPageRange()
         {
-            if (PageRangeSelectIndex == "4")
+            if (PageRangeSelectIndex == CheckPageSelect["4"])
             {
 
                 List<int> PageIndexLists = new List<int>();
@@ -162,7 +191,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private void converter()
         {
-            if (PageRangeSelectIndex == "4")
+            if (PageRangeSelectIndex == CheckPageSelect["4"])
             {
 
                 List<int> PageIndexLists = new List<int>();
@@ -218,7 +247,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             {
                 return;
             }
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterExcelModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterExcelModel.PageRange, PageRangeText, !IsCurrentPageIndex, CurrentPageIndex);
             if (ConverterExcelModel.PageRange == "")
             {
                 Trace.WriteLine("输入不对");
@@ -262,9 +291,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 var currentViewer = this.currentViewer;
                 string PageRange = "";
                 var PageRangeText = this.PageRangeText;
-                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                if (PageRangeSelectIndex == CheckPageSelect["0"] || PageRangeSelectIndex == CheckPageSelect["2"] || PageRangeSelectIndex == CheckPageSelect["3"])
                 {
-                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
@@ -276,7 +305,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
 
                 }
-                if (PageRangeSelectIndex == "1")
+                if (PageRangeSelectIndex == CheckPageSelect["1"])
                 {
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
@@ -290,7 +319,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }
@@ -306,7 +336,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     var currentViewer = this.currentViewer;
                     string PageRange = "";
                     var PageRangeText = this.PageRangeText;
-                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
 
@@ -318,7 +348,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     else
                     {
-                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                       // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                         ConverterPreview.CurrentIndex = 0;
                     }
                 }
@@ -436,9 +467,12 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public void OnDialogOpened(IDialogParameters parameters)
         {
             CPDFViewer pdfViewer = null;
+
             parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            parameters.TryGetValue<bool>("PageRangeComboBoxCurrentPage", out IsCurrentPageIndex);
             if (pdfViewer != null)
             {
+                InitCheckPageSelect();
                 currentViewer = pdfViewer;
                 MaxPageRange = currentViewer.Document.PageCount;
                 if (currentViewer.Tag != null) { ConverterExcelModel.Pawssword = currentViewer.Tag.ToString(); }

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

@@ -78,6 +78,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string CurrentPageIndex = "1";
 
+        public bool IsCurrentPageIndex = true;
+
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
@@ -307,7 +309,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }
@@ -335,7 +338,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     else
                     {
-                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                         ConverterPreview.CurrentIndex = 0;
                     }
                 }

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

@@ -78,6 +78,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string CurrentPageIndex = "1";
 
+        public bool IsCurrentPageIndex = true;
+
         public IDialogService dialogs;
 
         public string PageRangeText { set; get; } = "0";
@@ -150,6 +152,32 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             this.ImageDPIFamily.Add("300 dpi");
             this.ImageDPIFamily.Add("600 dpi");
         }
+
+        private Dictionary<string, string> CheckPageSelect = new Dictionary<string, string>();
+
+        private void InitCheckPageSelect()
+        {
+
+            CheckPageSelect.Clear();
+            if (!IsCurrentPageIndex)
+            {
+                CheckPageSelect.Add("0", "0");
+                CheckPageSelect.Add("1", "1");
+                CheckPageSelect.Add("2", "2");
+                CheckPageSelect.Add("3", "3");
+                CheckPageSelect.Add("4", "3");
+            }
+            else
+            {
+
+                CheckPageSelect.Add("0", "0");
+                CheckPageSelect.Add("1", "-2");
+                CheckPageSelect.Add("2", "1");
+                CheckPageSelect.Add("3", "2");
+                CheckPageSelect.Add("4", "3");
+
+            }
+        }
         #endregion
 
         #region 委托声明
@@ -183,9 +211,11 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         #region 逻辑函数
 
+        
+
         public void SetCustomPageRange()
         {
-            if (PageRangeSelectIndex == "4")
+            if (PageRangeSelectIndex == CheckPageSelect["4"])
             {
 
                 List<int> PageIndexLists = new List<int>();
@@ -289,7 +319,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private void converter()
         {
-            if (PageRangeSelectIndex == "4")
+            if (PageRangeSelectIndex == CheckPageSelect["4"])
             {
 
                 List<int> PageIndexLists = new List<int>();
@@ -322,7 +352,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             {
                 return;
             }
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterImgModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterImgModel.PageRange, PageRangeText, !IsCurrentPageIndex, CurrentPageIndex);
             if (ConverterImgModel.PageRange == "")
             {
                 Trace.WriteLine("输入不对");
@@ -365,9 +395,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 var currentViewer = this.currentViewer;
                 string PageRange = "";
                 var PageRangeText = this.PageRangeText;
-                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                if (PageRangeSelectIndex == CheckPageSelect["0"] || PageRangeSelectIndex == CheckPageSelect["2"] || PageRangeSelectIndex == CheckPageSelect["3"])
                 {
-                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
@@ -379,7 +409,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
 
                 }
-                if (PageRangeSelectIndex == "1")
+                if (PageRangeSelectIndex == CheckPageSelect["1"])
                 {
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
@@ -393,7 +423,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }
@@ -409,7 +440,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     var currentViewer = this.currentViewer;
                     string PageRange = "";
                     var PageRangeText = this.PageRangeText;
-                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
 
@@ -421,7 +452,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     else
                     {
-                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                         ConverterPreview.CurrentIndex = 0;
                     }
                 }
@@ -455,8 +487,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         {
             CPDFViewer pdfViewer = null;
             parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            parameters.TryGetValue<bool>("PageRangeComboBoxCurrentPage", out IsCurrentPageIndex);
             if (pdfViewer != null)
             {
+                InitCheckPageSelect();
                 currentViewer = pdfViewer;
                 MaxPageRange = currentViewer.Document.PageCount;
                 if (currentViewer.Tag != null) { ConverterImgModel.Pawssword = currentViewer.Tag.ToString(); }

+ 42 - 9
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs

@@ -78,6 +78,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string CurrentPageIndex = "1";
 
+        public bool IsCurrentPageIndex = true;
+
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
@@ -114,6 +116,32 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
             }
         }
+
+        private Dictionary<string, string> CheckPageSelect = new Dictionary<string, string>();
+
+        private void InitCheckPageSelect()
+        {
+
+            CheckPageSelect.Clear();
+            if (!IsCurrentPageIndex)
+            {
+                CheckPageSelect.Add("0", "0");
+                CheckPageSelect.Add("1", "1");
+                CheckPageSelect.Add("2", "2");
+                CheckPageSelect.Add("3", "3");
+                CheckPageSelect.Add("4", "3");
+            }
+            else
+            {
+
+                CheckPageSelect.Add("0", "0");
+                CheckPageSelect.Add("1", "-2");
+                CheckPageSelect.Add("2", "1");
+                CheckPageSelect.Add("3", "2");
+                CheckPageSelect.Add("4", "3");
+
+            }
+        }
         #endregion
 
         #region 委托声明
@@ -143,9 +171,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             IntString();
         }
         #region 逻辑函数
+
         public void SetCustomPageRange()
         {
-            if (PageRangeSelectIndex == "4")
+            if (PageRangeSelectIndex == CheckPageSelect["4"])
             {
 
                 List<int> PageIndexLists = new List<int>();
@@ -179,7 +208,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private void converter()
         {
-            if (PageRangeSelectIndex == "4")
+            if (PageRangeSelectIndex == CheckPageSelect["4"])
             {
 
                 List<int> PageIndexLists = new List<int>();
@@ -235,7 +264,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             {
                 return;
             }
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterPPTModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterPPTModel.PageRange, PageRangeText, !IsCurrentPageIndex, CurrentPageIndex);
             if (ConverterPPTModel.PageRange == "")
             {
                 Trace.WriteLine("输入不对");
@@ -278,9 +307,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 var currentViewer = this.currentViewer;
                 string PageRange = "";
                 var PageRangeText = this.PageRangeText;
-                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                if (PageRangeSelectIndex == CheckPageSelect["0"] || PageRangeSelectIndex == CheckPageSelect["2"] || PageRangeSelectIndex == CheckPageSelect["3"])
                 {
-                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
@@ -292,7 +321,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
 
                 }
-                if (PageRangeSelectIndex == "1")
+                if (PageRangeSelectIndex == CheckPageSelect["1"])
                 {
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
@@ -306,7 +335,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }
@@ -322,7 +352,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     var currentViewer = this.currentViewer;
                     string PageRange = "";
                     var PageRangeText = this.PageRangeText;
-                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
 
@@ -334,7 +364,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     else
                     {
-                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                         ConverterPreview.CurrentIndex = 0;
                     }
                 }
@@ -394,8 +425,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         {
             CPDFViewer pdfViewer = null;
             parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            parameters.TryGetValue<bool>("PageRangeComboBoxCurrentPage", out IsCurrentPageIndex);
             if (pdfViewer != null)
             {
+                InitCheckPageSelect();
                 currentViewer = pdfViewer;
                 MaxPageRange = currentViewer.Document.PageCount;
                 if (currentViewer.Tag != null) { ConverterPPTModel.Pawssword = currentViewer.Tag.ToString(); }

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

@@ -78,6 +78,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string CurrentPageIndex = "1";
 
+        public bool IsCurrentPageIndex = true;
+
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
@@ -305,7 +307,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }
@@ -333,7 +336,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     else
                     {
-                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                         ConverterPreview.CurrentIndex = 0;
                     }
                 }

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

@@ -79,6 +79,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string CurrentPageIndex = "1";
 
+        public bool IsCurrentPageIndex = true;
+
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
@@ -304,7 +306,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }
@@ -332,7 +335,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     else
                     {
-                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                         ConverterPreview.CurrentIndex = 0;
                     }
                 }

+ 42 - 9
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs

@@ -79,6 +79,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string CurrentPageIndex = "1";
 
+        public bool IsCurrentPageIndex = true;
+
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
@@ -115,6 +117,32 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
             }
         }
+
+        private Dictionary<string, string> CheckPageSelect = new Dictionary<string, string>();
+
+        private void InitCheckPageSelect()
+        {
+
+            CheckPageSelect.Clear();
+            if (!IsCurrentPageIndex)
+            {
+                CheckPageSelect.Add("0", "0");
+                CheckPageSelect.Add("1", "1");
+                CheckPageSelect.Add("2", "2");
+                CheckPageSelect.Add("3", "3");
+                CheckPageSelect.Add("4", "3");
+            }
+            else
+            {
+
+                CheckPageSelect.Add("0", "0");
+                CheckPageSelect.Add("1", "-2");
+                CheckPageSelect.Add("2", "1");
+                CheckPageSelect.Add("3", "2");
+                CheckPageSelect.Add("4", "3");
+
+            }
+        }
         #endregion
 
         #region 委托声明
@@ -147,9 +175,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             IntString();
         }
         #region 逻辑函数
+
         public void SetCustomPageRange()
         {
-            if (PageRangeSelectIndex == "4")
+            if (PageRangeSelectIndex == CheckPageSelect["4"])
             {
 
                 List<int> PageIndexLists = new List<int>();
@@ -182,7 +211,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         private void converter()
         {
-            if (PageRangeSelectIndex == "4")
+            if (PageRangeSelectIndex == CheckPageSelect["4"])
             {
 
                 List<int> PageIndexLists = new List<int>();
@@ -237,7 +266,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             {
                 return;
             }
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterWordModel.PageRange, PageRangeText, true, CurrentPageIndex);
+            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterWordModel.PageRange, PageRangeText, !IsCurrentPageIndex, CurrentPageIndex);
             if (ConverterWordModel.PageRange == "")
             {
                 Trace.WriteLine("输入不对");
@@ -280,9 +309,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 var currentViewer = this.currentViewer;
                 string PageRange = "";
                 var PageRangeText = this.PageRangeText;
-                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                if (PageRangeSelectIndex == CheckPageSelect["0"] || PageRangeSelectIndex == CheckPageSelect["2"] || PageRangeSelectIndex == CheckPageSelect["3"])
                 {
-                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
                     if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
@@ -294,7 +323,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
 
                 }
-                if (PageRangeSelectIndex == "1")
+                if (PageRangeSelectIndex == CheckPageSelect["1"])
                 {
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
@@ -308,7 +337,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
                 }
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                 ConverterPreview.CurrentIndex = 0;
             }
         }
@@ -324,7 +354,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     var currentViewer = this.currentViewer;
                     string PageRange = "";
                     var PageRangeText = this.PageRangeText;
-                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
                     char[] enumerationSeparator = new char[] { ',' };
                     char[] rangeSeparator = new char[] { '-' };
 
@@ -336,7 +366,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     }
                     else
                     {
-                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
                         ConverterPreview.CurrentIndex = 0;
                     }
                 }
@@ -413,8 +444,10 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         {
             CPDFViewer pdfViewer = null;
             parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
+            parameters.TryGetValue<bool>("PageRangeComboBoxCurrentPage", out IsCurrentPageIndex);
             if (pdfViewer != null)
             {
+                InitCheckPageSelect();
                 currentViewer = pdfViewer;
                 MaxPageRange = currentViewer.Document.PageCount;
                 if (currentViewer.Tag != null) { ConverterWordModel.Pawssword = currentViewer.Tag.ToString(); }

+ 22 - 7
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs

@@ -277,13 +277,19 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 {
                     ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "wait";
                     ImagesCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "wait";
-                    Image img = Image.FromFile(filename);
-                    if (img == null)
+                    try
                     {
-                        ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "error";
-                        ImagesCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "error";
-                        continue;
-                    }
+                        Image img = Image.FromFile(filename);
+                        if (img == null)
+                        {
+                            ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "error";
+                            ImagesCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "error";
+                            fileNamesIndex++;
+                            continue;
+                        }
+                   
+                   
+                    
                     CPDFDocument topdfdoc = CPDFDocument.CreateDocument();
                     FileInfo fileinfo = new FileInfo(filename);
                     JpegInsertPage(ref topdfdoc, filename, fileinfo, img.Width, img.Height);
@@ -294,7 +300,16 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                     string file_size = (((float)fileinfo.Length) / 1024).ToString() + " K";
                     ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "complete";
                     ImagesCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "complete";
-                    fileNamesIndex++;
+                        fileNamesIndex++;
+                    }
+                     catch
+                    {
+                        ImagesDataTable.Rows[fileNamesIndex]["FileState"] = "error";
+                        ImagesCurrentDataTable.Rows[fileNamesIndex]["FileState"] = "error";
+                        fileNamesIndex++;
+                        continue;
+                    }
+                    
                     //System.Diagnostics.Process.Start("Explorer", "/select," + fileName);
                 }
                 System.Diagnostics.Process.Start("Explorer", "/select," + fileName);

+ 8 - 4
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePrinter/HomePagePrinterDialogViewModel.cs

@@ -1024,10 +1024,14 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePagePrinter
                 if (result.Password != null)
                 {
                     string filePath = PDFViewer.Document.FilePath;
-                    PDFViewer.CloseDocument();
-                    PDFViewer.InitDocument(filePath);
-                    PDFViewer.Document.UnlockWithPassword(result.Password);
-                    PDFViewer.Load();
+                    if (PDFViewer.Document.IsLocked)
+                    {
+                        PDFViewer.Document.UnlockWithPassword(result.Password);
+                    }
+                    else
+                    {
+                        PDFViewer.Document.CheckOwnerPassword(result.Password);
+                    }
                 }
                 ///TODO:
                 ///此处填入需要执行的代码

+ 7 - 0
PDF Office/ViewModels/Dialog/NoviceGuidDialogViewModel.cs

@@ -97,10 +97,17 @@ namespace PDF_Office.ViewModels.Dialog
             NextPageCommand = new DelegateCommand(NextPage,CanNextPageExcute).ObservesProperty(()=>SelectedIndex);
             PrePageCommand = new DelegateCommand(PrePage,CanPrePageExcute).ObservesProperty(()=>SelectedIndex);
             SignUpCommand = new DelegateCommand(SignUp);
+            NextTimeCommand = new DelegateCommand(nexttime);
 
             InitItemSource();
         }
 
+        private void nexttime()
+        {
+            //忽略,下次再看
+            this.RequestClose(new DialogResult(ButtonResult.Ignore));
+        }
+
         private void InitItemSource()
         {
             ItemSource = new ObservableCollection<GuidItemModel>();

+ 31 - 30
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -148,6 +148,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
 
         private void Cancel()
         {
+            Clear();
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
         }
 
@@ -251,7 +252,14 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                     {
                         tempDoc.UnlockWithPassword(MergeObjectlist[i].Password);
                     }
-                    result = SaveDoc.ImportPages(tempDoc, MergeObjectlist[i].SetPageRange);
+                    if (!string.IsNullOrEmpty(MergeObjectlist[i].SetPageRangeStr))
+                    {
+                        result = SaveDoc.ImportPages(tempDoc, MergeObjectlist[i].SetPageRangeStr);
+                    }
+                    else
+                    {
+                        result = SaveDoc.ImportPages(tempDoc, CommonHelper.GetPageParmFromList(MergeObjectlist[i].SetPageRange));
+                    }
                     if (!result)
                     {
                         SaveDoc.Release();
@@ -381,7 +389,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
             {
                 return;
             }
-            bool result = true;
+            bool showDialog = false;
             for (int i = 0; i < FilePath.Length; i++)
             {
                 MergeObject mergeObject = new MergeObject();
@@ -403,13 +411,9 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                 string FileType = Path.GetExtension(mergeObject.FilePath).Trim().ToLower();
                 if (string.IsNullOrEmpty(FileType))
                 {
-                    AlertsMessage alertsMessage = new AlertsMessage();
-                    alertsMessage.ShowDialog("", "The file was not added successfully, please select the file again.","OK");
-                    if (alertsMessage.result == ContentResult.Ok)
-                    {
-                        //获取不到文件类型
-                        continue;
-                    }
+                    showDialog = true;
+                    //获取不到文件类型
+                    continue;
                 }
                 if (FileType != ".pdf")
                 {
@@ -419,13 +423,9 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                     int imageindex = list.IndexOf(imagetype);
                     if (imageindex < 0)
                     {
-                        AlertsMessage alertsMessage = new AlertsMessage();
-                        alertsMessage.ShowDialog("", "The file was not added successfully, please select the file again.", "OK");
-                        if (alertsMessage.result == ContentResult.Ok)
-                        {
-                            //图片格式不支持
-                            continue;
-                        }
+                        showDialog = true;
+                        //图片格式不支持
+                        continue;
                     };
 
                     mergeObject.DocName = Path.GetFileName(mergeObject.FilePath);
@@ -438,13 +438,9 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                     }
                     catch (Exception)
                     {
-                        AlertsMessage alertsMessage = new AlertsMessage();
-                        alertsMessage.ShowDialog("", "The file was not added successfully, please select the file again.", "OK");
-                        if (alertsMessage.result == ContentResult.Ok)
-                        {
-                            //解码错误
-                            continue;
-                        }
+                        showDialog = true;
+                        //解码错误
+                        continue;
                     }
                 }
                 else
@@ -452,13 +448,9 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                     CPDFDocument doc = CPDFDocument.InitWithFilePath(mergeObject.FilePath);
                     if (doc == null)
                     {
-                        AlertsMessage alertsMessage = new AlertsMessage();
-                        alertsMessage.ShowDialog("", "The file was not added successfully, please select the file again.", "OK");
-                        if (alertsMessage.result == ContentResult.Ok)
-                        {
-                            //PDF打开失败
-                            continue;
-                        }
+                        showDialog = true;
+                        //PDF打开失败
+                        continue;
                     }
                     VerifyPasswordResult condition = SecurityHelper.VerifyPasswordByPasswordKind(doc, EnumPasswordKind.StatusPermissionsPassword, dialogs);
                     if (condition.IsDiscryptied)
@@ -495,6 +487,15 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                 MergeObjectlist.Add(mergeObject);
                 UpDataMergeObjectIndex();
             }
+
+            if (showDialog)
+            {
+                AlertsMessage alertsMessage = new AlertsMessage();
+                alertsMessage.ShowDialog("", "The file was not added successfully, please select the file again.", "OK");
+                if (alertsMessage.result == ContentResult.Ok)
+                {
+                }
+            }
         }
         #endregion
     }

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

@@ -1,10 +1,13 @@
 using ComPDFKit.PDFDocument;
+using Microsoft.Office.Interop.Word;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
 using System;
+using System.Collections.Generic;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 
 using Visibility = System.Windows.Visibility;
@@ -120,21 +123,12 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs
             }
             else
             {
-                if (tempDocument.UnlockWithPassword(Password))
-                {
-                    if (SecurityHelper.CheckHaveAllPermissions(tempDocument))
-                    {
+                if (tempDocument.CheckOwnerPassword(Password))
+                {  
                         var dialogResult = new DialogResult(ButtonResult.OK);
                         dialogResult.Parameters.Add(ParameterNames.Password, Password);
                         dialogResult.Parameters.Add(ParameterNames.PasswordResult, true);
                         RequestClose.Invoke(dialogResult);
-                    }
-                    else
-                    {
-                        IsRightValue = "false";
-                        tempDocument.Release();
-                        tempDocument = CPDFDocument.InitWithFilePath(document.FilePath);
-                    }
                 }
                 else
                 {

+ 216 - 52
PDF Office/ViewModels/FillAndSign/FillAndSignContentViewModel.cs

@@ -52,6 +52,8 @@ using Task = System.Threading.Tasks.Task;
 using Size = System.Windows.Size;
 using System.Windows.Markup;
 using Prism.Services.Dialogs;
+using PDF_Office.ViewModels.Tools.AnnotManager;
+using PDF_Office.Model.FillAndSign;
 
 namespace PDF_Office.ViewModels.FillAndSign
 {
@@ -59,16 +61,22 @@ namespace PDF_Office.ViewModels.FillAndSign
     {
         #region 
         public CPDFViewer PDFViewer;
-        private AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
-        private ViewContentViewModel viewContentViewModel;
+        private AnnotTransfer propertyPanel = new AnnotTransfer();
+        public ViewContentViewModel viewContentViewModel;
         private bool isRightMenuAddAnnot = false;
         private IEventAggregator events;
         public List<List<Point>> ShapePoints = new List<List<Point>>();
-        private string Shape = "HookShape";
+        public string Shape = "HookShape";
+        private bool IsFillAndSign
+        {
+            get;
+
+            set;
+        } = true;
         private PopMenu FreeHandAnnotPopMenu;
         private PopMenu FreeTextAnnotPopMenu;
         private PopMenu MultiAnnotPopMenu;
-        public bool isFirst=true;
+        public bool isFirst = true;
         private IRegionManager regions { get; set; }
         private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
         public static bool IsEdit = false;
@@ -80,7 +88,7 @@ namespace PDF_Office.ViewModels.FillAndSign
 
         private string DateOrText = "";
 
-        private bool _HookShapeIsCheck = true;
+        private bool _HookShapeIsCheck = false;
         public bool HookShapeIsCheck
         {
             get { return _HookShapeIsCheck; }
@@ -108,7 +116,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         string Unicode = "";
         public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events) { }
 
-        public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events,IDialogService dialogService)
+        public FillAndSignContentViewModel(IRegionManager regionManager, IEventAggregator events, IDialogService dialogService)
         {
             dialogs = dialogService;
             regions = regionManager;
@@ -125,6 +133,7 @@ namespace PDF_Office.ViewModels.FillAndSign
             InitSelectFreeTextAnnotMenu();
             InitSelectMultiAnnotMenu();
             SubscribeEvent();
+            InitShapeList();
         }
 
         #region 事件聚合器(来自AnnotToolContentViewModel)
@@ -135,29 +144,31 @@ namespace PDF_Office.ViewModels.FillAndSign
 
         private void FromFillAndSign(FillAndSigntEventArgs obj)
         {
-            if(obj != null)
+            if (obj != null)
             {
-                if(string.IsNullOrEmpty(obj.Unicode) == false)
+                if (string.IsNullOrEmpty(obj.Action) == false)
                 {
-                    if(obj.Unicode == "Clear")
+                    if (obj.Action == "Clear")
                     {
                         viewContentViewModel.FillAndSign.Clear();
                     }
                     else
                     {
-                        if(obj.Annots != null && obj.Annots.Count > 0)
+                        if (obj.Annots != null && obj.Annots.Count > 0)
                         {
                             if (obj.Annots[0].EventType == AnnotArgsType.AnnotFreehand)
                             {
+                                IsFillAndSign = false;
                                 GetFreehand(obj.Annots);
+
                             }
-                            else if(obj.Annots[0].EventType == AnnotArgsType.AnnotFreeText)
+                            else if (obj.Annots[0].EventType == AnnotArgsType.AnnotFreeText)
                             {
                                 GetFreetext(obj.Annots);
                             }
                         }
                     }
-                   
+
                 }
             }
         }
@@ -341,7 +352,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                         FreehandDefault.Opacity = freeHand.Transparency;
                         FreehandDefault.Thickness = freeHand.LineWidth;
                         FreehandDefault.SaveKey = "FillAndSign";
-                        var isSolid = AnnotPropertyPanel.IsSolidStyle(freeHand.LineDash);
+                        var isSolid = AnnotTransfer.IsSolidStyle(freeHand.LineDash);
                         if (isSolid)
                         {
                             FreehandDefault.DashArray = null;
@@ -380,7 +391,7 @@ namespace PDF_Office.ViewModels.FillAndSign
             }
         }
 
-        private DefaultAnnotProperty GetAnnotDefault(AnnotArgsType annotArgsType,string savaKey="")
+        private DefaultAnnotProperty GetAnnotDefault(AnnotArgsType annotArgsType, string savaKey = "")
         {
             var Annot = SettingHelper.GetAnnotDefaultProperty(annotArgsType, savaKey);
             if (Annot == null)
@@ -393,13 +404,13 @@ namespace PDF_Office.ViewModels.FillAndSign
         private void CheckedEvent(object e)
         {
 
-            var control = e as Control;
-        
-            IsEdit = false;
-            
-
-            //NavigateToProperty(control.Name);
-            //不创建注释,属于注释模板
+            var control = e as Control;
+
+            IsEdit = false;
+
+
+            //NavigateToProperty(control.Name);
+            //不创建注释,属于注释模板
             bool isTemplateAnnot = false;
             bool isSnapshotEdit = false;
             AnnotHandlerEventArgs annotArgs = null;
@@ -456,7 +467,7 @@ namespace PDF_Office.ViewModels.FillAndSign
         private void InitCheckedEvent(string e)
         {
             IsEdit = false;
-           
+
 
             //NavigateToProperty(control.Name);
             //不创建注释,属于注释模板
@@ -506,19 +517,30 @@ namespace PDF_Office.ViewModels.FillAndSign
                     ShowPropertyPanel(true);
                 }
             }
-         
+
+        }
+        private List<string> ShapeList = new List<string>();
+        private void InitShapeList()
+        {
+            ShapeList.Add("HookShape");
+            ShapeList.Add("ForkShape");
+            ShapeList.Add("RectShape");
+            ShapeList.Add("LineShape");
+            ShapeList.Add("DotShape");
+            ShapeList.Add("Sign");
         }
         //注释工具
         private void FindAnnotTypeKey(string tag, ref AnnotHandlerEventArgs annotArgs, bool isRightMenuAdd = false)
         {
             LineWidthMultiple = 1;
             IsSignPoint = false;
+            Shape = "None";
             switch (tag)
             {
 
-                case "RbtnDate":
-                        DateOrText = "Freetext";
-                        annotArgs = GetFreetext();
+                case "RbtnDate":
+                    DateOrText = "Freetext";
+                    annotArgs = GetFreetext();
                     break;
                 case "RbtnText"://文本
                     DateOrText = "";
@@ -528,8 +550,10 @@ namespace PDF_Office.ViewModels.FillAndSign
                     annotArgs = GetFreetext();
                     break;
                 case "RbtnSign"://签名
+                    Shape = "Sign";
+                    PDFViewer.SetMouseMode(MouseModes.PanTool);
                     annotArgs = GetSignature();
-                    PDFViewer.SetMouseMode(MouseModes.PanTool);//清空其他注释
+                    //清空其他注释
                     break;
                 case "RbtnTick"://勾
                     Shape = "HookShape";
@@ -598,7 +622,7 @@ namespace PDF_Office.ViewModels.FillAndSign
             List<AnnotHandlerEventArgs> stampAnnotArgsList = new List<AnnotHandlerEventArgs>();
             if (stampAnnotArgs != null)
                 stampAnnotArgsList.Add(stampAnnotArgs);
-           
+
             //if (selectedArgs != null) { 
             //var annot = selectedArgs[0];
             //if (annot != null)
@@ -620,7 +644,10 @@ namespace PDF_Office.ViewModels.FillAndSign
         public void SetStamp()
         {
             StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
+            double lineWidthMultiple = LineWidthMultiple;
+            if (Shape == "DotShape") { LineWidthMultiple = 5; }
             stampAnnotArgs.SetInkData(ShapePoints, LineWidth * LineWidthMultiple, (SelectColor as SolidColorBrush).Color);
+            LineWidthMultiple = lineWidthMultiple;
             //PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
             //PDFViewer.SetToolParam(stampArgs);
             //StampAnnotArgs stampAnnotArgs = new StampAnnotArgs();
@@ -648,7 +675,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                 annotArgs.Author = Settings.Default.AppProperties.Description.Author;
                 PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
                 PDFViewer.SetToolParam(annotArgs);
-                
+
                 isRightMenuAddAnnot = false;
             }
 
@@ -717,7 +744,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                     //if (ListPoint((item as FreehandAnnotArgs).RawPointList, ShapePoints)){
                     foreach (var point in viewContentViewModel.FillAndSign)
                     {
-                        if ((item as FreehandAnnotArgs).PageIndex == point.Item1 && (item as FreehandAnnotArgs).AnnotIndex == point.Item2)
+                        if ((item as FreehandAnnotArgs).PageIndex == point.PageIndex && (item as FreehandAnnotArgs).AnnotIndex == point.AnnotIndex)
                         {
 
                             newSelectedArgs.Add(item);
@@ -725,10 +752,10 @@ namespace PDF_Office.ViewModels.FillAndSign
                     }
 
                 }
-                freehandArgs.RawPointList = ShapePoints;
-                freehandArgs.InkColor = (SelectColor as SolidColorBrush).Color;
-                freehandArgs.Transparency = 1;
-                freehandArgs.LineWidth = LineWidth;
+                //freehandArgs.RawPointList = ShapePoints;
+                //freehandArgs.InkColor = (SelectColor as SolidColorBrush).Color;
+                //freehandArgs.Transparency = 1;
+                //freehandArgs.LineWidth = LineWidth;
                 annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
                 annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
                 annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
@@ -865,19 +892,94 @@ namespace PDF_Office.ViewModels.FillAndSign
                 if (annots.Count > 1)
                 {
                     if (propertyPanel.AnnotEvents == null)
-                        propertyPanel.AnnotEvents = new List<AnnotAttribEvent>();
-                    
+                        propertyPanel.AnnotEvents = new List<AnnotAttribEvent>();
+
                     propertyPanel.AnnotEvents.Clear();
 
                     foreach (var itemAnnot in annots)
-                    {
+                    {
+                        for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
+                        {
+                            //annotAttribsList = itemAnnot.GetAnnotAttrib();
+                            //annotAttribsList[AnnotAttrib.Width] = (itemAnnot as FreehandAnnotArgs).Width;
+                            //annotAttribsList[AnnotAttrib.Height] = (itemAnnot as FreehandAnnotArgs).Height;
+                            if (viewContentViewModel.FillAndSign[j].PageIndex == itemAnnot.PageIndex && viewContentViewModel.FillAndSign[j].AnnotIndex == itemAnnot.AnnotIndex)
+                            {
+                                FreehandAnnotArgs freehandArgs = null;
+                                freehandArgs = itemAnnot as FreehandAnnotArgs;
+                                annotAttribsList = itemAnnot.GetAnnotAttrib();
+                                annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
+                                annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
+                                annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
+                                annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
+                                annotAttribsList[AnnotAttrib.Path] = freehandArgs.RawPointList;
+                                annotAttribsList[AnnotAttrib.Width] = freehandArgs.Width;
+                                annotAttribsList[AnnotAttrib.Height] = freehandArgs.Height;
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[0])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
+                                //}
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[1])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
+                                //}
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[2])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
+                                //}
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[3])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(28, 3.20001) } };
+                                //}
+                                //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[4])
+                                //{
+                                //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
+                                //}
+                            }
+                        }
                         var eventitem = AnnotAttribEvent.GetAnnotAttribEvent(itemAnnot, annotAttribsList);
                         //PDFViewer.SelectAnnotation(itemAnnot.PageIndex, itemAnnot.AnnotIndex);
                         propertyPanel.AnnotEvents.Add(eventitem);
 
                     }
                 }
-
+                for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
+                {
+
+                    if (viewContentViewModel.FillAndSign[j].PageIndex == annots[0].PageIndex && viewContentViewModel.FillAndSign[j].AnnotIndex == annots[0].AnnotIndex)
+                    {
+                        FreehandAnnotArgs freehandArgs = null;
+                        freehandArgs = annots[0] as FreehandAnnotArgs;
+                        annotAttribsList = annots[0].GetAnnotAttrib();
+                        annotAttribsList[AnnotAttrib.Color] = freehandArgs.InkColor;
+                        annotAttribsList[AnnotAttrib.Transparency] = freehandArgs.Transparency;
+                        annotAttribsList[AnnotAttrib.Thickness] = freehandArgs.LineWidth;
+                        annotAttribsList[AnnotAttrib.NoteText] = freehandArgs.Content;
+                        annotAttribsList[AnnotAttrib.Path] = freehandArgs.RawPointList;
+                        annotAttribsList[AnnotAttrib.Width] = freehandArgs.Width;
+                        annotAttribsList[AnnotAttrib.Height] = freehandArgs.Height;
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[0])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
+                        //}
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[1])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
+                        //}
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[2])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
+                        //}
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[3])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(28, 3.20001) } };
+                        //}
+                        //if (viewContentViewModel.FillAndSign[j].Shape == ShapeList[4])
+                        //{
+                        //    annotAttribsList[AnnotAttrib.Path] = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
+                        //}
+                    }
+                }
                 propertyPanel.AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annots[0], annotAttribsList);
                 if (annots[0] is LinkAnnotArgs && annotAttribEvent != null)
                 {
@@ -900,19 +1002,21 @@ namespace PDF_Office.ViewModels.FillAndSign
 
                 if (isUpData) { return; }
 
-                if (viewContent == "ShapFillProperty") {
-                    
-                    NavigateToProperty(viewContent, propertyPanel); return; }
+                if (viewContent == "ShapFillProperty")
+                {
+                    NavigateToProperty(viewContent, propertyPanel); return;
+                }
                 viewContentViewModel.SelectedPrpoertyPanel(viewContent, propertyPanel);
             }
 
         }
 
-        private void NavigateToProperty(string btnName, AnnotPropertyPanel annotPropertyPanel)
+        private void NavigateToProperty(string btnName, AnnotTransfer annotPropertyPanel)
         {
             NavigationParameters values = new NavigationParameters();
             values.Add(ParameterNames.PDFViewer, PDFViewer);
             values.Add(ParameterNames.PropertyPanelContentViewModel, annotPropertyPanel);
+            values.Add("IsFillAndSign", IsFillAndSign);
             values.Add("Shape", Shape);
             values.Add("FillAndSignContentViewModel", this);
             regions.RequestNavigate(RegionNames.PropertyRegionName, btnName, values);
@@ -1163,9 +1267,9 @@ namespace PDF_Office.ViewModels.FillAndSign
 
                                     case AnnotArgsType.AnnotFreehand:
                                         e.PopupMenu = FreeHandAnnotPopMenu.OpenMenu(selectedAnnot, sender);
-                                        break;
-                                        case AnnotArgsType.AnnotFreeText:
-                                        e.PopupMenu= FreeTextAnnotPopMenu.OpenMenu(selectedAnnot, sender);
+                                        break;
+                                    case AnnotArgsType.AnnotFreeText:
+                                        e.PopupMenu = FreeTextAnnotPopMenu.OpenMenu(selectedAnnot, sender);
                                         break;
 
                                 }
@@ -1479,13 +1583,36 @@ namespace PDF_Office.ViewModels.FillAndSign
                 for (int i = 0; i < e.Count; i++)
                 {
                     AnnotEditEvent editEvent = e[i];
+                    int pageindex = editEvent.PageIndex;
+                    int annotindex = editEvent.AnnotIndex;
                     switch (editEvent.EditAction)
                     {
                         case ActionType.Add:
-                            int pageindex = editEvent.PageIndex;
-                            int annotindex = editEvent.AnnotIndex;
-                            viewContentViewModel.FillAndSign.Add(new Tuple<int,int>(pageindex, annotindex));
-                             PDFViewer.SelectAnnotation(pageindex, annotindex);
+
+                            if (Shape != "None") { if (Shape == "Sign") { viewContentViewModel.AnnotSignatures.Add(new Tuple<int, int>(pageindex, annotindex)); } else { viewContentViewModel.FillAndSign.Add(new FillAndSignIsShape(pageindex, annotindex, Shape)); } }
+                            PDFViewer.SelectAnnotation(pageindex, annotindex);
+                            break;
+                        case ActionType.Del:
+                            if (Shape != "None")
+                            {
+                                for (int j = 0; j < viewContentViewModel.FillAndSign.Count; j++)
+                                {
+                                    if (viewContentViewModel.FillAndSign[j].PageIndex == pageindex && viewContentViewModel.FillAndSign[j].AnnotIndex == annotindex)
+                                    {
+
+                                        viewContentViewModel.FillAndSign.Remove(viewContentViewModel.FillAndSign[j]);
+                                    }
+                                }
+                                for (int j = 0; j < viewContentViewModel.AnnotSignatures.Count; j++)
+                                {
+                                    if (viewContentViewModel.AnnotSignatures[j].Item1 == pageindex && viewContentViewModel.AnnotSignatures[j].Item2 == annotindex)
+                                    {
+
+                                        viewContentViewModel.AnnotSignatures.Remove(viewContentViewModel.AnnotSignatures[j]);
+                                    }
+                                }
+                            }
+
                             break;
                     }
                 }
@@ -1550,7 +1677,7 @@ namespace PDF_Office.ViewModels.FillAndSign
                             else
                             {
                                 ShowPropertyPanel();
-                               
+
                             }
                         }
                     }
@@ -1675,10 +1802,44 @@ namespace PDF_Office.ViewModels.FillAndSign
             {
 
                 case AnnotArgsType.AnnotFreeText:
+
                     GetFreetext(e.AnnotItemsList);
                     break;
 
                 case AnnotArgsType.AnnotFreehand:
+                   
+                    bool isDifferen = false;
+                    foreach (var point in viewContentViewModel.FillAndSign)
+                    {
+                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                        {
+                            isDifferen = true;
+                            break;
+                        }
+                        else
+                        {
+                            isDifferen = false;
+                        }
+                    }
+                    if (!isDifferen)
+                    {
+                        foreach (var point in viewContentViewModel.AnnotSignatures)
+                        {
+                            if (annot.PageIndex == point.Item1 && annot.AnnotIndex == point.Item2)
+                            {
+                                isDifferen = true;
+                                break;
+                            }
+                            else
+                            {
+                                isDifferen = false;
+                            }
+                        }
+                        if (isDifferen)
+                        {
+                            ShowPropertyPanel(true); AddToPropertyPanel("SignatureAnnotProperty"); return; }
+                        viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null); return;
+                    }
                     GetFreehand(e.AnnotItemsList);
                     break;
 
@@ -1713,12 +1874,15 @@ namespace PDF_Office.ViewModels.FillAndSign
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
+            IsFillAndSign = true;
             navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
-            BindingPDFViewerHandler();
+            BindingPDFViewerHandler();
             HookShapeIsCheck = true;
+            HookShapeIsCheck = false;
             InitFillAndSignProperty();
-            InitCheckedEvent("RbtnTick");
+            ShowPropertyPanel(false);
+            // InitCheckedEvent("RbtnTick");
             IsEdit = false;
 
         }

+ 127 - 30
PDF Office/ViewModels/FillAndSign/PropertyPanel/ShapFillPropertyViewModel.cs

@@ -21,6 +21,8 @@ using Point = System.Windows.Point;
 using static Dropbox.Api.UsersCommon.AccountType;
 using PDF_Office.Model.AnnotPanel;
 using PDFSettings;
+using PDF_Office.ViewModels.Tools.AnnotManager;
+using Prism.Common;
 
 namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 {
@@ -28,10 +30,12 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
     {
         public AnnotAttribEvent AnnotEvent { get; set; }
         private AnnotHandlerEventArgs Annot;
-        private AnnotPropertyPanel PropertyPanel;
+        private AnnotTransfer PropertyPanel;
         private FillAndSignContentViewModel fillAndSignContentViewModel;
         public List<List<Point>> updatapath = new List<List<Point>>();
         private Geometry dataPath = null;
+        private bool IsFillAndSign = false;
+        public string Shape = "";
         public Geometry DataPath
         {
             get { return dataPath; }
@@ -57,12 +61,13 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                     fillAndSignContentViewModel.SelectColor = value;
                     //if (FillAndSignContentViewModel.IsEdit)
                     {
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
+                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Color, (selectColor as SolidColorBrush).Color);
                     }
                     //else
                     {
-                        fillAndSignContentViewModel.SetStamp();
+                        if(IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                        
                     }
 
                 }
@@ -88,7 +93,8 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 
                     //else
                     {
-                        fillAndSignContentViewModel.SetStamp();
+                        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                        
                     }
 
                 }
@@ -108,8 +114,8 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
         {
             get { return _isSelected; }
             set => SetProperty(ref _isSelected, value);
-        }
-
+        }
+        private double lineWidthMultiple=1;
         private double lineWidth = 1;
         public double LineWidth
         {
@@ -124,15 +130,18 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                     //if (FillAndSignContentViewModel.IsEdit)
                     {
 
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Height, 60);
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Width, 60);
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
-                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                        //PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Height, 60);
+                        //PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Width, 60);
+                        //if (Shape == "DotShape") { lineWidthMultiple = 5; }
+                        PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * lineWidthMultiple);
+                        //fillAndSignContentViewModel.LineWidthMultiple = lineWidthMultiple;
+                         //PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
 
                     }
-                   // else
+                    // else
                     {
-                        fillAndSignContentViewModel.SetStamp();
+                        if (IsFillAndSign) { fillAndSignContentViewModel.SetStamp(); }
+                        
                     }
 
                 }
@@ -193,8 +202,9 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 
         private void SharpsType(string tag, object obj, bool isFromToolsBtn = false)
         {
-            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
             fillAndSignContentViewModel.LineWidthMultiple = 1;
+            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+            lineWidthMultiple = 1;
             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Width, 60);
             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Height, 60);
             switch (tag)
@@ -209,6 +219,20 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                         updatapath = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
 
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                        if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                        {
+                            foreach (var annot in PropertyPanel.annotlists)
+                            {
+
+                                foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                {
+                                    if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                    {
+                                        point.Shape = "HookShape";
+                                    }
+                                }
+                            }
+                        }
                     }
                     //PropertyPanel.UpdateAnnotAAttrib();
                     //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(0.599976, 7.0286), new Point(5.57775, 11.8), new Point(13.4, 1.40002) } };
@@ -220,11 +244,26 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                     var forkShape = new PathGeometry();
                     forkShape.AddGeometry(Geometry.Parse("M3.19995 3.20001L12.8 12.8 M12.8 3.20001L3.20005 12.8"));
                     DataPath = forkShape;
-                   // if (FillAndSignContentViewModel.IsEdit)
+                    // if (FillAndSignContentViewModel.IsEdit)
                     {
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
                         updatapath = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
                         PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                        if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                        {
+                            foreach (var annot in PropertyPanel.annotlists)
+                            {
+
+                                foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                {
+                                    if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                    {
+                                        point.Shape = "ForkShape";
+                                    }
+                                }
+                            }
+                        }
+
                     }
                     //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(12.8, 12.8) }, new List<Point> { new Point(12.8, 3.20001), new Point(3.20005, 12.8) } };
                     //fillAndSignContentViewModel.SetStamp();
@@ -241,6 +280,20 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
                             updatapath = new List<List<Point>> { new List<Point> { new Point(5, 5), new Point(28, 5) }, new List<Point> { new Point(28, 5), new Point(28, 27) }, new List<Point> { new Point(28, 27), new Point(5, 27) }, new List<Point> { new Point(5, 27), new Point(5, 5) } };
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                            if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                            {
+                                foreach (var annot in PropertyPanel.annotlists)
+                                {
+
+                                    foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                    {
+                                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                        {
+                                            point.Shape = "RectShape";
+                                        }
+                                    }
+                                }
+                            }
                         }
                         //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(0.19995, 5), new Point(28, 5), new Point(28, 27), new Point(0.19995, 27), new Point(0.19995, 5) } };
                         //fillAndSignContentViewModel.SetStamp();
@@ -253,11 +306,25 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                         var lineShape = new PathGeometry();
                         lineShape.AddGeometry(Geometry.Parse(" M0,10L20,10"));
                         DataPath = lineShape;
-                       // if (FillAndSignContentViewModel.IsEdit)
+                        // if (FillAndSignContentViewModel.IsEdit)
                         {
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
                             updatapath = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.20001), new Point(28, 3.20001) } };
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                            if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                            {
+                                foreach (var annot in PropertyPanel.annotlists)
+                                {
+
+                                    foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                    {
+                                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                        {
+                                            point.Shape = "LineShape";
+                                        }
+                                    }
+                                }
+                            }
                         }
                         //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(12.19995, 10), new Point(36, 10) } };
                         //fillAndSignContentViewModel.SetStamp();
@@ -267,19 +334,33 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                     break;
 
                 case "DotShape":
-                    {
+                    {
+                        fillAndSignContentViewModel.LineWidthMultiple = 5;
                         EllipseGeometry circlePath = new EllipseGeometry();
                         circlePath.RadiusX = 2.4;
                         circlePath.RadiusY = 2.4;
                         circlePath.Center = new Point(2.4, 2.4);
                         DataPath = circlePath;
-                       // if (FillAndSignContentViewModel.IsEdit)
+                        // if (FillAndSignContentViewModel.IsEdit)
                         {
-                            fillAndSignContentViewModel.LineWidthMultiple = 4;
+                            lineWidthMultiple = 5;
                             updatapath = new List<List<Point>> { new List<Point> { new Point(3.19995, 3.19995), new Point(3.19995, 3.19995) } };
-                            PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * fillAndSignContentViewModel.LineWidthMultiple);
+                            PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Thickness, LineWidth * 5);
                             PropertyPanel.UpdateAnnotAAttrib(AnnotAttrib.Path, updatapath);
+                            if (PropertyPanel.annotlists != null && PropertyPanel.annotlists.Count >= 1)
+                            {
+                                foreach (var annot in PropertyPanel.annotlists)
+                                {
 
+                                    foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                                    {
+                                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                                        {
+                                            point.Shape = "DotShape";
+                                        }
+                                    }
+                                }
+                            }
                         }
                         //fillAndSignContentViewModel.ShapePoints = new List<List<Point>> { new List<Point> { new Point(0.19995, 1.19995), new Point(0.19995, -1.19995) }, new List<Point> { new Point(-0.25995, 0.89995), new Point(0.25995, -0.89995) }, new List<Point> { new Point(-1.19995, 0.19995), new Point(0.19995, 1.19995) } };
                         //fillAndSignContentViewModel.SetStamp();
@@ -296,7 +377,7 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
 
         private void InitSharpsType(string tag)
         {
-
+            fillAndSignContentViewModel.LineWidthMultiple = 1;
             switch (tag)
             {
                 case "HookShape":
@@ -329,7 +410,8 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                     break;
 
                 case "DotShape":
-                    {
+                    {
+                        fillAndSignContentViewModel.LineWidthMultiple = 5;
                         EllipseGeometry circlePath = new EllipseGeometry();
                         circlePath.RadiusX = 2.4;
                         circlePath.RadiusY = 2.4;
@@ -419,9 +501,12 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             string shape = "";
-            navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
+            navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
             navigationContext.Parameters.TryGetValue<FillAndSignContentViewModel>("FillAndSignContentViewModel", out fillAndSignContentViewModel);
             navigationContext.Parameters.TryGetValue<string>("Shape", out shape);
+            bool isFillAndSign = false;
+            navigationContext.Parameters.TryGetValue<bool>("IsFillAndSign", out isFillAndSign);
+            IsFillAndSign = isFillAndSign;
             InitSharpsType(shape);
             //FillAndSignContentViewModel.IsEdit = false;
             if (PropertyPanel != null)
@@ -449,21 +534,33 @@ namespace PDF_Office.ViewModels.FillAndSign.PropertyPanel
                 }
                 else
                 {
-                    GetAnnotProperty();
-                }
-
+                    GetAnnotProperty(shape);
+                }
+
             }
         }
 
-        private void GetAnnotProperty()
+        private void GetAnnotProperty(string shape)
         {
-            if (Annot is StickyAnnotArgs)
+            if (Annot is FreehandAnnotArgs)
             {
-                var annot = Annot as StickyAnnotArgs;
+                var annot = Annot as FreehandAnnotArgs;
                 if (annot != null)
                 {
-                    SelectColor = new SolidColorBrush(annot.Color);
-                    FillOpacity = annot.Transparency;
+                    //SelectColor = new SolidColorBrush(annot.InkColor);
+                    //FillOpacity = annot.Transparency;
+                    foreach (var point in fillAndSignContentViewModel.viewContentViewModel.FillAndSign)
+                    {
+                        if (annot.PageIndex == point.PageIndex && annot.AnnotIndex == point.AnnotIndex)
+                        {
+                            lineWidthMultiple = 1;
+                            if (point.Shape == "DotShape") {
+                                lineWidthMultiple = 5;
+                            }
+                            InitSharpsType(point.Shape);
+                            Shape=point.Shape;
+                        }
+                    }
                 }
 
             }

+ 8 - 4
PDF Office/ViewModels/HomePanel/PDFTools/QuickToolsContentViewModel.cs

@@ -131,7 +131,7 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
                 toolItem.FnType == PDFFnType.PDFToPPT|| toolItem.FnType == PDFFnType.Batch ||
                 toolItem.FnType == PDFFnType.Merge)
             {
-                dlg.Multiselect = true;
+                //dlg.Multiselect = true;
             }
             if (toolItem.FnType == PDFFnType.ImageToPDF)
             {
@@ -301,6 +301,7 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
                         viewer.InitDocument(dlg.FileName);
                         if (!CheckPassword(viewer)) { return; }
                         DialogParameters convertpdftoimage = new DialogParameters();
+                        convertpdftoimage.Add("PageRangeComboBoxCurrentPage", true);
                         convertpdftoimage.Add(ParameterNames.PDFViewer, viewer);
                         dialogs.ShowDialog(DialogNames.ConverterImgDialog, convertpdftoimage, e =>
                         {
@@ -321,6 +322,7 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
                         if (!CheckPassword(viewer)) { return; }
                         DialogParameters convertpdftoexcel = new DialogParameters();
                         convertpdftoexcel.Add(ParameterNames.PDFViewer, viewer);
+                        convertpdftoexcel.Add("PageRangeComboBoxCurrentPage", true);
                         dialogs.ShowDialog(DialogNames.ConverterExcelDialog, convertpdftoexcel, e =>
                         {
                             ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
@@ -337,9 +339,10 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
                     case PDFFnType.PDFToPPT:
                         viewer.InitDocument(dlg.FileName);
                         if (!CheckPassword(viewer)) { return; }
-                        DialogParameters convertpdf = new DialogParameters();
-                        convertpdf.Add(ParameterNames.PDFViewer, viewer);
-                        dialogs.ShowDialog(DialogNames.ConverterPPTDialog, convertpdf, e =>
+                        DialogParameters convertpdftoPPT = new DialogParameters();
+                        convertpdftoPPT.Add(ParameterNames.PDFViewer, viewer);
+                        convertpdftoPPT.Add("PageRangeComboBoxCurrentPage", true);
+                        dialogs.ShowDialog(DialogNames.ConverterPPTDialog, convertpdftoPPT, e =>
                         {
                             ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();
                             converterDialogsModel.OnOpened((DialogResult)e);
@@ -358,6 +361,7 @@ namespace PDF_Office.ViewModels.HomePanel.PDFTools
                         if (!CheckPassword(viewer)) { return; }
                         DialogParameters convertpdftoword = new DialogParameters();
                         convertpdftoword.Add(ParameterNames.PDFViewer, viewer);
+                        convertpdftoword.Add("PageRangeComboBoxCurrentPage", true);
                         dialogs.ShowDialog(DialogNames.ConverterWordDialog, convertpdftoword, e =>
                         {
                             ConverterDialogsModel converterDialogsModel = new ConverterDialogsModel();

+ 16 - 5
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -276,9 +276,12 @@ namespace PDF_Office.ViewModels
                         //新用户弹出引导弹窗
                         if (Settings.Default.IsNewUser)
                         {
-                            ShowGuidDialog();
-                            Settings.Default.IsNewUser = false;
-                            Settings.Default.Save();
+                            if (ShowGuidDialog())
+                            {
+                                //未点击下次再看时,下次启动窗体不再显示
+                                Settings.Default.IsNewUser = false;
+                                Settings.Default.Save();
+                            }
                         }
                     }
                     catch { }
@@ -326,9 +329,17 @@ namespace PDF_Office.ViewModels
         }
 
         //显示新手引导弹窗
-        private void ShowGuidDialog()
+        private bool ShowGuidDialog()
         {
-            dialogs.ShowDialog(DialogNames.GuidDialog);
+            bool result = true;
+            dialogs.ShowDialog(DialogNames.GuidDialog, null, r =>
+            {
+                if(r.Result == ButtonResult.Ignore)
+                {
+                    result = false;
+                }
+            });
+            return result;
         }
 
         //打开注册弹窗

+ 19 - 34
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -6,6 +6,7 @@ using PDF_Office.Model;
 using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
+using PDF_Office.ViewModels.Tools.AnnotManager;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -23,6 +24,7 @@ using System.Windows.Media;
 
 namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 {
+    //橡皮擦的UI大小效果
     public class EraseThicknessConverter : IValueConverter
     {
         public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
@@ -45,7 +47,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         #region 文案
 
 
-        private void InitSting()
+        private void InitString()
         {
 
         }
@@ -89,7 +91,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public AnnotAttribEvent AnnotEvent { get; set; }
         private AnnotHandlerEventArgs Annot;
-        private AnnotPropertyPanel PropertyPanel;
+        private AnnotTransfer PropertyPanel;
         public DelegateCommand<object> EraseCommand { get; set; }
         public DelegateCommand<object> PenCommand { get; set; }
 
@@ -101,16 +103,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public FreehandAnnotPropertyViewModel()
         {
+            //选择工具
             EraseCommand = new DelegateCommand<object>(Erase_Command);
             PenCommand = new DelegateCommand<object>(Pen_Command);
-
+            //手绘属性
             SelectedColorChangedCommand = new DelegateCommand<object>(SelectedColorChanged);
             SelectPenThickChangedCommand = new DelegateCommand<object>(SelectPenThickChanged);
             SetEraserThickCommand = new DelegateCommand<object>(SelectEraserThickChanged);
             LineModeCheckedCommand = new DelegateCommand<object>(LineMode_Checked);
             SelectedOpacityValueCommand = new DelegateCommand<object>(SelectedOpacityValue);
-            InitSting();
-
+            //初始化
+            InitString();
             InitVariable();
         }
 
@@ -121,6 +124,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             InitColorItems();
         }
 
+        //画笔的大小列表
         private void InitPenSizeItems()
         {
             PenSizeItems = new List<ComboDataItem>();
@@ -136,6 +140,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             PenSizeItems.Add(item);
         }
 
+        //橡皮擦的大小列表
         private void InitEraserSizeItems()
         {
             EraserSizeItems = new List<ComboDataItem>();
@@ -223,7 +228,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
                 }
                 
-                AnnotEvent?.UpdateAnnot();
             }
         }
 
@@ -288,7 +292,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-            navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
+            navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
 
             if (PropertyPanel != null)
             {
@@ -307,7 +311,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 if (BasicVm.IsMultiSelected)
                 {
                     IsAttributeEquals();
-                    BasicVm.IsDashLine = BasicVm.IsSolidLine = false;
                 }
                 else
                 {
@@ -355,7 +358,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.InkColor.A != item.InkColor.A || temp.InkColor.R != item.InkColor.R || temp.InkColor.G != item.InkColor.G || temp.InkColor.B != item.InkColor.B)
                         {
-                            BasicVm.FontColor = new SolidColorBrush(Colors.Transparent);
+                            BasicVm.FontColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["Color"] = true;
                         }
                     }
@@ -377,7 +380,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
                     if(isNoEqualsDir["ThickSolidDashStyle"] == false)
                     {
-                        if(isSolidStyle(temp) != isSolidStyle(item))
+                        if (AnnotTransfer.IsSolidStyle(temp.LineDash) != AnnotTransfer.IsSolidStyle(item.LineDash))
                         {
                             isNoEqualsDir["ThickSolidDashStyle"] = true;
                         }
@@ -396,35 +399,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 }
 
                 if(isNoEqualsDir["ThickSolidDashStyle"] == true)
-                {
-                    var isSolid = isSolidStyle(temp);
-                    BasicVm.IsSolidLine = isSolid;
-                    BasicVm.IsDashLine = !isSolid;
-                }
-                else
                 {
                     BasicVm.IsSolidLine = BasicVm.IsDashLine = false;
+                   
                 }
-            }
-        }
-        //外部UI控件选中状态
-        private bool isSolidStyle(FreehandAnnotArgs annot)
-        {
-            bool isSolid = true;
-            if (annot.LineDash != null && annot.LineDash.Dashes.Count > 0)
-            {
-                foreach (var item in annot.LineDash.Dashes)
+                else
                 {
-                    if (item > 0)
-                    {
-                      
-                        isSolid = false;
-                        break;
-                    }
+                    var isSolid = AnnotTransfer.IsSolidStyle(temp.LineDash);
+                    BasicVm.IsSolidLine = isSolid;
+                    BasicVm.IsDashLine = !isSolid;
                 }
             }
-            return isSolid;
-            
         }
 
         private void GetAnnotProperty()
@@ -438,7 +423,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     BasicVm.FontColor = new SolidColorBrush(annot.InkColor);
                     BasicVm.AnnotThickness = annot.LineWidth;
                     BasicVm.Dash = annot.LineDash;
-                    var isSolid = isSolidStyle(annot);
+                    var isSolid = AnnotTransfer.IsSolidStyle(annot.LineDash);
                     BasicVm.IsSolidLine = isSolid;
                     BasicVm.IsDashLine = !isSolid;
  

+ 5 - 4
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -5,6 +5,7 @@ using PDF_Office.Model;
 using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
+using PDF_Office.ViewModels.Tools.AnnotManager;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -107,7 +108,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public AnnotAttribEvent AnnotEvent { get; set; }
         private FreeTextAnnotArgs Annot;
-        private AnnotPropertyPanel PropertyPanel;
+        private AnnotTransfer PropertyPanel;
 
         public DelegateCommand SelectedPresetFontCommand { get; set; }
         public DelegateCommand FontFamilyChangedCommand { get; set; }
@@ -493,7 +494,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-            navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
+            navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
             if (PropertyPanel != null)
             {
                
@@ -590,7 +591,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.FontColor.A != item.FontColor.A || temp.FontColor.R != item.FontColor.R || temp.FontColor.G != item.FontColor.G || temp.FontColor.B != item.FontColor.B)
                         {
-                            FontVm.FontColor = new SolidColorBrush(Colors.Transparent);
+                            FontVm.FontColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["FontColor"] = true;
                         }
                     }
@@ -599,7 +600,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.BgColor.A != item.BgColor.A || temp.BgColor.R != item.BgColor.R || temp.BgColor.G != item.BgColor.G || temp.BgColor.B != item.BgColor.B)
                         {
-                            BasicVm.FillColor = new SolidColorBrush(Colors.Transparent);
+                            BasicVm.FillColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["FillColor"] = true;
                         }
                     }

+ 3 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/LinkAnnotPropertyViewModel.cs

@@ -34,6 +34,7 @@ using Prism.Events;
 using Prism.Services.Dialogs;
 using PDF_Office.Views.BOTA;
 using ImTools;
+using PDF_Office.ViewModels.Tools.AnnotManager;
 
 namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 {
@@ -473,7 +474,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         private CPDFDocument document;
         private Button btnGOorBack = null;
         private LinkAnnotProperty linkAnnot;
-        private AnnotPropertyPanel propertyPanel;
+        private AnnotTransfer propertyPanel;
         private ViewContentViewModel viewContentViewModel;
 
         public IRegionManager region;
@@ -1151,7 +1152,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-            navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out propertyPanel);
+            navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out propertyPanel);
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
             navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
 

+ 13 - 12
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs

@@ -6,6 +6,7 @@ using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.Model.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
+using PDF_Office.ViewModels.Tools.AnnotManager;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -379,10 +380,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public AnnotAttribEvent AnnotEvent { get; set; }
         private AnnotHandlerEventArgs Annot;
-        private AnnotPropertyPanel PropertyPanel;
+        private AnnotTransfer PropertyPanel;
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-            navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
+            navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
             if (PropertyPanel != null)
             {
                 AnnotEvent = PropertyPanel.AnnotEvent;
@@ -441,7 +442,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.BgColor.A != item.BgColor.A || temp.BgColor.R != item.BgColor.R || temp.BgColor.G != item.BgColor.G || temp.BgColor.B != item.BgColor.B)
                         {
-                            BasicVm.FillColor = new SolidColorBrush(Colors.Transparent);
+                            BasicVm.FillColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["FillColor"] = true;
                         }
                     }
@@ -450,7 +451,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.LineColor.A != item.LineColor.A || temp.LineColor.R != item.LineColor.R || temp.LineColor.G != item.LineColor.G || temp.LineColor.B != item.LineColor.B)
                         {
-                            BasicVm.BorderColor = new SolidColorBrush(Colors.Transparent);
+                            BasicVm.BorderColor = new SolidColorBrush(Color.FromArgb(0x01,0xff,0xff,0xff));
                             isNoEqualsDir["LineColor"] = true;
                         }
                     }
@@ -471,7 +472,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
                     if (isNoEqualsDir["ThickSolidDashStyle"] == false)
                     {
-                        if (IsSolidStyle(temp) != IsSolidStyle(item))
+                        if (AnnotTransfer.IsSolidStyle(temp.LineDash) != AnnotTransfer.IsSolidStyle(item.LineDash))
                         {
                             isNoEqualsDir["ThickSolidDashStyle"] = true;
                         }
@@ -498,13 +499,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
                 if (isNoEqualsDir["ThickSolidDashStyle"] == true)
                 {
-                    var isSolid = IsSolidStyle(temp);
-                    BasicVm.IsSolidLine = isSolid;
-                    BasicVm.IsDashLine = !isSolid;
+                    BasicVm.IsSolidLine = BasicVm.IsDashLine = false;
                 }
                 else
                 {
-                    BasicVm.IsSolidLine = BasicVm.IsDashLine = false;
+                    var isSolid = AnnotTransfer.IsSolidStyle(temp.LineDash);
+                    BasicVm.IsSolidLine = isSolid;
+                    BasicVm.IsDashLine = !isSolid;
                 }
 
             }
@@ -517,17 +518,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             if (annot is SquareAnnotArgs)
             {
                 var Square = Annot as SquareAnnotArgs;
-                isSolid = AnnotPropertyPanel.IsSolidStyle(Square.LineDash);
+                isSolid = AnnotTransfer.IsSolidStyle(Square.LineDash);
             }
             else if (annot is CircleAnnotArgs)
             {
                 var Circle = Annot as CircleAnnotArgs;
-                isSolid = AnnotPropertyPanel.IsSolidStyle(Circle.LineDash);
+                isSolid = AnnotTransfer.IsSolidStyle(Circle.LineDash);
             }
             else if (annot is LineAnnotArgs)
             {
                 var line = Annot as LineAnnotArgs;
-                isSolid = AnnotPropertyPanel.IsSolidStyle(line.LineDash);
+                isSolid = AnnotTransfer.IsSolidStyle(line.LineDash);
             }
 
             return isSolid;

+ 13 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePopupViewModel.cs

@@ -82,6 +82,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
+            if(StickyAnnotArgs != null && string.IsNullOrEmpty(StickyAnnotArgs.Content))
+            {
+                PDFViewer.RemovePageAnnot(StickyAnnotArgs.PageIndex, StickyAnnotArgs.AnnotIndex);
+            }
         }
 
         public void OnNavigatedTo(NavigationContext navigationContext)
@@ -90,8 +94,17 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             navigationContext.Parameters.TryGetValue<StickyAnnotArgs>(ParameterNames.StickyAnnotArgs, out StickyAnnotArgs);
             navigationContext.Parameters.TryGetValue<AnnotCommandArgs>(ParameterNames.AnnotCommandArgs, out AnnotCommandArgs);
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
+            SetToolParam();
             AuthorText = Settings.Default.AppProperties.Description.Author;
             DateText = DateTime.Now.ToString("MM/dd/yyyy  hh:mm:ss");
         }
+
+        private void SetToolParam()
+        {
+            if(PDFViewer != null && StickyAnnotArgs != null && string.IsNullOrEmpty(StickyAnnotArgs.Content))
+            {
+                PDFViewer.SetToolParam(StickyAnnotArgs);
+            }
+        }
     }
 }

+ 4 - 3
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -4,6 +4,7 @@ using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
 using PDF_Office.Model.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
+using PDF_Office.ViewModels.Tools.AnnotManager;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -173,10 +174,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public AnnotAttribEvent AnnotEvent { get; set; }
         private AnnotHandlerEventArgs Annot;
-        private AnnotPropertyPanel PropertyPanel;
+        private AnnotTransfer PropertyPanel;
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
-            navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
+            navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
             if (PropertyPanel != null)
             {
                 AnnotEvent = PropertyPanel.AnnotEvent;
@@ -232,7 +233,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         if (temp.Color.A != item.Color.A || temp.Color.R != item.Color.R || temp.Color.G != item.Color.G || temp.Color.B != item.Color.B)
                         {
-                            SharpColor = new SolidColorBrush(Colors.Transparent);
+                            SharpColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                             isNoEqualsDir["SharpColor"] = true;
                         }
                     }

+ 4 - 3
PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs

@@ -5,6 +5,7 @@ using PDF_Office.Model;
 using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Properties;
 using PDF_Office.ViewModels.Tools;
+using PDF_Office.ViewModels.Tools.AnnotManager;
 using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -87,7 +88,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public AnnotAttribEvent AnnotEvent { get; set; }
         private AnnotHandlerEventArgs Annot;
-        private AnnotPropertyPanel PropertyPanel;
+        private AnnotTransfer PropertyPanel;
         public DelegateCommand<object> SelectedColorChangedCommand { get; set; }
         public DelegateCommand<object> SelectedOpacityChangedCommand { get; set; }
 
@@ -185,7 +186,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
 
-            navigationContext.Parameters.TryGetValue<AnnotPropertyPanel>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
+            navigationContext.Parameters.TryGetValue<AnnotTransfer>(ParameterNames.PropertyPanelContentViewModel, out PropertyPanel);
             if(PropertyPanel != null)
             {
                 AllVariable();
@@ -203,7 +204,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     }
                     else
                     {
-                        BasicVm.FontColor = new SolidColorBrush(Colors.Transparent);
+                        BasicVm.FontColor = new SolidColorBrush(Color.FromArgb(0x01, 0xff, 0xff, 0xff));
                     }
                     
                 }

+ 1 - 5
PDF Office/ViewModels/TipContent/FileRestrictedTipViewModel.cs

@@ -42,15 +42,11 @@ namespace PDF_Office.ViewModels.TipContent
                 if (result.Password != null)
                 {
                     string filePath = PDFViewer.Document.FilePath;
-                    PDFViewer.CloseDocument();
-                    PDFViewer.InitDocument(filePath);
-                    PDFViewer.Document.UnlockWithPassword(result.Password);
-                    PDFViewer.Load();
+                    PDFViewer.Document.CheckOwnerPassword(result.Password);
                 }
                 ///TODO:
                 ///此处填入需要执行的代码
             this.eventAggregator.GetEvent<ShowTipEvent>().Publish(new ShowTipEventArgs() { enumTipKind = EnumTipKind.StatusNone, Unicode = unicode });
-
             }
         }
 

+ 218 - 0
PDF Office/ViewModels/Tools/AnnotManager/AnnotTransfer.cs

@@ -0,0 +1,218 @@
+using ComPDFKitViewer;
+using ComPDFKitViewer.AnnotEvent;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Media;
+
+namespace PDF_Office.ViewModels.Tools.AnnotManager
+{
+    /// <summary>
+    /// 注释面板与外部(如注释工具)关联
+    /// </summary>
+    public class AnnotTransfer
+    {
+        public event EventHandler<Dictionary<AnnotArgsType, object>> DataChanged;
+        public event EventHandler<Dictionary<AnnotArgsType, object>> AnnotTypeChanged;
+
+        public bool IsAddLink = false;
+        public bool IsLocationLink = false;
+        public AnnotAttribEvent AnnotEvent { get; set; }
+        public List<AnnotAttribEvent> AnnotEvents = new List<AnnotAttribEvent>();
+
+        public AnnotHandlerEventArgs annot;
+        public List<AnnotHandlerEventArgs> annotlists;
+
+        //是否为填写与签名的日期文本
+        public bool IsTextFill { get; private set; }
+
+        public void SetIsTextFill(bool isTextFill)
+        {
+            IsTextFill = isTextFill;
+        }
+
+        public bool IsMultiSelected
+        { get { return (annotlists != null && annotlists.Count > 1); } }
+
+        public AnnotTransfer()
+        { 
+        
+        }
+
+        #region 静态
+
+        //是否为形状注释
+        public static bool IsShapAnnot(AnnotHandlerEventArgs annot)
+        {
+            if (annot.EventType == AnnotArgsType.AnnotCircle ||
+            annot.EventType == AnnotArgsType.AnnotSquare ||
+            annot.EventType == AnnotArgsType.AnnotLine
+            )
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        //是否为高亮注释
+        public static bool IsHightAnnot(AnnotHandlerEventArgs annot)
+        {
+            if (annot.EventType == AnnotArgsType.AnnotUnderline ||
+            annot.EventType == AnnotArgsType.AnnotSquiggly ||
+            annot.EventType == AnnotArgsType.AnnotHighlight ||
+            annot.EventType == AnnotArgsType.AnnotStrikeout
+            )
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+
+        //判断注释列表是否有不同种类的注释
+        public static bool IsDifferentTypeAnnots(List<AnnotHandlerEventArgs> annotlists)
+        {
+            //如高亮、下划线、删除线,是属于同一种类的注释
+            bool isDifferentAnnotTyle = false;
+            var annot = annotlists[0];
+            var lastAnnot = annot;
+            foreach (var item in annotlists)
+            {
+                if (lastAnnot.EventType != item.EventType)
+                {
+                    if ((AnnotTransfer.IsShapAnnot(annot) == true && AnnotTransfer.IsShapAnnot(item) == true) || (AnnotTransfer.IsHightAnnot(annot) == true && AnnotTransfer.IsHightAnnot(item) == true))
+                    {
+                        lastAnnot = item;
+                        continue;
+                    }
+
+                    lastAnnot = item;
+                    isDifferentAnnotTyle = true;
+                    break;
+                }
+            }
+
+            return isDifferentAnnotTyle;
+        }
+
+        //外部UI控件选中状态
+        public static bool IsSolidStyle(DashStyle LineDash)
+        {
+            bool isSolid = true;
+            if (LineDash == null || LineDash.Dashes.Count == 0)
+            {
+                return isSolid;
+            }
+
+            foreach (var item in LineDash.Dashes)
+            {
+                if (item > 0)
+                {
+                    isSolid = false;
+                    break;
+                }
+            }
+            return isSolid;
+        }
+
+        public static DashStyle GetLineDashStyle(bool isSolid)
+        {
+            DashStyle newDash = new DashStyle();
+            if (isSolid == false)
+            {
+                newDash.Dashes.Add(2);
+                newDash.Dashes.Add(2);
+            }
+            else
+            {
+                newDash = DashStyles.Solid;
+            }
+
+            return newDash;
+        }
+        #endregion 静态
+
+
+        //单个属性更改
+        public void UpdateAnnotAAttrib(AnnotAttrib annotAttrib, object obj)
+        {
+            if (annotlists != null && annotlists.Count > 1)
+            {
+                foreach (var itemevent in AnnotEvents)
+                {
+                    itemevent?.UpdateAttrib(annotAttrib, obj);
+                    itemevent?.UpdateAnnot();
+                }
+            }
+            else
+            {
+                AnnotEvent?.UpdateAttrib(annotAttrib, obj);
+                AnnotEvent?.UpdateAnnot();
+            }
+        }
+
+        //多个属性更改
+        public void UpdateAnnotAllAttribs(Dictionary<AnnotAttrib, object> AnnotAttribDir)
+        {
+            if (annotlists != null && annotlists.Count > 1)
+            {
+                foreach (var itemevent in AnnotEvents)
+                {
+                    foreach (var item in AnnotAttribDir)
+                    {
+                        itemevent?.UpdateAttrib(item.Key, item.Value);
+                    }
+
+                    itemevent?.UpdateAnnot();
+                }
+            }
+            else
+            {
+                foreach (var item in AnnotAttribDir)
+                {
+                    AnnotEvent?.UpdateAttrib(item.Key, item.Value);
+                }
+
+                AnnotEvent?.UpdateAnnot();
+            }
+        }
+
+        //是否为多选
+
+        #region Invoke
+
+        /// <summary>
+        /// 更新多个属性,触发到工具栏注释工具,改变工具图标下的颜色值
+        /// </summary>
+        public void InvokeToMyTools(object sender, Dictionary<AnnotArgsType, object> keyValues)
+        {
+            DataChanged?.Invoke(sender, keyValues);
+        }
+
+        /// <summary>
+        /// 更新单个属性
+        /// </summary>
+        public void InvokeToMyTools(AnnotArgsType argsType, object obj)
+        {
+            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
+            changeData[argsType] = obj;
+            DataChanged?.Invoke(null, changeData);
+        }
+
+        //同一属性面板,切换注释工具
+        public void AnnotTypeChangedInvoke(object sender, Dictionary<AnnotArgsType, object> keyValues)
+        {
+            AnnotTypeChanged?.Invoke(sender, keyValues);
+        }
+
+        #endregion Invoke
+
+    }
+}

+ 154 - 163
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -25,6 +25,8 @@ using System.Windows.Media;
 using System.Diagnostics;
 using PDF_Office.Model.AnnotPanel;
 using System.Windows.Input;
+using PDF_Office.ViewModels.Tools.AnnotManager;
+using ComPDFKit.Import;
 
 namespace PDF_Office.ViewModels.Tools
 {
@@ -38,8 +40,6 @@ namespace PDF_Office.ViewModels.Tools
             //比如在属性面板里更改注释颜色,会同时更新工具栏对应的工具颜色
             propertyPanel.DataChanged -= AnnotPropertyPanel_DataChanged;
             propertyPanel.DataChanged += AnnotPropertyPanel_DataChanged;
-            propertyPanel.DefaultStored -= AnnotProperty_DefaultStored;
-            propertyPanel.DefaultStored += AnnotProperty_DefaultStored;
             propertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
             propertyPanel.AnnotTypeChanged += AnnotPropertyPanel_AnnotTypeChanged;
             //快捷键
@@ -50,7 +50,6 @@ namespace PDF_Office.ViewModels.Tools
         private void UnBindingEvent()
         {
             propertyPanel.DataChanged -= AnnotPropertyPanel_DataChanged;
-            propertyPanel.DefaultStored -= AnnotProperty_DefaultStored;
             propertyPanel.AnnotTypeChanged -= AnnotPropertyPanel_AnnotTypeChanged;
             //快捷盘解绑
             KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
@@ -70,9 +69,6 @@ namespace PDF_Office.ViewModels.Tools
                 PDFViewer.AnnotCommandHandler -= PDFViewer_AnnotCommandHandler;
                 PDFViewer.AnnotCommandHandler += PDFViewer_AnnotCommandHandler;
 
-                PDFViewer.WidgetClickHander -= PDFViewer_WidgetClickHander;
-                PDFViewer.WidgetClickHander += PDFViewer_WidgetClickHander;
-
                 PDFViewer.SnapshotCommandHandler -= PDFViewer_SnapshotCommandHandler;
                 PDFViewer.SnapshotCommandHandler += PDFViewer_SnapshotCommandHandler;
 
@@ -86,45 +82,6 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        private void PDFViewer_PDFActionHandler(object sender, ComPDFKit.PDFDocument.Action.CPDFAction action)
-        {
-            if (action == null)
-            {
-                return;
-            }
-            switch (action.ActionType)
-            {
-                case C_ACTION_TYPE.ACTION_TYPE_GOTO:
-                    if (PDFViewer != null)
-                    {
-                        CPDFGoToAction gotoAction = action as CPDFGoToAction;
-                        CPDFDestination dest = gotoAction.GetDestination(PDFViewer.Document);
-                        if (dest != null)
-                        {
-                            PDFViewer.GoToPage(dest.PageIndex, new System.Windows.Point(0, 0));
-                        }
-                    }
-                    break;
-
-                case C_ACTION_TYPE.ACTION_TYPE_URI:
-                    {
-                        CPDFUriAction uriAction = action as CPDFUriAction;
-                        string uri = uriAction.GetUri();
-                        try
-                        {
-                            if (!string.IsNullOrEmpty(uri))
-                            {
-                                Process.Start(uri);
-                            }
-                        }
-                        catch (Exception ex)
-                        {
-                        }
-                    }
-                    break;
-            }
-        }
-
         private void UnBindingPDFViewerHandler()
         {
             if (PDFViewer != null)
@@ -132,7 +89,6 @@ namespace PDF_Office.ViewModels.Tools
                 PDFViewer.AnnotEditHandler -= PDFViewer_AnnotEditHandler;
                 PDFViewer.AnnotActiveHandler -= PDFViewer_AnnotActiveHandler;
                 PDFViewer.AnnotCommandHandler -= PDFViewer_AnnotCommandHandler;
-                PDFViewer.WidgetClickHander -= PDFViewer_WidgetClickHander;
                 PDFViewer.SnapshotCommandHandler -= PDFViewer_SnapshotCommandHandler;
                 PDFViewer.PDFActionHandler -= PDFViewer_PDFActionHandler;
                 PDFViewer.AnnotHoverHandler -= PDFViewer_AnnotHoverHandler;
@@ -175,39 +131,45 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        //是否为形状注释
-        private bool isShapAnnot(AnnotHandlerEventArgs annot)
+        //超链接跳转
+        private void PDFViewer_PDFActionHandler(object sender, ComPDFKit.PDFDocument.Action.CPDFAction action)
         {
-            if (annot.EventType == AnnotArgsType.AnnotCircle ||
-            annot.EventType == AnnotArgsType.AnnotSquare ||
-            annot.EventType == AnnotArgsType.AnnotLine
-            )
+            if (action == null)
             {
-                return true;
+                return;
             }
-            else
+            switch (action.ActionType)
             {
-                return false;
-            }
-        }
+                case C_ACTION_TYPE.ACTION_TYPE_GOTO:
+                    if (PDFViewer != null)
+                    {
+                        CPDFGoToAction gotoAction = action as CPDFGoToAction;
+                        CPDFDestination dest = gotoAction.GetDestination(PDFViewer.Document);
+                        if (dest != null)
+                        {
+                            PDFViewer.GoToPage(dest.PageIndex, new System.Windows.Point(0, 0));
+                        }
+                    }
+                    break;
 
-        //是否为高亮注释
-        private bool isHightAnnot(AnnotHandlerEventArgs annot)
-        {
-            if (annot.EventType == AnnotArgsType.AnnotUnderline ||
-            annot.EventType == AnnotArgsType.AnnotSquiggly ||
-            annot.EventType == AnnotArgsType.AnnotHighlight ||
-            annot.EventType == AnnotArgsType.AnnotStrikeout
-            )
-            {
-                return true;
-            }
-            else
-            {
-                return false;
+                case C_ACTION_TYPE.ACTION_TYPE_URI:
+                    {
+                        CPDFUriAction uriAction = action as CPDFUriAction;
+                        string uri = uriAction.GetUri();
+                        try
+                        {
+                            if (!string.IsNullOrEmpty(uri))
+                            {
+                                Process.Start(uri);
+                            }
+                        }
+                        catch (Exception ex)
+                        {
+                        }
+                    }
+                    break;
             }
         }
-
         private void GetSelectedAnnots(AnnotAttribEvent e)
         {
             var annot = e.AnnotItemsList[0];
@@ -305,7 +267,7 @@ namespace PDF_Office.ViewModels.Tools
                 return;
 
 
-            var signAnnot = AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
+            var signAnnot = viewContentViewModel.AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
             if (signAnnot == null)
             {
                 if (annot.EventType == AnnotArgsType.AnnotStamp)
@@ -332,13 +294,13 @@ namespace PDF_Office.ViewModels.Tools
 
             if (StrAnnotToolChecked == "Signature")
             {
-                if (AnnotSignatures == null)
-                    AnnotSignatures = new List<Tuple<int, int>>();
+                if (viewContentViewModel.AnnotSignatures == null)
+                    viewContentViewModel.AnnotSignatures = new List<Tuple<int, int>>();
 
-                var signAnnot = AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
+                var signAnnot = viewContentViewModel.AnnotSignatures.FirstOrDefault(temp => temp.Item1 == annot.PageIndex && temp.Item2 == annot.AnnotIndex);
                 if (signAnnot == null)
                 {
-                    AnnotSignatures.Add(new Tuple<int, int>(annot.PageIndex, annot.AnnotIndex));
+                    viewContentViewModel.AnnotSignatures.Add(new Tuple<int, int>(annot.PageIndex, annot.AnnotIndex));
                 }
             }
         }
@@ -447,23 +409,7 @@ namespace PDF_Office.ViewModels.Tools
                     }
                     else
                     {
-                        bool isDifferentAnnotTyle = false;
-                        var lastAnnot = annot;
-                        foreach (var item in e.AnnotItemsList)
-                        {
-                            if (lastAnnot.EventType != item.EventType)
-                            {
-                                if ((isShapAnnot(annot) == true && isShapAnnot(item) == true) || (isHightAnnot(annot) == true && isHightAnnot(item) == true))
-                                {
-                                    lastAnnot = item;
-                                    continue;
-                                }
-
-                                lastAnnot = item;
-                                isDifferentAnnotTyle = true;
-                                break;
-                            }
-                        }
+                        bool isDifferentAnnotTyle = AnnotTransfer.IsDifferentTypeAnnots(e.AnnotItemsList);
 
                         if (isDifferentAnnotTyle)
                             viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
@@ -591,7 +537,7 @@ namespace PDF_Office.ViewModels.Tools
                                 bool isHigh = true;//是否为高亮
                                 foreach (var item in e.AnnotEventArgsList)
                                 {
-                                    if (isHightAnnot(item) == false)
+                                    if (AnnotTransfer.IsHightAnnot(item) == false)
                                     {
                                         isHigh = false;
                                         break;
@@ -600,7 +546,7 @@ namespace PDF_Office.ViewModels.Tools
 
                                 MultiAnnotPopMenu.SetVisual("MultiCopy", !isHigh);
                                 MultiAnnotPopMenu.SetVisual("MultiCut", !isHigh);
-                                e.PopupMenu = MultiAnnotPopMenu.OpenMenu(e.AnnotEventArgsList, sender);//SelectMultiAnnotMenu(e.AnnotEventArgsList, isHigh);
+                                e.PopupMenu = MultiAnnotPopMenu.OpenMenu(e.AnnotEventArgsList, sender);
                             }
                         }
                         if (e.PopupMenu != null)
@@ -691,25 +637,25 @@ namespace PDF_Office.ViewModels.Tools
                 if (annot.EventType == AnnotArgsType.AnnotFreehand)
                 {
                     var freeHand = annot as FreehandAnnotArgs;
-                    isSolidLineDash = AnnotPropertyPanel.IsSolidStyle(freeHand.LineDash);
+                    isSolidLineDash = AnnotTransfer.IsSolidStyle(freeHand.LineDash);
                     FreeHandAnnotPopMenu.SetIsChecked(isSolidLineDash ? "FreeHandSolid" : "FreeHandDash", true);
                 }
                 else if (annot.EventType == AnnotArgsType.AnnotSquare)
                 {
                     var square = annot as SquareAnnotArgs;
-                    isSolidLineDash = AnnotPropertyPanel.IsSolidStyle(square.LineDash);
+                    isSolidLineDash = AnnotTransfer.IsSolidStyle(square.LineDash);
                     ShapeAnnotPopMenu.SetIsChecked(isSolidLineDash ? "ShapeSolid" : "ShapeDash", true);
                 }
                 else if (annot.EventType == AnnotArgsType.AnnotCircle)
                 {
                     var circle = annot as CircleAnnotArgs;
-                    isSolidLineDash = AnnotPropertyPanel.IsSolidStyle(circle.LineDash);
+                    isSolidLineDash = AnnotTransfer.IsSolidStyle(circle.LineDash);
                     ShapeAnnotPopMenu.SetIsChecked(isSolidLineDash ? "ShapeSolid" : "ShapeDash", true);
                 }
                 else if (annot.EventType == AnnotArgsType.AnnotLine)
                 {
                     var line = annot as LineAnnotArgs;
-                    isSolidLineDash = AnnotPropertyPanel.IsSolidStyle(line.LineDash);
+                    isSolidLineDash = AnnotTransfer.IsSolidStyle(line.LineDash);
                     ShapeAnnotPopMenu.SetIsChecked(isSolidLineDash ? "ShapeSolid" : "ShapeDash", true);
                 }
             }
@@ -833,6 +779,8 @@ namespace PDF_Office.ViewModels.Tools
         {
             if (e != null && e.Count > 0)
             {
+                MultipleSelectionAnnot(e);
+
                 for (int i = 0; i < e.Count; i++)
                 {
                     AnnotEditEvent editEvent = e[i];
@@ -840,6 +788,7 @@ namespace PDF_Office.ViewModels.Tools
                     {
                         case ActionType.Add:
 
+                            //BOTA
                             bool isTabItemAnnotation = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemAnnotation");
 
                             if (viewContentViewModel.OpenBOTA == true && isTabItemAnnotation == true)
@@ -854,27 +803,13 @@ namespace PDF_Office.ViewModels.Tools
                                 }
                             }
 
-                            var annot = e[0].EditAnnotArgs;
-                            if (
-                               annot.EventType == AnnotArgsType.AnnotSquare ||
-                               annot.EventType == AnnotArgsType.AnnotCircle ||
-                               annot.EventType == AnnotArgsType.AnnotLine ||
-                               annot.EventType == AnnotArgsType.AnnotStamp
-                               )
+                            //添加书签注释,用于未保存前跟图章手绘注释的区分
+                            if (StrAnnotToolChecked == "Signature")
                             {
-                                PDFViewer.ClearSelectAnnots();
-                                if (StrAnnotToolChecked != "Signature")
-                                {
-                                    PDFViewer.SelectAnnotation(annot.PageIndex, annot.AnnotIndex);
-                                }
-                                else
-                                {
-                                    AddAnnotSignature(annot);
-                                    PDFViewer.SelectAnnotation(annot.PageIndex, annot.AnnotIndex);
-                                } 
+                                AddAnnotSignature(editEvent.EditAnnotArgs);
                             }
-
                             
+
                             break;
 
                         case ActionType.Del:
@@ -923,10 +858,47 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        private void PDFViewer_WidgetClickHander(object sender, WidgetArgs e)
+        //复制多个注释,粘贴后,默认注释未选中状态
+        private void MultipleSelectionAnnot(List<AnnotEditEvent> e)
         {
+            bool isAdd = false;
+            Dictionary<int, List<int>> selectAnnotDicts = new Dictionary<int, List<int>>();
+           
+            foreach (var item in e)
+            {
+                if (item.EditAction == ActionType.Add)
+                {
+                    var annot = item.EditAnnotArgs;
+                    if (annot.EventType == AnnotArgsType.AnnotSquare || annot.EventType == AnnotArgsType.AnnotCircle ||
+                        annot.EventType == AnnotArgsType.AnnotLine || annot.EventType == AnnotArgsType.AnnotStamp || annot.EventType == AnnotArgsType.AnnotFreeText)
+                    {
+                        if (selectAnnotDicts.ContainsKey(item.PageIndex) == false)
+                        {
+                            selectAnnotDicts.Add(item.PageIndex, new List<int>());
+                            selectAnnotDicts[item.PageIndex].Add(item.AnnotIndex);
+                        }
+                        else
+                        {
+                            selectAnnotDicts[item.PageIndex].Add(item.AnnotIndex);
+                        }
+
+                        isAdd = true;
+
+                    }
+
+                }
+
+            }
+
+            if (isAdd)
+            {
+                PDFViewer.ClearSelectAnnots();
+                PDFViewer.SelectAnnotation(selectAnnotDicts);
+            }
+
         }
 
+        //阅读页悬浮相应
         private void PDFViewer_AnnotHoverHandler(object sender, AnnotHoverData e)
         {
             if (e != null && e.DrawContext != null)
@@ -940,43 +912,59 @@ namespace PDF_Office.ViewModels.Tools
                 hoverPen.DashStyle = DashStyles.Dash;
                 e.DrawContext?.DrawRectangle(null, hoverPen, hoverRect);
 
-
                 //便签,显示ToolTip内容
                 if (e.Annot != null && e.Annot.Type == C_ANNOTATION_TYPE.C_ANNOTATION_TEXT)
                 {
-                    if (PDFViewer.ToolTip == null)
-                    {
-                        var content = e.Annot.GetContent();
-                        if (string.IsNullOrEmpty(content) == false)
-                        {
-                            ToolTip TipChild = new ToolTip();
-                            TipChild.Style = App.Current.Resources["FlowToolTip"] as Style;
-                            TipChild.MaxWidth = 246;
-                            TipChild.Content = content;
-                            TipChild.Visibility = Visibility.Visible;
-                            TipChild.IsOpen = true;
-                            TipChild.Placement = PlacementMode.Right;
-                            var rec = e.Annot.GetRect();
-                            TipChild.PlacementRectangle = new Rect(rec.left, rec.top, rec.right, rec.bottom);
-                            TipChild.PlacementTarget = PDFViewer.Parent as ContentControl;
-                            TipChild.Placement = PlacementMode.MousePoint;
-                            PDFViewer.ToolTip = TipChild;
-                            oldRect = hoverRect;
-                            PDFViewer.MouseMove -= PDFViewer_MouseMove;
-                            PDFViewer.MouseMove += PDFViewer_MouseMove;
-                            return;
-                        }
-
-                    }
-
+                    PopAnnotToolTip(e.Annot.GetRect(), hoverRect, e.Annot.GetContent());
+                    return;
                 }
             }
 
             CloseAnnotToolTip();
         }
 
+        private void PDFViewer_MouseMove(object sender, MouseEventArgs e)
+        {
+            if (sender != null && PDFViewer.ToolTip != null && PDFViewer.Parent != null)
+            {
+                //鼠标移到注释之外,关闭ToolTip浮窗
+                var newPoint = e.GetPosition(PDFViewer.Parent as ContentControl);
+                var isOutw = newPoint.X > (oldRect.X + oldRect.Width + 4);
+                var isOuth = newPoint.Y > (oldRect.Y + oldRect.Height + 4);
+                if (newPoint.X < oldRect.X || newPoint.Y < oldRect.Y || isOutw || isOuth)
+                {
+                    CloseAnnotToolTip();
+                }
+            }
+        }
+
         private Rect oldRect = new Rect(0, 0, 0, 0);
+        private void PopAnnotToolTip(CRect placementRect, Rect hoverRect, string content)
+        {
+            //便签,显示ToolTip内容
+            if (PDFViewer.ToolTip == null)
+            {
+                if (string.IsNullOrEmpty(content) == false)
+                {
+                    ToolTip TipChild = new ToolTip();
+                    TipChild.Style = App.Current.Resources["FlowToolTip"] as Style;
+                    TipChild.MaxWidth = 246;
+                    TipChild.Content = content;
+                    TipChild.Visibility = Visibility.Visible;
+                    TipChild.IsOpen = true;
+                    TipChild.Placement = PlacementMode.Right;
+                    TipChild.PlacementRectangle = new Rect(placementRect.left, placementRect.top, placementRect.right, placementRect.bottom);
+                    TipChild.PlacementTarget = PDFViewer.Parent as ContentControl;
+                    TipChild.Placement = PlacementMode.MousePoint;
+                    PDFViewer.ToolTip = TipChild;
+                    oldRect = hoverRect;
+                    PDFViewer.MouseMove -= PDFViewer_MouseMove;
+                    PDFViewer.MouseMove += PDFViewer_MouseMove;
+                }
+            }
+        }
 
+        //关闭ToolTip
         private void CloseAnnotToolTip()
         {
             if (PDFViewer.ToolTip != null && PDFViewer.ToolTip is ToolTip)
@@ -990,28 +978,10 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        private void PDFViewer_MouseMove(object sender, MouseEventArgs e)
-        {
-            if (sender != null && PDFViewer.ToolTip != null && PDFViewer.Parent != null)
-            {
-                var newPoint = e.GetPosition(PDFViewer.Parent as ContentControl);
-                var isOutw = newPoint.X > (oldRect.X + oldRect.Width + 4);
-                var isOuth = newPoint.Y > (oldRect.Y + oldRect.Height + 4);
-                if (newPoint.X < oldRect.X || newPoint.Y < oldRect.Y || isOutw || isOuth)
-                {
-                    CloseAnnotToolTip();
-                }
-            }
-        }
-
         #endregion PDFViewer事件
 
         #region BindingEvent事件
 
-        private void AnnotProperty_DefaultStored(object sender, object e)
-        {
-        }
-
         //同一属性面板,不同的注释类型
         private void AnnotPropertyPanel_AnnotTypeChanged(object sender, Dictionary<AnnotArgsType, object> e)
         {
@@ -1046,6 +1016,7 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        //来自属性面板的事件,更改颜色等属性而触发
         private void AnnotPropertyPanel_DataChanged(object sender, Dictionary<AnnotArgsType, object> e)
         {
             if (e != null)
@@ -1063,6 +1034,11 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 HighLightOpacity = (double)e[argsType];
                             }
+                            //创建注释后,修改注释属性,可用于下次创建的注释
+                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                PDFViewer.SetToolParam(propertyPanel.annot);
+                            }
                             break;
 
                         case AnnotArgsType.AnnotUnderline:
@@ -1074,6 +1050,11 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 underLineOpacity = (double)e[argsType];
                             }
+                            //创建注释后,修改注释属性,可用于下次创建的注释
+                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                PDFViewer.SetToolParam(propertyPanel.annot);
+                            }
                             break;
 
                         case AnnotArgsType.AnnotSquiggly:
@@ -1085,6 +1066,11 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 SquigglyOpacity = (double)e[argsType];
                             }
+                            //创建注释后,修改注释属性,可用于下次创建的注释
+                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                PDFViewer.SetToolParam(propertyPanel.annot);
+                            }
                             break;
 
                         case AnnotArgsType.AnnotStrikeout:
@@ -1096,6 +1082,11 @@ namespace PDF_Office.ViewModels.Tools
                             {
                                 StrikeoutOpacity = (double)e[argsType];
                             }
+                            //创建注释后,修改注释属性,可用于下次创建的注释
+                            if (propertyPanel != null && propertyPanel.annot != null && PDFViewer.MouseMode == MouseModes.AnnotCreate)
+                            {
+                                PDFViewer.SetToolParam(propertyPanel.annot);
+                            }
                             break;
 
                         case AnnotArgsType.AnnotFreehand:

+ 14 - 13
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -14,6 +14,7 @@ using PDF_Office.Model.BOTA;
 using PDF_Office.Properties;
 using PDF_Office.ViewModels.BOTA;
 using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
+using PDF_Office.ViewModels.Tools.AnnotManager;
 using PDF_Office.Views.BOTA;
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using PDFSettings;
@@ -625,10 +626,10 @@ namespace PDF_Office.ViewModels.Tools
         {
             if (viewContentViewModel.FillAndSign != null && viewContentViewModel.FillAndSign.Count > 0 && annots != null && annots.Count > 0)
             {
-                var annotFillAndSign = viewContentViewModel.FillAndSign.FirstOrDefault(temp => temp.Item1 == annots[0].PageIndex && temp.Item2 == annots[0].AnnotIndex);
+                var annotFillAndSign = viewContentViewModel.FillAndSign.FirstOrDefault(temp => temp.PageIndex == annots[0].PageIndex && temp.AnnotIndex == annots[0].AnnotIndex);
                 if (annotFillAndSign != null)
                 {
-                    this.events.GetEvent<FillAndSignEvent>().Publish(new FillAndSigntEventArgs { Unicode = tag, AppUnicode = App.mainWindowViewModel.SelectedItem.Unicode, Annots = annots });
+                    this.events.GetEvent<FillAndSignEvent>().Publish(new FillAndSigntEventArgs { Action = tag, AppUnicode = App.mainWindowViewModel.SelectedItem.Unicode, Annots = annots });
                     return true;
                 }
             }
@@ -639,11 +640,11 @@ namespace PDF_Office.ViewModels.Tools
         {
             if (obj != null)
             {
-                if (string.IsNullOrEmpty(obj.Unicode) == false)
+                if (string.IsNullOrEmpty(obj.Action) == false)
                 {
-                    if (obj.Unicode == "Clear")
+                    if (obj.Action == "Clear")
                     {
-                        AnnotSignatures.Clear();
+                        viewContentViewModel.AnnotSignatures.Clear();
                     }
                 }
             }
@@ -1433,7 +1434,7 @@ namespace PDF_Office.ViewModels.Tools
                         FreehandDefault.Opacity = freeHand.Transparency;
                         FreehandDefault.Thickness = freeHand.LineWidth;
 
-                        var isSolid = AnnotPropertyPanel.IsSolidStyle(freeHand.LineDash);
+                        var isSolid = AnnotTransfer.IsSolidStyle(freeHand.LineDash);
                         if (isSolid)
                         {
                             FreehandDefault.DashArray = null;
@@ -1490,7 +1491,7 @@ namespace PDF_Office.ViewModels.Tools
                         SquareDefalut.Opacity = square.Transparency;
                         SquareDefalut.Thickness = square.LineWidth;
 
-                        var isSolid = AnnotPropertyPanel.IsSolidStyle(square.LineDash);
+                        var isSolid = AnnotTransfer.IsSolidStyle(square.LineDash);
                         if (isSolid)
                         {
                             SquareDefalut.DashArray = null;
@@ -1520,7 +1521,7 @@ namespace PDF_Office.ViewModels.Tools
                         CircleDefalut.Opacity = circle.Transparency;
                         CircleDefalut.Thickness = circle.LineWidth;
 
-                        var isSolid = AnnotPropertyPanel.IsSolidStyle(circle.LineDash);
+                        var isSolid = AnnotTransfer.IsSolidStyle(circle.LineDash);
                         if (isSolid)
                         {
                             CircleDefalut.DashArray = null;
@@ -1547,7 +1548,7 @@ namespace PDF_Office.ViewModels.Tools
                         lineDefalut.Opacity = (annot as LineAnnotArgs).Transparency;
                         lineDefalut.Thickness = (annot as LineAnnotArgs).LineWidth;
 
-                        var isSolid = AnnotPropertyPanel.IsSolidStyle(line.LineDash);
+                        var isSolid = AnnotTransfer.IsSolidStyle(line.LineDash);
                         if (isSolid)
                         {
                             lineDefalut.DashArray = null;
@@ -1744,11 +1745,11 @@ namespace PDF_Office.ViewModels.Tools
                     var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
                     if (menu.tag.ToString() == "Solid")
                     {
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, AnnotPropertyPanel.GetLineDashStyle(true));
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, AnnotTransfer.GetLineDashStyle(true));
                     }
                     else
                     {
-                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, AnnotPropertyPanel.GetLineDashStyle(false));
+                        AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, AnnotTransfer.GetLineDashStyle(false));
                     }
 
                     AnnotEvent?.UpdateAnnot();
@@ -1844,12 +1845,12 @@ namespace PDF_Office.ViewModels.Tools
                     var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
                     if (strTag == "Solid")
                     {
-                        var dashStyle = AnnotPropertyPanel.GetLineDashStyle(true);
+                        var dashStyle = AnnotTransfer.GetLineDashStyle(true);
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, dashStyle);
                     }
                     else
                     {
-                        var dashStyle = AnnotPropertyPanel.GetLineDashStyle(false);
+                        var dashStyle = AnnotTransfer.GetLineDashStyle(false);
                         AnnotEvent?.UpdateAttrib(AnnotAttrib.LineStyle, dashStyle);
                     }
                     AnnotEvent?.UpdateAnnot();

+ 9 - 11
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Layout.cs

@@ -85,7 +85,7 @@ namespace PDF_Office.ViewModels.Tools
         /// </summary>
         private void ShowPropertyPanel(bool show = true)
         {
-            viewContentViewModel.IsPropertyOpen = show;
+            viewContentViewModel.IsPropertyOpen = show;
         }
 
         #endregion 属性面板
@@ -122,12 +122,7 @@ namespace PDF_Office.ViewModels.Tools
                 foreach (var item in contextMenu.Items)
                 {
                     if (item is MenuItem menuItem1)
-                    {
-                        //if (menuItem1.Tag.ToString() == "DisplayAnnot" || menuItem1.Tag.ToString() == "HiddenAnnot")
-                        //{
-                        //    SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", isHiddenAnnot);
-                        //}
-
+                    {
                         switch (menuItem1.Tag.ToString())
                         {
                             case "Paste":
@@ -169,11 +164,14 @@ namespace PDF_Office.ViewModels.Tools
                                 SetMenuItemVisibility(menuItem1, "DisplayAnnot", "HiddenAnnot", BtnShowAnnotIsChecked);
                                 break;
 
-                            case "AddBookMark":
-                                //menuItem1.Click -= AddBookMark_Click;
-                                //menuItem1.Click += AddBookMark_Click;
+                            case "AddBookMark":
+
                                 menuItem1.Command = AddBookMarkCommand;
                                 SetMenuItemVisibility(menuItem1, "DelBookMark", "AddBookMark", isAddBookMark);
+                                if (viewContentViewModel.mainViewModel.IsBookMode)
+                                {
+                                    menuItem1.IsEnabled = false;
+                                }
                                 break;
 
                             case "DelBookMark":
@@ -370,7 +368,7 @@ namespace PDF_Office.ViewModels.Tools
             menuItem.Header = header;
             menuItem.Tag = tag;
 
-            if (tag == "Link")
+            if (tag == "OutLine")
             {
                 if (viewContentViewModel.mainViewModel.IsBookMode)
                 {

+ 3 - 140
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs

@@ -4,6 +4,7 @@ using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
+using PDF_Office.ViewModels.Tools.AnnotManager;
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
 using PDFSettings.Settings;
 using Prism.Commands;
@@ -16,143 +17,6 @@ using System.Windows.Media;
 
 namespace PDF_Office.ViewModels.Tools
 {
-    /// <summary>
-    /// 改变工具栏注释属性值,主要用来传参数:注释属性和同步工具栏对应图标的属性(颜色)
-    /// </summary>
-    public class AnnotPropertyPanel
-    {
-        public bool IsAddLink = false;
-        public bool IsLocationLink = false;
-        public AnnotAttribEvent AnnotEvent { get; set; }
-        public List<AnnotAttribEvent> AnnotEvents = new List<AnnotAttribEvent>();
-
-        public AnnotHandlerEventArgs annot;
-        public List<AnnotHandlerEventArgs> annotlists;
-
-        public bool IsTextFill { get; private set; }
-
-        public void SetIsTextFill(bool isTextFill)
-        {
-            IsTextFill = isTextFill;
-        }
-
-        public event EventHandler<Dictionary<AnnotArgsType, object>> DataChanged;
-
-        public event EventHandler<Dictionary<AnnotArgsType, object>> AnnotTypeChanged;
-
-        public event EventHandler<object> DefaultStored;
-
-        public AnnotPropertyPanel()
-        { }
-
-        //外部UI控件选中状态
-        public static bool IsSolidStyle(DashStyle LineDash)
-        {
-            bool isSolid = true;
-            if (LineDash == null || LineDash.Dashes.Count == 0)
-            {
-                return isSolid;
-            }
-
-            foreach (var item in LineDash.Dashes)
-            {
-                if (item > 0)
-                {
-                    isSolid = false;
-                    break;
-                }
-            }
-            return isSolid;
-        }
-
-        public static DashStyle GetLineDashStyle(bool isSolid)
-        {
-            DashStyle newDash = new DashStyle();
-            if (isSolid == false)
-            {
-                newDash.Dashes.Add(2);
-                newDash.Dashes.Add(2);
-            }
-            else
-            {
-                newDash = DashStyles.Solid;
-            }
-
-            return newDash;
-        }
-
-        //单个属性更改
-        public void UpdateAnnotAAttrib(AnnotAttrib annotAttrib, object obj)
-        {
-            if (annotlists != null && annotlists.Count > 1)
-            {
-                foreach (var itemevent in AnnotEvents)
-                {
-                    itemevent?.UpdateAttrib(annotAttrib, obj);
-                    itemevent?.UpdateAnnot();
-                }
-            }
-            else
-            {
-                AnnotEvent?.UpdateAttrib(annotAttrib, obj);
-                AnnotEvent?.UpdateAnnot();
-            }
-        }
-
-        //多个属性更改
-        public void UpdateAnnotAllAttribs(Dictionary<AnnotAttrib, object> AnnotAttribDir)
-        {
-            if (annotlists != null && annotlists.Count > 1)
-            {
-                foreach (var itemevent in AnnotEvents)
-                {
-                    foreach (var item in AnnotAttribDir)
-                    {
-                        itemevent?.UpdateAttrib(item.Key, item.Value);
-                    }
-
-                    itemevent?.UpdateAnnot();
-                }
-            }
-            else
-            {
-                foreach (var item in AnnotAttribDir)
-                {
-                    AnnotEvent?.UpdateAttrib(item.Key, item.Value);
-                }
-
-                AnnotEvent?.UpdateAnnot();
-            }
-        }
-
-        //是否为多选
-        public bool IsMultiSelected
-        { get { return (annotlists != null && annotlists.Count > 1); } }
-
-        /// <summary>
-        /// 更新多个属性,触发到工具栏注释工具,改变工具图标下的颜色值
-        /// </summary>
-        public void InvokeToMyTools(object sender, Dictionary<AnnotArgsType, object> keyValues)
-        {
-            DataChanged?.Invoke(sender, keyValues);
-        }
-
-        /// <summary>
-        /// 更新单个属性
-        /// </summary>
-        public void InvokeToMyTools(AnnotArgsType argsType, object obj)
-        {
-            Dictionary<AnnotArgsType, object> changeData = new Dictionary<AnnotArgsType, object>();
-            changeData[argsType] = obj;
-            DataChanged?.Invoke(null, changeData);
-        }
-
-        //同一属性面板,切换注释工具
-        public void AnnotTypeChangedInvoke(object sender, Dictionary<AnnotArgsType, object> keyValues)
-        {
-            AnnotTypeChanged?.Invoke(sender, keyValues);
-        }
-    }
 
     public sealed partial class AnnotToolContentViewModel
     {
@@ -276,10 +140,9 @@ namespace PDF_Office.ViewModels.Tools
         public OpenFileInfo OpenFileInfo = null;
         public CPDFViewer PDFViewer;
         private ViewContentViewModel viewContentViewModel;
-        private AnnotPropertyPanel propertyPanel = new AnnotPropertyPanel();
+        private AnnotTransfer propertyPanel = new AnnotTransfer();
         private Dictionary<string, AnnotArgsType> ToolExpandDict = new Dictionary<string, AnnotArgsType>();
         private Dictionary<string, string> ToolTipDict = new Dictionary<string, string>();
-        private List<Tuple<int, int>> AnnotSignatures = new List<Tuple<int, int>>();
         private StickyNotePopup customStickyPopup;
         string Unicode = "";
 
@@ -307,7 +170,7 @@ namespace PDF_Office.ViewModels.Tools
         public DelegateCommand<object> SetAddAnnotationCommand { get; set; }
         public DelegateCommand AddBookMarkCommand { get; set; }
 
-        public DelegateCommand<object> HandCommand { get; set; }
+        public DelegateCommand HandCommand { get; set; }
 
         #region 注释 - 右键菜单
 

+ 108 - 104
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs

@@ -44,7 +44,6 @@ namespace PDF_Office.ViewModels.Tools
     public sealed partial class AnnotToolContentViewModel : BindableBase, INavigationAware
     {
         #region 初始化
-
         public AnnotToolContentViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, IDialogService dialogService)
         {
             region = regionManager;
@@ -83,7 +82,7 @@ namespace PDF_Office.ViewModels.Tools
             SetAddAnnotationCommand = new DelegateCommand<object>(AddAnnotation_Click);
             AddBookMarkCommand = new DelegateCommand(AddBookMark_Click);
             PropertyRegionName = Guid.NewGuid().ToString();
-            HandCommand = new DelegateCommand<object>(Hand_Click);
+            HandCommand = new DelegateCommand(Hand_Click);
 
             #region 注释 - 右键菜单
 
@@ -111,7 +110,12 @@ namespace PDF_Office.ViewModels.Tools
             #endregion 注释 - 右键菜单
         }
 
-        private void Hand_Click(object obj)
+        #endregion 初始化
+
+        #region 注释工具栏 -》Command实现
+
+        //手型工具
+        private void Hand_Click()
         {
             HandToolIsCheckedEvent(BtnHandIsChecked);
             if (BtnHandIsChecked)
@@ -123,6 +127,7 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
+        //手型工具按钮选中或取消
         private void HandToolIsCheckedEvent(bool isChecked)
         {
             if (isChecked == false)
@@ -147,92 +152,65 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        #endregion 初始化
-
-        #region Command实现
-
         //点击注释工具
         private void BtnMyTools_Click(CustomIconToggleBtn annotBtn)
         {
+            if (annotBtn == null || annotBtn.Tag == null) return;
+
             //不创建注释,属于注释模板
-            bool isTemplateAnnot = false;
-            bool isSnapshotEdit = false;
+            Dictionary<string,bool> dictVar = new Dictionary<string,bool>();
+            dictVar.Add("isTemplateAnnot", false);
+            dictVar.Add("isSnapshotEdit", false);
             AnnotHandlerEventArgs annotArgs = null;
+            var tag = annotBtn.Tag.ToString();
 
+           
             if (annotBtn.Name == "BtnShowAnnot")
-            {
+            { 
+                //显示/隐藏注释
                 PDFViewer.SetDrawAnnot((bool)annotBtn.IsChecked);
                 return;
             }
 
             if (annotBtn.IsChecked == true)
             {
-                if (BtnHandIsChecked)
-                {
-                    BtnHandIsChecked = false;
-                }
-
-                PDFViewer.ClearSelectAnnots();
-                var tag = annotBtn.Tag.ToString();
+                MyToolCheckedDoing(dictVar, tag);
                 FindAnnotTypeKey(tag, ref annotArgs);
 
-                if (tag == "SnapshotEdit")
-                {
-                    isSnapshotEdit = true;
-                }
-                else if (tag == "Signature" || tag == "Stamp")
-                {
-                    isTemplateAnnot = true;
-                }
-
-                if (tag != "Link")
-                    BtnLinkIsChecked = false;
-                else
-                    StrAnnotToolChecked = "Link";
-
                 if (annotArgs != null)
                 {
+                    //设置点击页面会创建对应选中注释工具的注释
                     annotArgs.Author = Settings.Default.AppProperties.Description.Author;
                     PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
                     PDFViewer.SetToolParam(annotArgs);
-
-                    if (tag == "Rect" || tag == "Circle" || tag == "Arrow" || tag == "Line")
-                    {
-                        PDFViewer.ToolManager.EnableClickCreate = true;
-                        PDFViewer.ToolManager.ClickCreateWidth = 140;
-                        PDFViewer.ToolManager.ClickCreateHeight = 140;
-                    }
-                    else
-                    {
-                        PDFViewer.ToolManager.EnableClickCreate = false;
-                    }
-
                     #region 设计重新调整,阅读页空白处,右键菜单,添加链接需要显示,其他和pro mac一样的效果,不显示属性栏
 
                     //isRightMenuAddAnnot = false;
 
                     #endregion 设计重新调整,阅读页空白处,右键菜单,添加链接需要显示,其他和pro mac一样的效果,不显示属性栏
                 }
+
             }
             else
             {
+                //取消选中注释工具按钮后,恢复到未编辑注释的状态
                 propertyPanel.IsAddLink = false;
                 propertyPanel.IsLocationLink = false;
                 PDFViewer.ToolManager.EnableClickCreate = false;
             }
 
-            //当不是注释模板,且无创建注释时,属性面板显示为空内容
-            if (isTemplateAnnot == false && annotArgs == null)
+            
+            if (dictVar["isTemplateAnnot"] == false && annotArgs == null)
             {
+                //当不是注释模板,且无创建注释时,属性面板显示为空内容
                 PDFViewer.SetMouseMode(MouseModes.PanTool);
                 viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
             }
             else
             {
-                if (isSnapshotEdit == true)
+                if (dictVar["isSnapshotEdit"] == true)
                 {
                     ShowPropertyPanel(false);
-                    isSnapshotEdit = false;
                 }
                 else
                 {
@@ -241,7 +219,48 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        #endregion Command实现
+        //选中注释工具按钮时,处理的一些系列事情
+        private void MyToolCheckedDoing(Dictionary<string, bool> dict,string tag)
+        {
+            if (BtnHandIsChecked)
+                BtnHandIsChecked = false;
+
+            PDFViewer.ClearSelectAnnots();
+
+            //选中内容选择工具按钮
+            if (tag == "SnapshotEdit")
+            {
+                dict["isSnapshotEdit"] = true;
+            }
+            else if (tag == "Signature" || tag == "Stamp")
+            {
+                //选中签名、图章工具按钮
+                dict["isTemplateAnnot"] = true;
+            }
+
+            //超链接工具
+            if (tag != "Link")
+                BtnLinkIsChecked = false;
+            else
+                StrAnnotToolChecked = "Link";
+
+            
+            if (tag == "Rect" || tag == "Circle" || tag == "Arrow" || tag == "Line")
+            {
+                //新建形状注释,设置默认大小
+                PDFViewer.ToolManager.EnableClickCreate = true;
+                PDFViewer.ToolManager.ClickCreateWidth = 140;
+                PDFViewer.ToolManager.ClickCreateHeight = 140;
+            }
+            else
+            {
+                PDFViewer.ToolManager.EnableClickCreate = false;
+            }
+
+        }
+
+
+        #endregion 注释工具栏 -》Command实现
 
         #region BOTA
 
@@ -293,20 +312,6 @@ namespace PDF_Office.ViewModels.Tools
                         isTabItem = true;
                     }
                 }
-                //foreach (var item in views)
-                //{
-                //    if (item is BOTAContent bOTAContent1)
-                //    {
-                //        bOTAContent = bOTAContent1;
-                //        bOTAContentViewModel = bOTAContent.DataContext as BOTAContentViewModel;
-                //        if (bOTAContentViewModel.CurrentBar == tabItemText)
-                //        {
-                //            isTabItem = true;
-
-                //            break;
-                //        }
-                //    }
-                //}
             }
             return isTabItem;
         }
@@ -434,12 +439,12 @@ namespace PDF_Office.ViewModels.Tools
 
         private void UnReadModel_Click(object sender, RoutedEventArgs e)
         {
-            viewContentViewModel.UnReadModel();
+            viewContentViewModel.Off_ReadModel();
         }
 
         private void ReadModel_Click(object sender, RoutedEventArgs e)
         {
-            viewContentViewModel.RbtnReadMode();
+            viewContentViewModel.On_ReadMode();
         }
 
         private void SetToolMode(ItemCollection items)
@@ -494,54 +499,53 @@ namespace PDF_Office.ViewModels.Tools
 
         private void DelBookMark_Click(object sender, RoutedEventArgs e)
         {
-            if (viewContentViewModel.OpenBOTA == false)
+            CheckBOTAState(out BOTAContentViewModel bOTAContentVM, out BOTAContent bOTA);
+            if (bOTAContentVM != null && bOTA != null)
             {
-                viewContentViewModel.OpenBOTA = true;
-            }
-            bool isBook = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemBookMark");
-            if (isBook == false)
-            {
-                bOTAContent.TabItemBookMark.IsSelected = true;
-            }
-            BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentViewModel, out BookmarkContent bookmark);
+                BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentVM, out BookmarkContent bookmark);
 
-            int index = PDFViewer.CurrentIndex;
-            //检测是否已存在相同数据
-            CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
-            if (bookmarkContentViewModel != null && bookmark != null && bOTAContent != null && list != null)
-            {
-                bookmarkContentViewModel.DeleteCommand.Execute(list);
-                isAddBookMark = bookmarkContentViewModel.isAddBookMark;
+                int index = PDFViewer.CurrentIndex;
+                //检测是否已存在相同数据
+                CPDFBookmark list = PDFViewer.Document.GetBookmarkList().FirstOrDefault(q => q.PageIndex == index);
+                if (bookmarkContentViewModel != null && bookmark != null && bOTA != null && list != null)
+                {
+                    bookmarkContentViewModel.DeleteCommand.Execute(list);
+                    isAddBookMark = bookmarkContentViewModel.isAddBookMark;
+                }
             }
-
-            //        bool isBook = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemBookMark");
-
-            //if (isBook == false || viewContentViewModel.OpenBOTA == false)
-            //{
-            //    viewContentViewModel.OpenBOTA = true;
-            //    bOTAContent.TabItemBookMark.IsSelected = true;
-            //}
         }
 
-        private void AddBookMark_Click()
+        private void CheckBOTAState(out BOTAContentViewModel bOTAContentVM, out BOTAContent bOTA)
         {
             if (viewContentViewModel.OpenBOTA == false)
             {
                 viewContentViewModel.OpenBOTA = true;
             }
-            bool isBook = IsBOTATabItemShow(out BOTAContentViewModel bOTAContentViewModel, out BOTAContent bOTAContent, "TabItemBookMark");
+            bool isBook = IsBOTATabItemShow(out bOTAContentVM, out bOTA, "TabItemBookMark");
             if (isBook == false)
             {
-                bOTAContent.TabItemBookMark.IsSelected = true;
+                bOTA.TabItemBookMark.IsSelected = true;
             }
-            BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentViewModel, out BookmarkContent bookmark);
+        }
 
-            if (bookmarkContentViewModel != null && bookmark != null && bOTAContent != null)
+        private void AddBookMark_Click()
+        {
+            CheckBOTAState(out BOTAContentViewModel bOTAContentVM, out BOTAContent bOTA);
+            //if (viewContentViewModel.mainViewModel.IsBookMode)
+            //{
+            //    this.events.GetEvent<ReadModeBOTAShowEvent>().Publish(new ReadModeBOTAShowArgs() { Unicode = App.mainWindowViewModel.SelectedItem.Unicode, IsBOTAShow = true });
+            //}
+            if (bOTAContentVM != null && bOTA != null)
             {
-                //bookmarkContentViewModel.AddBookmarkCommand.Execute(bookmark.BookMarkListView);
-                bookmark.BtnAddBookmark_Click(null, null);
-                isAddBookMark = bookmarkContentViewModel.isAddBookMark;
-                return;
+                BookmarkContentViewModel bookmarkContentViewModel = GetBookmarkContentViewModel(bOTAContentVM, out BookmarkContent bookmark);
+
+                if (bookmarkContentViewModel != null && bookmark != null && bOTA != null)
+                {
+                    //bookmarkContentViewModel.AddBookmarkCommand.Execute(bookmark.BookMarkListView);
+                    bookmark.BtnAddBookmark_Click(null, null);
+                    isAddBookMark = bookmarkContentViewModel.isAddBookMark;
+                    return;
+                }
             }
         }
 
@@ -626,13 +630,13 @@ namespace PDF_Office.ViewModels.Tools
                 if (item is MenuItem menuItem)
                 {
                     string str = menuItem.Tag.ToString();
-                    if (str == AddAnnotType.AnnotLink.ToString()
-                    || str == AddAnnotType.AnnotStamp.ToString()
-                    || str == AddAnnotType.AnnotAutograph.ToString()
-                    )
-                    {
-                        InBookModeSetIsEnabled(menuItem);
-                    }
+                    //if (str == AddAnnotType.AnnotLink.ToString()
+                    //|| str == AddAnnotType.AnnotStamp.ToString()
+                    //|| str == AddAnnotType.AnnotAutograph.ToString()
+                    //)
+                    //{
+                    //    InBookModeSetIsEnabled(menuItem);
+                    //}
                     menuItem.CommandParameter = item;
                     menuItem.Command = SetAddAnnotationCommand;
                 }

+ 11 - 12
PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs

@@ -203,16 +203,18 @@ namespace PDF_Office.ViewModels.Tools
         private void OpenSetPasswordDialog()
         { 
             VerifyPasswordResult result = SecurityHelper.VerifyPasswordByPasswordKind(PDFViewer.Document, EnumPasswordKind.StatusPermissionsPassword, dialogs);
-
             if (result.IsDiscryptied)
             { 
-                if ((result.Password != null || !viewContentViewModel.SecurityInfo.IsPasswordChanged)&&!string.IsNullOrEmpty(PDFViewer.Document.FilePath))
+                if (result.Password != null&&!string.IsNullOrEmpty(PDFViewer.Document.FilePath))
                 {
-                    string filePath = PDFViewer.Document.FilePath;
-                    PDFViewer.CloseDocument();
-                    PDFViewer.InitDocument(filePath);
-                    PDFViewer.Load();
-                    PDFViewer.Document.UnlockWithPassword(result.Password);
+                    //string filePath = PDFViewer.Document.FilePath;
+                    //PDFViewer.CloseDocument();
+                    //PDFViewer.InitDocument(filePath);
+                    //if (PDFViewer.Document != null)
+                    //{
+                    //    PDFViewer.Load();
+                    //}
+                    PDFViewer.Document.CheckOwnerPassword(result.Password);
                 }
 
                 DialogParameters value = new DialogParameters();
@@ -250,10 +252,7 @@ namespace PDF_Office.ViewModels.Tools
                 {
                     if (result.Password != null)
                     {
-                        string filePath = PDFViewer.Document.FilePath;
-                        PDFViewer.Document.Release();
-                        PDFViewer.InitDocument(filePath);
-                        PDFViewer.Document.UnlockWithPassword(result.Password);
+                        PDFViewer.Document.CheckOwnerPassword(result.Password);
                     }
                     DialogParameters value = new DialogParameters();
                     value.Add(ParameterNames.PDFDocument, PDFViewer.Document);
@@ -298,7 +297,7 @@ namespace PDF_Office.ViewModels.Tools
             }
             await Task.Run(() =>
             {
-                if (PDFViewer.CurrentIndex > 0)
+                if (PDFViewer.CurrentIndex >= 0)
                 {
                     UndoManager.cropPageList.Add(PDFViewer.CurrentIndex);
                 }

+ 141 - 83
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -36,6 +36,8 @@ using PDF_Office.Properties;
 using PDF_Office.ViewModels.BOTA;
 using PDF_Office.Views.BOTA;
 using System.Drawing;
+using PDF_Office.ViewModels.Tools.AnnotManager;
+using PDF_Office.Model.FillAndSign;
 
 namespace PDF_Office.ViewModels
 {
@@ -245,9 +247,12 @@ namespace PDF_Office.ViewModels
         public string TextEditContentRegionName { get; set; }
 
         public string BackgroundContentRegionName { get; set; }
-        //若point不赋值或从列表中找不到point,系统会提供默认值为(0,0)的新point,所以改用Tuple<int,int>
-        public List<Tuple<int, int>> FillAndSign = new List<Tuple<int, int>>();
 
+        
+
+        //若point不赋值或从列表中找不到point,系统会提供默认值为(0,0)的新point,所以改用Tuple<int,int>
+        public List<FillAndSignIsShape> FillAndSign = new List<FillAndSignIsShape>();
+        public List<Tuple<int, int>> AnnotSignatures = new List<Tuple<int, int>>();
         /// <summary>
         /// 文档的密码
         /// </summary>
@@ -513,6 +518,11 @@ namespace PDF_Office.ViewModels
                 //如果设置为手动展开属性面板时,则不响应代码控制的展开
                 if (Settings.Default.AppProperties.InitialVIew.AutoExpandProperty)
                 {
+                    if (mainViewModel.IsBookMode)
+                    {
+                        this.events.GetEvent<ReadModePropertyOpenEvent>().Publish(new ReadModePropertyOpenArgs() { Unicode = unicode });
+                    }
+
                     SetProperty(ref isPorpertyOpen, value);
                 }
             }
@@ -543,7 +553,7 @@ namespace PDF_Office.ViewModels
             set
             {
                 if (events != null && canSave == false)
-                    this.events.GetEvent<FillAndSignEvent>().Publish(new FillAndSigntEventArgs { Unicode = "Clear", AppUnicode = unicode });
+                    this.events.GetEvent<FillAndSignEvent>().Publish(new FillAndSigntEventArgs { Action = "Clear", AppUnicode = unicode });
 
                 SetProperty(ref canSave, value);
             }
@@ -731,6 +741,7 @@ namespace PDF_Office.ViewModels
         public DelegateCommand CreateBlankFileCommand { get; set; }
 
         public DelegateCommand ClosePropertyCommand { get; set; }
+
         #endregion 命令
 
         public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
@@ -846,6 +857,12 @@ namespace PDF_Office.ViewModels
             {
                 case "Guid":
                     //打开内嵌文档
+                    if(App.OpenedFileList.Contains(App.GuidPDFPath))
+                    {
+                        //如果已经打开时,则选中内嵌文档
+                        App.mainWindowViewModel.SelectItem(App.GuidPDFPath);
+                        return;
+                    }
                     if (File.Exists(App.GuidPDFPath))
                     {
                         App.mainWindowViewModel.AddTabItem(App.GuidPDFPath);
@@ -1169,6 +1186,7 @@ namespace PDF_Office.ViewModels
                     ShowLeftTip(true);
                     region.RequestNavigate(LeftTipContentRegionName, "SetPasswordSuccessfullyTip");
                     break;
+
                 case EnumTipKind.StatusRemoveSecuritySuccessfully:
                     ShowLeftTip(false);
                     region.RequestNavigate(TipContentRegionName, "RemoveSecuritySuccessTip");
@@ -1179,6 +1197,7 @@ namespace PDF_Office.ViewModels
                     //ReadModelTip = Visibility.Collapsed;
                     TipVisible = Visibility.Collapsed;
                     break;
+
                 default: break;
             }
         }
@@ -1270,6 +1289,7 @@ namespace PDF_Office.ViewModels
             printValue.Add(ParameterNames.PrintCurrentPage, PDFViewer.CurrentIndex);
             dialogs.ShowDialog(DialogNames.HomePagePrinterDialog, printValue, e => { });
         }
+
         public void SelectClick()
         {
             if (OpenBOTA == false)
@@ -1301,10 +1321,10 @@ namespace PDF_Office.ViewModels
                         isTabItem = true;
                     }
                 }
-    
             }
             return isTabItem;
         }
+
         private void InitialregionNameByTabItem(ref Dictionary<string, string> dictionary)
         {
             dictionary.Add("TabItemPageEdit", ToolContentRegionName);
@@ -1470,37 +1490,63 @@ namespace PDF_Office.ViewModels
         /// 阅读模式
         /// </summary>
         /// <param name="viewContent"></param>
-        public async void RbtnReadMode()
+        public async void On_ReadMode()
         {
             App.mainWindowViewModel.SelectedItem.IsInReadctonMode = true;
             mainViewModel.IsBookMode = true;
             IsLoading = Visibility.Visible;
             await Task.Delay(1);
             PDFViewer.SetMouseMode(MouseModes.PanTool);
-            NavigationParameters param = new NavigationParameters();
-            param.Add(ParameterNames.PDFViewer, PDFViewer);
-            param.Add(ParameterNames.ViewContentViewModel, this);
-            region.RequestNavigate(ToolContentRegionName, "ReadViewContent", param);
 
-            //ShowContent(CurrentBar, true);
-            if (GridToolRow != 0)
-            {
-                GridToolRow = 0;
-            }
+            #region 旧版本
+
+            //NavigationParameters param = new NavigationParameters();
+            //param.Add(ParameterNames.PDFViewer, PDFViewer);
+            //param.Add(ParameterNames.ViewContentViewModel, this);
+            //region.RequestNavigate(ToolContentRegionName, "ReadViewContent", param);
+
+            ////ShowContent(CurrentBar, true);
+            //if (GridToolRow != 0)
+            //{
+            //    GridToolRow = 0;
+            //}
+
+            //if (GridToolRowSpan != 4)
+            //{
+            //    GridToolRowSpan = 4;
+            //}
+            ////isInPageEdit = true;
+            //UpdateShowContent("TabItemPageEdit");
+
+            #endregion 旧版本
 
-            if (GridToolRowSpan != 4)
+            this.events.GetEvent<ReadModeEvent>().Publish(new ReadModeArgs() { Unicode = unicode, IsReadMode = true });
+
+            if (region.Regions.ContainsRegionWithName(TipContentRegionName))
             {
-                GridToolRowSpan = 4;
+                var views = region.Regions[TipContentRegionName].Views;
+                var isHasView = views.FindFirst(q => q is Views.TipContent.EnterReadModeTip);
+                if (isHasView == null)
+                {
+                    region.RequestNavigate(TipContentRegionName, "EnterReadModeTip");
+                }
+                else
+                {
+                    region.Regions[TipContentRegionName].Activate(isHasView);
+                }
             }
-            //isInPageEdit = true;
-            UpdateShowContent("TabItemPageEdit");
+
             IsLoading = Visibility.Collapsed;
+
+            ShowTip(true);
+            await Task.Delay(3000);
+            TipVisible = Visibility.Collapsed;
         }
 
         /// <summary>
         /// 退出阅读模式
         /// </summary>
-        public async void UnReadModel()
+        public async void Off_ReadModel()
         {
             App.mainWindowViewModel.SelectedItem.IsInReadctonMode = false;
             mainViewModel.IsBookMode = false;
@@ -1508,41 +1554,46 @@ namespace PDF_Office.ViewModels
             await Task.Delay(1);
             //PDFViewer.MouseMode = MouseModes.None;
 
-            if (region.Regions.ContainsRegionWithName(ViwerRegionName))
-            {
-                if (region.Regions[ViwerRegionName].Views.Contains(PDFViewer))
-                {
-                    var contentRegion = region.Regions[ViwerRegionName];
-                    contentRegion.Remove(PDFViewer);
-                }
-                //还原背景色
-                PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
-                region.AddToRegion(ViwerRegionName, PDFViewer);
-            }
-            if (string.IsNullOrEmpty(CurrentBar) || CurrentBar.Equals("TabItemPageEdit", StringComparison.OrdinalIgnoreCase))
-            {
-                EnterSelectedBar("TabItemAnnotation");
-            }
-            else
-            {
-                EnterSelectedBar(CurrentBar);
-            }
-            bool isExist = false;
+            #region 旧版本
+
+            //if (region.Regions.ContainsRegionWithName(ViwerRegionName))
+            //{
+            //    if (region.Regions[ViwerRegionName].Views.Contains(PDFViewer))
+            //    {
+            //        var contentRegion = region.Regions[ViwerRegionName];
+            //        contentRegion.Remove(PDFViewer);
+            //    }
+            //    //还原背景色
+            //    PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
+            //    region.AddToRegion(ViwerRegionName, PDFViewer);
+            //}
+            //if (string.IsNullOrEmpty(CurrentBar) || CurrentBar.Equals("TabItemPageEdit", StringComparison.OrdinalIgnoreCase))
+            //{
+            //    EnterSelectedBar("TabItemAnnotation");
+            //}
+            //else
+            //{
+            //    EnterSelectedBar(CurrentBar);
+            //}
+
+            #endregion 旧版本
+
+            //还原背景色
+            PDFViewer.SetBackgroundBrush(new System.Windows.Media.SolidColorBrush(Settings.Default.AppProperties.InitialVIew.BackGround));
+            this.events.GetEvent<ReadModeEvent>().Publish(new ReadModeArgs() { Unicode = unicode, IsReadMode = false });
+
             if (region.Regions.ContainsRegionWithName(TipContentRegionName))
             {
                 var views = region.Regions[TipContentRegionName].Views;
-                foreach (var item in views)
+                var isHasView = views.FindFirst(q => q is Views.TipContent.ReadModelTip);
+                if (isHasView == null)
                 {
-                    if (item is Views.TipContent.ReadModelTip readModelTip)
-                    {
-                        isExist = true;
-                        break;
-                    }
+                    region.RequestNavigate(TipContentRegionName, "ReadModelTip");
+                }
+                else
+                {
+                    region.Regions[TipContentRegionName].Activate(isHasView);
                 }
-            }
-            if (isExist == false)
-            {
-                region.RequestNavigate(TipContentRegionName, "ReadModelTip");
             }
 
             IsLoading = Visibility.Collapsed;
@@ -1661,7 +1712,7 @@ namespace PDF_Office.ViewModels
             {
                 if (mainViewModel.IsBookMode == true)
                 {
-                    UnReadModel();
+                    Off_ReadModel();
                 }
                 //内容选择 退出
                 if (PDFViewer.MouseMode != MouseModes.PanTool)
@@ -1792,7 +1843,7 @@ namespace PDF_Office.ViewModels
         /// </summary>
         /// <param name="Content"></param>
         /// <param name="annotPropertyPanel"></param>
-        public void SelectedPrpoertyPanel(string Content, AnnotPropertyPanel annotPropertyPanel)
+        public void SelectedPrpoertyPanel(string Content, AnnotTransfer annotPropertyPanel)
         {
             NavigationParameters parameters = new NavigationParameters();
             //传其他参数:文档类,空注释面板;
@@ -1947,43 +1998,45 @@ namespace PDF_Office.ViewModels
                     {
                         string currentPath = PDFViewer.Document.FilePath;
                         string tempPath = PDFViewer.Document.FilePath + ".temp.pdf";
-                        PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
-
-                        PDFViewer.Document.WriteToFilePath(tempPath);
-                        PDFViewer.CloseDocument();
-                        PDFViewer.InitDocument(tempPath);
-                        if (!string.IsNullOrEmpty(permissionsPassword))
+                        if (PDFViewer.Document.Descrypt(tempPath))
                         {
-                            PDFViewer.Document.UnlockWithPassword(permissionsPassword);
+                            PDFViewer.CloseDocument();
+                            PDFViewer.InitDocument(tempPath);
+                            PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
+                            if (PDFViewer.Document.WriteToFilePath(currentPath))
+                            {
+                                PDFViewer.CloseDocument();
+                                PDFViewer.InitDocument(currentPath);
+                                if (!string.IsNullOrEmpty(openPassword))
+                                {
+                                    PDFViewer.Document.UnlockWithPassword(openPassword);
+                                }
+
+                                if (!string.IsNullOrEmpty(permissionsPassword))
+                                {
+                                    PDFViewer.Document.CheckOwnerPassword(permissionsPassword);
+                                }
+                                try
+                                {
+                                    PDFViewer.Load();
+                                }
+                                catch
+                                {
+                                }
+                                PDFViewer.UndoManager.CanSave = false;
+                                SecurityInfo.IsPasswordChanged = false;
+                            }
+                            else
+                            {
+                                return false;
+                            }
+                            System.IO.File.Delete(tempPath);
                         }
-                        else if (!string.IsNullOrEmpty(openPassword))
+                        else
                         {
-                            PDFViewer.Document.UnlockWithPassword(openPassword);
+                            return false;
                         }
-                        PDFViewer.Document.Encrypt(openPassword, permissionsPassword, cPDFPermissionsInfo);
-
-                        PDFViewer.Document.WriteToFilePath(currentPath);
-                        PDFViewer.CloseDocument();
-                        PDFViewer.InitDocument(currentPath);
-                        System.IO.File.Delete(tempPath);
 
-                        if (!string.IsNullOrEmpty(permissionsPassword))
-                        {
-                            PDFViewer.Document.UnlockWithPassword(permissionsPassword);
-                        }
-                        else if (!string.IsNullOrEmpty(openPassword))
-                        {
-                            PDFViewer.Document.UnlockWithPassword(openPassword);
-                        }
-                        try
-                        {
-                            PDFViewer.Load();
-                        }
-                        catch
-                        {
-                        }
-                        PDFViewer.UndoManager.CanSave = false;
-                        SecurityInfo.IsPasswordChanged = false;
                         return true;
                     }
                     catch
@@ -2075,6 +2128,10 @@ namespace PDF_Office.ViewModels
                 return result;
             }
             catch { return false; }
+            finally
+            {
+                ShowLeftTip(false);
+            }
         }
 
         /// <summary>
@@ -2100,6 +2157,7 @@ namespace PDF_Office.ViewModels
                 }
                 else
                 {
+
                     result = PDFViewer.Document.WriteToFilePath(dlg.FileName);
                     if (result)
                     {

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

@@ -353,13 +353,7 @@
                 Name="ImageContext"
                 Grid.Row="1"
                 Source="{Binding WriteableBitmap}">
-                <Image.RenderTransform>
-                    <TransformGroup>
-                        <TranslateTransform />
-                        <ScaleTransform />
-                        <RotateTransform />
-                    </TransformGroup>
-                </Image.RenderTransform>
+
             </Image>
 
             <StackPanel Grid.Row="2" Margin="0,2">

+ 23 - 82
PDF Office/Views/BOTA/AnnotationListItem.xaml.cs

@@ -236,99 +236,40 @@ namespace PDF_Office.Views.BOTA
             double width = args.WriteableBitmap.Width;
             double height = args.WriteableBitmap.Height;
 
-            #region 方案一
-
             CPDFDocument doc = args.Document;
             CPDFPage docPage = doc.PageAtIndex(args.PageIndex, false);
             if (docPage != null)
             {
-                //BitmapImage bitmapImage = new BitmapImage();
-                //bitmapImage.BeginInit();
-                //bitmapImage.CacheOption = BitmapCacheOption.OnLoad;
-                //bitmapImage.StreamSource = args.WriteableBitmap.StreamSource;
-
-                //switch (docPage.Rotation)
-                //{
-                //    case 0:
-                //        bitmapImage.Rotation = Rotation.Rotate0;
-                //        break;
-
-                //    case 1:
-                //        bitmapImage.Rotation = Rotation.Rotate90;
-                //        break;
-
-                //    case 2:
-                //        bitmapImage.Rotation = Rotation.Rotate180;
-                //        break;
-
-                //    case 3:
-                //        bitmapImage.Rotation = Rotation.Rotate270;
-                //        break;
-                //}
-                //bitmapImage.EndInit();
-                //ImageContext.Source = bitmapImage;
-
-                //switch (rotate)
-                //{
-                //    case 0:
-                //        RotateTransform rotateTransform = new RotateTransform(0);
-                //        ImageContext.RenderTransform = rotateTransform;
-                //        break;
-
-                //    case 1:
-                //        //rotateTransform = new RotateTransform(90);//90度
-                //        //ImageContext.RenderTransform = rotateTransform;
-                //        TransformGroup tg = ImageContext.RenderTransform as TransformGroup;
-                //        var tgnew = tg.CloneCurrentValue();
-                //        if (tgnew != null)
-                //        {
-                //            RotateTransform rt = tgnew.Children[2] as RotateTransform;
-                //            ImageContext.RenderTransformOrigin = new Point(0.5, 0.5);
-                //            rt.Angle = 90;
-                //        }
-
-                //        // 重新给图像赋值Transform变换属性
-                //        ImageContext.RenderTransform = tgnew;
-                //        break;
-
-                //    case 2:
-                //        rotateTransform = new RotateTransform(180);
-                //        ImageContext.RenderTransform = rotateTransform;
-                //        break;
-
-                //    case 3:
-                //        rotateTransform = new RotateTransform(270);
-                //        ImageContext.RenderTransform = rotateTransform;
-                //        break;
-                //}
-            }
-
-            #endregion 方案一
+                double maxWidth = docPage.PageSize.Width;
+                double maxHeight = docPage.PageSize.Height;
+                ImageContext.MaxHeight = maxHeight;
 
-            if (width > 180)
-            {
-                ImageContext.Stretch = Stretch.Uniform;
-            }
-            else
-            {
-                if (height >= 900)
+                if (width > 180)
                 {
-                    ImageContext.MaxHeight = 900;
                     ImageContext.Stretch = Stretch.Uniform;
                 }
-
-                if (height < 900)
+                else
                 {
-                    if (height <= 20)
+                    if (height >= maxHeight/2)
                     {
-                        ImageContext.MinHeight = height;
-                        ImageContext.MinHeight = 30;
+                        //ImageContext.MaxHeight = 900;
+                        ImageContext.Stretch = Stretch.None;
                     }
-                    ImageContext.Stretch = Stretch.None;
-                }
-                else
-                {
-                    ImageContext.Stretch = Stretch.Uniform;
+
+                    if (height < maxHeight/2)
+                    {
+                        if (height <= 20)
+                        {
+                            ImageContext.MinHeight = height;
+                            ImageContext.Height = 30;
+                            
+                        }
+                        ImageContext.Stretch = Stretch.None;
+                    }
+                    //else
+                    //{
+                    //    ImageContext.Stretch = Stretch.Uniform;
+                    //}
                 }
             }
         }

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

@@ -81,6 +81,7 @@
                             Padding="5"
                             Background="Transparent"
                             FontSize="14"
+                            TextWrapping="Wrap"
                             Text="{Binding Title}"
                             Visibility="Visible" />
                     </Grid>

+ 333 - 333
PDF Office/Views/BOTA/BookmarkContent.xaml.cs

@@ -21,372 +21,372 @@ using static Dropbox.Api.Sharing.ListFileMembersIndividualResult;
 
 namespace PDF_Office.Views.BOTA
 {
-/// <summary>
+    /// <summary>
     /// BookmarkContent.xaml 的交互逻辑
-/// </summary>
-public partial class BookmarkContent : UserControl
-{
-private BookmarkContentViewModel viewModel = null;
+    /// </summary>
+    public partial class BookmarkContent : UserControl
+    {
+        private BookmarkContentViewModel viewModel = null;
 
-/// <summary>
-    /// 上一个ListBoxItem,为选中状态做准备
-/// </summary>
-private ListBoxItem histotyListBoxItem = null;
+        /// <summary>
+        /// 上一个ListBoxItem,为选中状态做准备
+        /// </summary>
+        private ListBoxItem histotyListBoxItem = null;
 
-private bool isAdd = false;
+        private bool isAdd = false;
 
-public BookmarkContent()
-{
-InitializeComponent();
-viewModel = this.DataContext as BookmarkContentViewModel;
-KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
-KeyEventsHelper.KeyDown += ShortCut_KeyDown;
-}
+        public BookmarkContent()
+        {
+            InitializeComponent();
+            viewModel = this.DataContext as BookmarkContentViewModel;
+            KeyEventsHelper.KeyDown -= ShortCut_KeyDown;
+            KeyEventsHelper.KeyDown += ShortCut_KeyDown;
+        }
 
-private void ShortCut_KeyDown(object sender, KeyEventArgs e)
-{
-if (KeyEventsHelper.IsSingleKey(Key.Escape))
-{
-if (BookMarkListView.SelectedItems == null)
-{
-return;
-}
+        private void ShortCut_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (KeyEventsHelper.IsSingleKey(Key.Escape))
+            {
+                if (BookMarkListView.SelectedItems == null)
+                {
+                    return;
+                }
 
-BookMarkListView.SelectedItems.Clear();
-}
-}
+                BookMarkListView.SelectedItems.Clear();
+            }
+        }
 
-/// <summary>
-    ///ListViewItem,鼠标左键点击
-/// </summary>
-/// <param name="sender"></param>
-/// <param name="e"></param>
-private void ListViewItem_MouseButtonDown(object sender, MouseButtonEventArgs e)
-{
-object[] objects = new object[] { sender, e };
-TextBlock textBlock = null;
-ListViewItem listBoxItem = (sender as ListViewItem);
-if (e.LeftButton == MouseButtonState.Pressed)
-{
-if (e.ClickCount >= 2)
-    {
-    histotyListBoxItem = listBoxItem;
-    if (e.OriginalSource is TextBlock)
-    {
-    textBlock = (TextBlock)e.OriginalSource;
+        /// <summary>
+        ///ListViewItem,鼠标左键点击
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ListViewItem_MouseButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            object[] objects = new object[] { sender, e };
+            TextBlock textBlock = null;
+            ListViewItem listBoxItem = (sender as ListViewItem);
+            if (e.LeftButton == MouseButtonState.Pressed)
+            {
+                if (e.ClickCount >= 2)
+                {
+                    histotyListBoxItem = listBoxItem;
+                    if (e.OriginalSource is TextBlock)
+                    {
+                        textBlock = (TextBlock)e.OriginalSource;
 
-    if (textBlock != null)
-    {
-    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
+                        if (textBlock != null)
+                        {
+                            TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
 
-        SetSelectedStatus(listBoxItem, textBox, textBlock);
-        }
-        }
-        }
-        else if (e.ClickCount == 1)
-        {
-        if (histotyListBoxItem != listBoxItem)
-        {
-        if (histotyListBoxItem != null)
-        {
-        histotyListBoxItem.IsSelected = false;
-        textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
-            textBlock.Visibility = Visibility.Visible;
-            textBlock.Focusable = true;
-            }
-            }
+                            SetSelectedStatus(listBoxItem, textBox, textBlock);
+                        }
+                    }
+                }
+                else if (e.ClickCount == 1)
+                {
+                    if (histotyListBoxItem != listBoxItem)
+                    {
+                        if (histotyListBoxItem != null)
+                        {
+                            histotyListBoxItem.IsSelected = false;
+                            textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
+                            textBlock.Visibility = Visibility.Visible;
+                            textBlock.Focusable = true;
+                        }
+                    }
 
-            viewModel.ListViewItemMouseDownCommand.Execute(sender);
-            }
+                    viewModel.ListViewItemMouseDownCommand.Execute(sender);
+                }
             }
             else if (e.RightButton == MouseButtonState.Pressed)
             {
-            ContextMenu contextMenu = listBoxItem.ContextMenu;
-            if (contextMenu.Items.Count == 3)
-            {
-            MenuItem rename = contextMenu.Items[0] as MenuItem;
-            MenuItem editPageIndex = contextMenu.Items[1] as MenuItem;
-            MenuItem del = contextMenu.Items[2] as MenuItem;
-            if (isSelects)
-            {
-            rename.IsEnabled = false;
-            editPageIndex.IsEnabled = false;
-            isSelects = false;
+                ContextMenu contextMenu = listBoxItem.ContextMenu;
+                if (contextMenu.Items.Count == 3)
+                {
+                    MenuItem rename = contextMenu.Items[0] as MenuItem;
+                    MenuItem editPageIndex = contextMenu.Items[1] as MenuItem;
+                    MenuItem del = contextMenu.Items[2] as MenuItem;
+                    if (isSelects)
+                    {
+                        rename.IsEnabled = false;
+                        editPageIndex.IsEnabled = false;
+                        isSelects = false;
+                    }
+                    else
+                    {
+                        CPDFBookmark bookmark = (CPDFBookmark)listBoxItem.DataContext;
+                        if (viewModel.PDFViewer.CurrentIndex == bookmark.PageIndex)
+                        {
+                            editPageIndex.IsEnabled = false;
+                            return;
+                        }
+                        rename.IsEnabled = true;
+                        editPageIndex.IsEnabled = true;
+                        editPageIndex.CommandParameter = listBoxItem.DataContext;
+                        editPageIndex.Command = viewModel.EditPageIndexCommand;
+                    }
+                }
             }
-            else
-            {
-            CPDFBookmark bookmark = (CPDFBookmark)listBoxItem.DataContext;
-            if (viewModel.PDFViewer.CurrentIndex == bookmark.PageIndex)
+        }
+
+        private bool isSelects = false;
+
+        private void BookMarkListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            var a1 = (sender as ListView).SelectedItems.Count;
+            if (a1 > 1)
             {
-            editPageIndex.IsEnabled = false;
-            return;
-            }
-            rename.IsEnabled = true;
-            editPageIndex.IsEnabled = true;
-            editPageIndex.CommandParameter = listBoxItem.DataContext;
-            editPageIndex.Command = viewModel.EditPageIndexCommand;
-            }
-            }
-            }
+                isSelects = true;
             }
+        }
 
-            private bool isSelects = false;
+        /// <summary>
+        /// ListViewItem双击时选中状态
+        /// </summary>
+        /// <param name="listBoxItem"></param>
+        /// <param name="textBox"></param>
+        /// <param name="textBlock"></param>
+        private void SetSelectedStatus(ListBoxItem listBoxItem, TextBox textBox, TextBlock textBlock)
+        {
+            listBoxItem.IsSelected = true;
+            listBoxItem.Focus();
+            textBlock.Visibility = Visibility.Collapsed;
 
-            private void BookMarkListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
+            textBox.Dispatcher.BeginInvoke(new Action(() =>
+                                {
+                                    textBox.Focus();
+                                    textBox.SelectAll();
+                                    //listBoxItem.IsSelected = true;
+                                }));
+        }
+
+        /// <summary>
+        /// ListViewItem失去焦点
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ListViewItem_LostFocus(object sender, RoutedEventArgs e)
+        {
+            ListViewItem listItem = sender as ListViewItem;
+            if (listItem != null)
             {
-            var a1 = (sender as ListView).SelectedItems.Count;
-if (a1 > 1)
-                {
-                isSelects = true;
-                }
-                }
+                BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
+                viewModel.LostFocusCommand.Execute(listItem);
 
-                /// <summary>
-                    /// ListViewItem双击时选中状态
-                /// </summary>
-                /// <param name="listBoxItem"></param>
-                /// <param name="textBox"></param>
-                /// <param name="textBlock"></param>
-                private void SetSelectedStatus(ListBoxItem listBoxItem, TextBox textBox, TextBlock textBlock)
-                {
-                listBoxItem.IsSelected = true;
-                listBoxItem.Focus();
-                textBlock.Visibility = Visibility.Collapsed;
+                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listItem);
+                TextBox text = CommonHelper.FindVisualChild<TextBox>(listItem);
 
-textBox.Dispatcher.BeginInvoke(new Action(() =>
+                if (textBlock.Visibility != Visibility.Visible)
+                {
+                    if (isAdd == false && isRename == false)
                     {
-                    textBox.Focus();
-                    textBox.SelectAll();
-                    //listBoxItem.IsSelected = true;
-                    }));
+                        listItem.IsSelected = false;
                     }
-
-                    /// <summary>
-                        /// ListViewItem失去焦点
-                    /// </summary>
-                    /// <param name="sender"></param>
-                    /// <param name="e"></param>
-                    private void ListViewItem_LostFocus(object sender, RoutedEventArgs e)
+                    else
                     {
-                    ListViewItem listItem = sender as ListViewItem;
-                    if (listItem != null)
+                        listItem.IsSelected = true;
+                        isAdd = false;
+                    }
+                    if (text.IsSelectionActive == true)
                     {
-                    BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
-                    viewModel.LostFocusCommand.Execute(listItem);
-
-                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listItem);
-                        TextBox text = CommonHelper.FindVisualChild<TextBox>(listItem);
-
-                            if (textBlock.Visibility != Visibility.Visible)
-                            {
-                            if (isAdd == false && isRename == false)
-                            {
-                            listItem.IsSelected = false;
-                            }
-                            else
-                            {
-                            listItem.IsSelected = true;
-                            isAdd = false;
-                            }
-                            if (text.IsSelectionActive == true)
-                            {
-                            textBlock.Visibility = Visibility.Visible;
-                            }
-                            }
-                            else
-                            {
-                            listItem.IsSelected = true;
-                            }
+                        textBlock.Visibility = Visibility.Visible;
+                    }
+                }
+                else
+                {
+                    listItem.IsSelected = true;
+                }
 
-                            //if (histotyListBoxItem != null)
-                            //{
-                            //    histotyListBoxItem.IsSelected = false;
-                            //    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
-                                //    textBlock.Visibility = Visibility.Visible;
-                                //    textBlock.Focusable = true;
-                                //}
-                                //if (textBlock.Visibility == Visibility.Collapsed)
-                                //{
-                                //    listItem.IsSelected = false;
-                                //    //textBlock.Visibility = Visibility.Visible;
-                                //}
-                                //else
-                                //{
-                                //    listItem.IsSelected = true;
-                                //    //textBlock.Visibility = Visibility.Collapsed;
-                                //}
-                                }
-                                }
+                //if (histotyListBoxItem != null)
+                //{
+                //    histotyListBoxItem.IsSelected = false;
+                //    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
+                //    textBlock.Visibility = Visibility.Visible;
+                //    textBlock.Focusable = true;
+                //}
+                //if (textBlock.Visibility == Visibility.Collapsed)
+                //{
+                //    listItem.IsSelected = false;
+                //    //textBlock.Visibility = Visibility.Visible;
+                //}
+                //else
+                //{
+                //    listItem.IsSelected = true;
+                //    //textBlock.Visibility = Visibility.Collapsed;
+                //}
+            }
+        }
 
-                                private bool isRename = false;
+        private bool isRename = false;
 
-                                /// <summary>
-                                    /// 右键菜单-重命名
-                                /// </summary>
-                                /// <param name="sender"></param>
-                                /// <param name="e"></param>
-                                private void MenuItemRename_Click(object sender, RoutedEventArgs e)
-                                {
-                                if (sender is MenuItem)
-                                {
-                                MenuItem menuItem = (MenuItem)sender;
-                                CPDFBookmark bookmark = menuItem.CommandParameter as CPDFBookmark;
-                                if (bookmark != null)
-                                {
-                                BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
-                                isRename = true;
-                                ListViewItem listBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(bookmark));
-                                histotyListBoxItem = listBoxItem;
+        /// <summary>
+        /// 右键菜单-重命名
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void MenuItemRename_Click(object sender, RoutedEventArgs e)
+        {
+            if (sender is MenuItem)
+            {
+                MenuItem menuItem = (MenuItem)sender;
+                CPDFBookmark bookmark = menuItem.CommandParameter as CPDFBookmark;
+                if (bookmark != null)
+                {
+                    BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
+                    isRename = true;
+                    ListViewItem listBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(bookmark));
+                    histotyListBoxItem = listBoxItem;
 
-                                TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
-                                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
-                                        SetSelectedStatus(listBoxItem, textBox, textBlock);
-                                        }
-                                        }
-                                        }
+                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
+                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
+                    SetSelectedStatus(listBoxItem, textBox, textBlock);
+                }
+            }
+        }
 
-                                        /// <summary>
-                                            /// BookMarkListView,鼠标点击
-                                        /// </summary>
-                                        /// <param name="sender"></param>
-                                        /// <param name="e"></param>
-                                        private void BookMarkListView_PreviewMouseDown(object sender, MouseButtonEventArgs e)
-                                        {
-                                        if (e.LeftButton == MouseButtonState.Pressed)
-                                        {
-                                        var pos = e.GetPosition(BookMarkListView);
+        /// <summary>
+        /// BookMarkListView,鼠标点击
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void BookMarkListView_PreviewMouseDown(object sender, MouseButtonEventArgs e)
+        {
+            if (e.LeftButton == MouseButtonState.Pressed)
+            {
+                var pos = e.GetPosition(BookMarkListView);
 
-                                        var result = VisualTreeHelper.HitTest(BookMarkListView, pos);
-                                        if (result != null)
-                                        {
-                                        //获取当前鼠标指针下的容器
-                                        var listBoxItem = CommonHelper.FindVisualParent<ListViewItem>(result.VisualHit);
-                                            if (listBoxItem == null)
-                                            {
-                                            if (BookMarkListView.SelectedItem != null)
-                                            {
-                                            ListViewItem item = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(BookMarkListView.SelectedItem));
-                                            item.IsSelected = false;
-                                            TextBlock box = CommonHelper.FindVisualChild<TextBlock>(item);
-                                                box.Visibility = Visibility.Visible;
-                                                BookMarkListView.SelectedItems.Clear();
-                                                }
-                                                if (histotyListBoxItem != null)
-                                                {
-                                                var pos1 = e.GetPosition(histotyListBoxItem);
-                                                var result1 = VisualTreeHelper.HitTest(BookMarkListView, pos1);
-                                                if (result1 == null)
-                                                {
-                                                histotyListBoxItem.IsSelected = false;
-                                                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
-                                                    textBlock.Visibility = Visibility.Visible;
-                                                    textBlock.Focusable = true;
-                                                    }
-                                                    }
-                                                    }
-                                                    else
-                                                    {
-                                                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
-                                                        TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
-                                                            if (textBox.IsFocused == false)
-                                                            {
-                                                            listBoxItem.Focus();
-                                                            }
-                                                            }
-                                                            }
-                                                            //BookMarkListView.Focus();
-                                                            }
-                                                            }
+                var result = VisualTreeHelper.HitTest(BookMarkListView, pos);
+                if (result != null)
+                {
+                    //获取当前鼠标指针下的容器
+                    var listBoxItem = CommonHelper.FindVisualParent<ListViewItem>(result.VisualHit);
+                    if (listBoxItem == null)
+                    {
+                        if (BookMarkListView.SelectedItem != null)
+                        {
+                            ListViewItem item = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(BookMarkListView.SelectedItem));
+                            item.IsSelected = false;
+                            TextBlock box = CommonHelper.FindVisualChild<TextBlock>(item);
+                            box.Visibility = Visibility.Visible;
+                            BookMarkListView.SelectedItems.Clear();
+                        }
+                        if (histotyListBoxItem != null)
+                        {
+                            var pos1 = e.GetPosition(histotyListBoxItem);
+                            var result1 = VisualTreeHelper.HitTest(BookMarkListView, pos1);
+                            if (result1 == null)
+                            {
+                                histotyListBoxItem.IsSelected = false;
+                                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(histotyListBoxItem);
+                                textBlock.Visibility = Visibility.Visible;
+                                textBlock.Focusable = true;
+                            }
+                        }
+                    }
+                    else
+                    {
+                        TextBox textBox = CommonHelper.FindVisualChild<TextBox>(listBoxItem);
+                        TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(listBoxItem);
+                        if (textBox.IsFocused == false)
+                        {
+                            listBoxItem.Focus();
+                        }
+                    }
+                }
+                //BookMarkListView.Focus();
+            }
+        }
 
-                                                            /// <summary>
-                                                                /// 右键菜单-删除
-                                                            /// </summary>
-                                                            /// <param name="sender"></param>
-                                                            /// <param name="e"></param>
-                                                            private void MenuItemDeleteCommand_Click(object sender, RoutedEventArgs e)
-                                                            {
-                                                            List<int> pagelist = new List<int>();
-                                                                    for (int i = 0; i < BookMarkListView.SelectedItems.Count; i++)
-                                                                      {
-                                                                      CPDFBookmark item = BookMarkListView.SelectedItems[i] as CPDFBookmark;
-                                                                      pagelist.Add(BookMarkListView.Items.IndexOf(item));
-                                                                      }
-                                                                      pagelist.Sort();
-                                                                    for (int i = 0; i < pagelist.Count; i++)
-                                                                      {
-                                                                      CPDFBookmark data = BookMarkListView.Items[pagelist[pagelist.Count - i - 1]] as CPDFBookmark;
-                                                                      if (data != null)
-                                                                      {
-                                                                      viewModel.DeleteCommand.Execute(data);
-                                                                      }
-                                                                      }
-                                                                      }
+        /// <summary>
+        /// 右键菜单-删除
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void MenuItemDeleteCommand_Click(object sender, RoutedEventArgs e)
+        {
+            List<int> pagelist = new List<int>();
+            for (int i = 0; i < BookMarkListView.SelectedItems.Count; i++)
+            {
+                CPDFBookmark item = BookMarkListView.SelectedItems[i] as CPDFBookmark;
+                pagelist.Add(BookMarkListView.Items.IndexOf(item));
+            }
+            pagelist.Sort();
+            for (int i = 0; i < pagelist.Count; i++)
+            {
+                CPDFBookmark data = BookMarkListView.Items[pagelist[pagelist.Count - i - 1]] as CPDFBookmark;
+                if (data != null)
+                {
+                    viewModel.DeleteCommand.Execute(data);
+                }
+            }
+        }
 
-                                                                      public void BtnAddBookmark_Click(object sender, RoutedEventArgs e)
-                                                                      {
-                                                                      isAdd = true;
-                                                                      viewModel.AddBookmarkCommand.Execute(BookMarkListView);
-                                                                      if (viewModel.IsHasBookmark == false)
-                                                                      {
-                                                                      BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
-                                                                      ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.AddCPDFBookmark));
-                                                                      if (myListBoxItem == null)
-                                                                      {
-                                                                      BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
-                                                                      BookMarkListView.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
-                                                                      }
-                                                                      else
-                                                                      {
-                                                                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
-                                                                        TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
+        public void BtnAddBookmark_Click(object sender, RoutedEventArgs e)
+        {
+            isAdd = true;
+            viewModel.AddBookmarkCommand.Execute(BookMarkListView);
+            if (viewModel.IsHasBookmark == false)
+            {
+                BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
+                ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.AddCPDFBookmark));
+                if (myListBoxItem == null)
+                {
+                    BookMarkListView.ItemContainerGenerator.StatusChanged -= ItemContainerGenerator_StatusChanged;
+                    BookMarkListView.ItemContainerGenerator.StatusChanged += ItemContainerGenerator_StatusChanged;
+                }
+                else
+                {
+                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
+                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
 
-                                                                            SetSelectedStatus(myListBoxItem, textBox, textBlock);
-                                                                            }
-                                                                            }
-                                                                            }
+                    SetSelectedStatus(myListBoxItem, textBox, textBlock);
+                }
+            }
+        }
 
-                                                                            private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
-                                                                            {
-                                                                            ItemContainerGenerator itemContainer = sender as ItemContainerGenerator;
-                                                                            if (itemContainer.Status == GeneratorStatus.ContainersGenerated)
-                                                                            {
-                                                                            BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
-                                                                            ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.AddCPDFBookmark));
-                                                                            if (myListBoxItem != null)
-                                                                            {
-                                                                            if (myListBoxItem.RenderSize.Width < 0 && myListBoxItem.RenderSize.Height < 0)
-                                                                              {
-                                                                              BookMarkListView.UpdateLayout();
-                                                                              myListBoxItem.UpdateLayout();
-                                                                              BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
-                                                                              }
-                                                                            TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
-                                                                                TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
-                                                                                    SetSelectedStatus(myListBoxItem, textBox, textBlock);
-                                                                                    }
-                                                                                    }
-                                                                                    }
+        private void ItemContainerGenerator_StatusChanged(object sender, EventArgs e)
+        {
+            ItemContainerGenerator itemContainer = sender as ItemContainerGenerator;
+            if (itemContainer.Status == GeneratorStatus.ContainersGenerated)
+            {
+                BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
+                ListViewItem myListBoxItem = (ListViewItem)(BookMarkListView.ItemContainerGenerator.ContainerFromItem(viewModel.AddCPDFBookmark));
+                if (myListBoxItem != null)
+                {
+                    if (myListBoxItem.RenderSize.Width < 0 && myListBoxItem.RenderSize.Height < 0)
+                    {
+                        BookMarkListView.UpdateLayout();
+                        myListBoxItem.UpdateLayout();
+                        BookMarkListView.ScrollIntoView(viewModel.AddCPDFBookmark);
+                    }
+                    TextBox textBox = CommonHelper.FindVisualChild<TextBox>(myListBoxItem);
+                    TextBlock textBlock = CommonHelper.FindVisualChild<TextBlock>(myListBoxItem);
+                    SetSelectedStatus(myListBoxItem, textBox, textBlock);
+                }
+            }
+        }
 
-                                                                                    private void BookMarkListView_KeyDown(object sender, KeyEventArgs e)
-                                                                                    {
-                                                                                    if (BookMarkListView.SelectedItems == null)
-                                                                                    {
-                                                                                    return;
-                                                                                    }
-                                                                                    if (e.Key == Key.Escape)
-                                                                                    {
-                                                                                    BookMarkListView.SelectedItems.Clear();
-                                                                                    }
-                                                                                    //if (e.Key == Key.Delete)
-                                                                                    //{
-                                                                              //    if (BookMarkListView.SelectedItems.Count > 0)
-                                                                                        //    {
-                                                                                        //        //全选删除
-                                                                                        //        if (BookMarkListView.SelectedItems.Count == BookMarkListView.Items.Count)
-                                                                                        //        {
-                                                                                        //        }
-                                                                                        //    }
-                                                                                        //}
-                                                                                        }
-                                                                                        }
-                                                                                        }
+        private void BookMarkListView_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (BookMarkListView.SelectedItems == null)
+            {
+                return;
+            }
+            if (e.Key == Key.Escape)
+            {
+                BookMarkListView.SelectedItems.Clear();
+            }
+            //if (e.Key == Key.Delete)
+            //{
+            //    if (BookMarkListView.SelectedItems.Count > 0)
+            //    {
+            //        //全选删除
+            //        if (BookMarkListView.SelectedItems.Count == BookMarkListView.Items.Count)
+            //        {
+            //        }
+            //    }
+            //}
+        }
+    }
+}

+ 2 - 0
PDF Office/Views/BOTA/SearchContent.xaml

@@ -16,6 +16,7 @@
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
     KeyDown="UserControl_KeyDown"
+    SizeChanged="UserControl_SizeChanged"
     Loaded="UserControl_Loaded"
     mc:Ignorable="d">
 
@@ -401,6 +402,7 @@
         <Grid Grid.Row="2">
             <ListView
                 Name="SearchResultList"
+                LostFocus="SearchResultList_LostFocus"
                 BorderThickness="0"
                 ItemContainerStyle="{StaticResource ListViewItemGraySelectStyle}"
                 ItemsSource="{Binding SearchItemList}"

+ 14 - 0
PDF Office/Views/BOTA/SearchContent.xaml.cs

@@ -175,5 +175,19 @@ namespace PDF_Office.Views.BOTA
                 e.Handled = true;
             }
         }
+
+        private void SearchResultList_LostFocus(object sender, RoutedEventArgs e)
+        {
+            SearchResultList.SelectedIndex = -1;
+        }
+
+        private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
+        {
+            SearchContent searchContent = sender as SearchContent;
+            if (searchContent!=null&& searchContent.ActualWidth>209&& searchContent.ActualWidth<216)
+            {
+                SearchText.Focus();
+            }
+        }
     }
 }

+ 1 - 2
PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml.cs

@@ -34,13 +34,12 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
         }
         private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
         {
-            PageRangeComboBox.CurrentPage = true;
+            PageRangeComboBox.CurrentPage = !((ConverterExcelDialogViewModel)this.DataContext).IsCurrentPageIndex;
             if (PageRangeComboBox.CurrentPage)
             {
                 ComboBoxItem comboBoxItem = new ComboBoxItem();
                 comboBoxItem.Content = "当前页面";
                 PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
-
             }
         }
 

+ 1 - 1
PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml.cs

@@ -35,7 +35,7 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
         }
         private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
         {
-            PageRangeComboBox.CurrentPage = true;
+            PageRangeComboBox.CurrentPage  = !((ConverterImgDialogViewModel)this.DataContext).IsCurrentPageIndex;
             if (PageRangeComboBox.CurrentPage)
             {
                 ComboBoxItem comboBoxItem = new ComboBoxItem();

+ 1 - 1
PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml.cs

@@ -34,7 +34,7 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
 
         private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
         {
-            PageRangeComboBox.CurrentPage = true;
+            PageRangeComboBox.CurrentPage = !((ConverterPPTDialogViewModel)this.DataContext).IsCurrentPageIndex;
             if (PageRangeComboBox.CurrentPage)
             {
                 ComboBoxItem comboBoxItem = new ComboBoxItem();

+ 1 - 1
PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml.cs

@@ -34,7 +34,7 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
         }
         private void PageRangeComboBox_Loaded(object sender, RoutedEventArgs e)
         {
-            PageRangeComboBox.CurrentPage = true;
+            PageRangeComboBox.CurrentPage = !((ConverterWordDialogViewModel)this.DataContext).IsCurrentPageIndex;
             if (PageRangeComboBox.CurrentPage)
             {
                 ComboBoxItem comboBoxItem = new ComboBoxItem();

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

@@ -13,6 +13,7 @@
     d:DataContext="{d:DesignInstance Type=homepagetoolsdialogs:HomePagePictureToPDFDialogViewModel}"
     prism:Dialog.WindowStyle="{StaticResource stlWindowEx}"
     d:DesignHeight="640"
+    SizeChanged="userControl_SizeChanged"
     d:DesignWidth="1024"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">

+ 12 - 2
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml.cs

@@ -207,12 +207,10 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
         {
             if (Window.GetWindow(this).WindowState == WindowState.Maximized)
             {
-                ico_max.Visibility = Visibility.Collapsed;
                 System.Windows.SystemCommands.RestoreWindow(Window.GetWindow(this));
             }
             else
             {
-                ico_max.Visibility = Visibility.Visible;
                 System.Windows.SystemCommands.MaximizeWindow(Window.GetWindow(this));
             }
         }
@@ -233,5 +231,17 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
             }
 
         }
+
+        private void userControl_SizeChanged(object sender, SizeChangedEventArgs e)
+        {
+            if (Window.GetWindow(this).WindowState == WindowState.Maximized)
+            {
+                ico_max.Visibility = Visibility.Collapsed;
+            }
+            else
+            {
+                ico_max.Visibility = Visibility.Visible;
+            }
+        }
     }
 }

+ 1 - 0
PDF Office/Views/Dialog/NoviceGuidDialog.xaml

@@ -224,6 +224,7 @@
                 Height="22"
                 Margin="0,8,0,0"
                 HorizontalAlignment="Center"
+                Command="{Binding NextTimeCommand}"
                 Content="Next Time"
                 Style="{StaticResource btn.link}"
                 Visibility="{Binding NextTimeVisible}" />

+ 1 - 1
PDF Office/Views/Dialog/ToolsDialogs/MergeDialog.xaml

@@ -164,7 +164,7 @@
                                             <TextBlock Text="{Binding DocPageCount}"  FontFamily="Segoe UI" FontSize="14" FontWeight="Regular" Foreground="{StaticResource color.sys.text.neutral.lv3}"/>
                                         </StackPanel>
                                         <StackPanel Grid.Column="4" HorizontalAlignment="Stretch" VerticalAlignment="Center">
-                                            <customcontrol:WritableComboBox SelectedIndex="0" Width="150" Height="30" MaxPageRange="{Binding SDKPageCount}" Text="{Binding SetPageRange, Mode=TwoWay}"/>
+                                            <customcontrol:WritableComboBox SelectedIndex="0" Width="150" Height="30" MaxPageRange="{Binding SDKPageCount}" PageIndexList="{Binding SetPageRange, Mode=TwoWay}" Text="{Binding SetPageRangeStr,Mode=TwoWay}"/>
                                         </StackPanel>
                                         <TextBlock Grid.Column="6" Text="{Binding DocSize}"  HorizontalAlignment="Center" VerticalAlignment="Center" TextTrimming="CharacterEllipsis"/>
                                         <StackPanel Grid.Column="8" VerticalAlignment="Center" HorizontalAlignment="Stretch">

+ 1 - 1
PDF Office/Views/HomePanel/RecentFiles/DocItemControl.xaml.cs

@@ -53,7 +53,7 @@ namespace PDF_Office.Views.HomePanel.RecentFiles
                     }
                     else
                     CoverImage.Source = ToolMethod.GetFileThumbImg("pack://application:,,,/Resources//FilesType/ic_propertybar_file_png_Large.png");
-                    tempdoc.Release();
+                    tempdoc?.Release();
                 }
             }
         }

+ 2 - 2
PDF Office/Views/MainWindow.xaml.cs

@@ -127,11 +127,11 @@ namespace PDF_Office.Views
 
             if (this.WindowState == WindowState.Maximized)
             {
-                ico_max.Visibility = Visibility.Visible;
+                ico_max.Visibility = Visibility.Collapsed;
             }
             else
             {
-                ico_max.Visibility = Visibility.Collapsed;
+                ico_max.Visibility = Visibility.Visible;
             }
         }
 

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 186 - 125
PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml


+ 459 - 304
PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml

@@ -1,34 +1,39 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.FreetextAnnotProperty"
-             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.PropertyPanel.AnnotPanel"
-             xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
-             xmlns:cusColor="clr-namespace:PDF_Office.CustomControl.CompositeControl"
-             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
-             xmlns:prism="http://prismlibrary.com/"             
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
-             xmlns:cus="clr-namespace:PDF_Office.CustomControl" xmlns:annotpanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel" d:DataContext="{d:DesignInstance Type=annotpanel:FreetextAnnotPropertyViewModel}"
-             mc:Ignorable="d"
-             d:DesignHeight="850" d:DesignWidth="800">
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.FreetextAnnotProperty"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+    xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
+    xmlns:annotpanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:cusColor="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    d:DataContext="{d:DesignInstance Type=annotpanel:FreetextAnnotPropertyViewModel}"
+    d:DesignHeight="850"
+    d:DesignWidth="260"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    Background="{StaticResource color.sys.layout.mg}"
+    mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
-                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
+                <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
+                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
-            <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
-            <Convert:BoolToVisible x:Key="BoolToVisible"/>
-            <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert"/>
-            <Convert:TextAlignToCheckedConverter x:Key="TextAlignToCheckedConverter"/>
+            <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
+            <Convert:BoolToVisible x:Key="BoolToVisible" />
+            <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert" />
+            <Convert:TextAlignToCheckedConverter x:Key="TextAlignToCheckedConverter" />
             <Style x:Key="line1Style" TargetType="{x:Type Line}">
                 <Setter Property="Visibility">
                     <Setter.Value>
                         <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
-                            <Binding ElementName="TextAlignLeftBtn" Path="IsChecked"/>
-                            <Binding ElementName="TextAlignCenterBtn" Path="IsChecked"/>
+                            <Binding ElementName="TextAlignLeftBtn" Path="IsChecked" />
+                            <Binding ElementName="TextAlignCenterBtn" Path="IsChecked" />
                         </MultiBinding>
                     </Setter.Value>
                 </Setter>
@@ -37,143 +42,178 @@
                 <Setter Property="Visibility">
                     <Setter.Value>
                         <MultiBinding Converter="{StaticResource CheckToVisibleMutiConvert}">
-                            <Binding ElementName="TextAlignCenterBtn" Path="IsChecked"/>
-                            <Binding ElementName="TextAlignRightBtn" Path="IsChecked"/>
+                            <Binding ElementName="TextAlignCenterBtn" Path="IsChecked" />
+                            <Binding ElementName="TextAlignRightBtn" Path="IsChecked" />
                         </MultiBinding>
                     </Setter.Value>
                 </Setter>
             </Style>
 
             <DataTemplate x:Key="FontStyleData">
-                <Grid >
-                    <TextBlock Text="{Binding mFontStyleName}" Foreground="Black"/>
+                <Grid>
+                    <TextBlock Foreground="Black" Text="{Binding mFontStyleName}" />
                 </Grid>
             </DataTemplate>
         </ResourceDictionary>
     </UserControl.Resources>
-    <Grid Background="#F3F3F3">
+    <Grid>
         <StackPanel>
-            <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0" Text="{Binding T_Title}"/>
-            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0"
-                     Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                    >
+            <TextBlock
+                Name="AnnotTypeTitle"
+                Margin="10,8,0,0"
+                HorizontalAlignment="Left"
+                FontFamily="Segoe UI Semibold"
+                FontSize="18"
+                FontWeight="SemiBold"
+                LineHeight="24"
+                Text="{Binding T_Title}" />
+            <Border
+                Width="228"
+                Height="100"
+                Margin="0,8,0,0"
+                Background="White"
+                BorderBrush="#DDDDDD"
+                BorderThickness="1"
+                CornerRadius="2"
+                Visibility="{Binding BasicVm.IsMultiSelected, Converter={StaticResource InvertBoolToVisibleConvert}}">
                 <Grid>
-                    <Border Name="FreeTextBorder" HorizontalAlignment="Center" VerticalAlignment="Center" Padding="5"
+                    <Border
+                        Name="FreeTextBorder"
+                        Padding="5"
+                        HorizontalAlignment="Center"
+                        VerticalAlignment="Center"
+                        Background="{Binding BasicVm.FillColor}"
+                        Opacity="{Binding BasicVm.FillOpacity}">
+                        <TextBlock
+                            Name="SampleText"
+                            HorizontalAlignment="Center"
+                            VerticalAlignment="Center"
+                            FontFamily="{Binding FontVm.CurrentFontFamily.ValueStr}"
+                            FontSize="{Binding FontVm.CurrentFontSize.Value}"
+                            FontStyle="{Binding FontVm.FontStyleItem}"
+                            FontWeight="{Binding FontVm.FontWeightItem}"
+                            Foreground="{Binding FontVm.FontColor}"
                             Opacity="{Binding BasicVm.FillOpacity}"
-                            Background="{Binding BasicVm.FillColor}">
-                        <TextBlock Name="SampleText"
-                                   Foreground="{Binding FontVm.FontColor}" 
-                                   FontFamily="{Binding  FontVm.CurrentFontFamily.ValueStr}"
-                                   FontWeight="{Binding FontVm.FontWeightItem}" 
-                                   FontStyle="{Binding FontVm.FontStyleItem}"
-                                   FontSize="{Binding FontVm.CurrentFontSize.Value}" Opacity="{Binding BasicVm.FillOpacity}"
-                                   Text="Sample" HorizontalAlignment="Center" VerticalAlignment="Center">
-                        </TextBlock>
+                            Text="Sample" />
                     </Border>
 
-                    <Path Name="UnderlinePath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
+                    <Path
+                        Name="UnderlinePath"
+                        Margin="0,51,0,0"
+                        HorizontalAlignment="Center"
+                        StrokeThickness="2"
+                        Visibility="Collapsed">
                         <Path.Data>
-                            <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
+                            <LineGeometry StartPoint="0,0" EndPoint="62,0" />
                         </Path.Data>
                     </Path>
-                    <Path Name="StrikeoutPath" HorizontalAlignment="Center" StrokeThickness="2" Margin="0,40,0,0" Visibility="Collapsed">
+                    <Path
+                        Name="StrikeoutPath"
+                        Margin="0,40,0,0"
+                        HorizontalAlignment="Center"
+                        StrokeThickness="2"
+                        Visibility="Collapsed">
                         <Path.Data>
-                            <LineGeometry StartPoint="0,0" EndPoint="62,0"></LineGeometry>
+                            <LineGeometry StartPoint="0,0" EndPoint="62,0" />
                         </Path.Data>
                     </Path>
-                    <Path Name="SquigglyPath"  HorizontalAlignment="Center" StrokeThickness="2" Margin="0,51,0,0" Visibility="Collapsed">
-
-                    </Path>
+                    <Path
+                        Name="SquigglyPath"
+                        Margin="0,51,0,0"
+                        HorizontalAlignment="Center"
+                        StrokeThickness="2"
+                        Visibility="Collapsed" />
                 </Grid>
             </Border>
 
             <Border
-                    Height="32"
-                    Margin="15,8,15,18"
-                    BorderBrush="#E2E3E6"
-                    BorderThickness="0">
+                Height="32"
+                Margin="15,8,15,18"
+                BorderBrush="#E2E3E6"
+                BorderThickness="0">
                 <Grid>
                     <Grid.ColumnDefinitions>
-                        <ColumnDefinition/>
-                        <ColumnDefinition Width="auto"/>
+                        <ColumnDefinition />
+                        <ColumnDefinition Width="auto" />
                     </Grid.ColumnDefinitions>
                     <CompositeControl:CustomComboControl
-                            x:Name="ComBoxPresetFont"
-                            Width="188"
-                            Height="32"
-                            HorizontalAlignment="Left"
-                            IsValueContent="True"
-                            ItemSource="{Binding FontVm.PresetFontItems,Mode=OneWay}"
-                            SelectedItems="{Binding FontVm.CurrentPresetFont, Mode=TwoWay}">
+                        x:Name="ComBoxPresetFont"
+                        Width="188"
+                        Height="32"
+                        HorizontalAlignment="Left"
+                        IsValueContent="True"
+                        ItemSource="{Binding FontVm.PresetFontItems, Mode=OneWay}"
+                        SelectedItems="{Binding FontVm.CurrentPresetFont, Mode=TwoWay}">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="ValueChanged">
-                                <i:InvokeCommandAction Command="{Binding SelectedPresetFontCommand}"/>
+                                <i:InvokeCommandAction Command="{Binding SelectedPresetFontCommand}" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </CompositeControl:CustomComboControl>
 
-
-                    <Button Grid.Column="1"
-                            Width="32"
-                            Height="32"
-                            HorizontalAlignment="Left" Command="{Binding CustomFontStyleCommand}"
-                            Style="{StaticResource btn.sec}">
+                    <Button
+                        Grid.Column="1"
+                        Width="32"
+                        Height="32"
+                        HorizontalAlignment="Left"
+                        Command="{Binding CustomFontStyleCommand}"
+                        Style="{StaticResource btn.sec}">
                         <Path
-                                Width="16"
-                                Height="16"
-                                Data="M4 8C4 8.82843 3.32843 9.5 2.5 9.5C1.67157 9.5 1 8.82843 1 8C1 7.17157 1.67157 6.5 2.5 6.5C3.32843 6.5 4 7.17157 4 8ZM9.3999 8C9.3999 8.82843 8.72833 9.5 7.8999 9.5C7.07148 9.5 6.3999 8.82843 6.3999 8C6.3999 7.17157 7.07148 6.5 7.8999 6.5C8.72833 6.5 9.3999 7.17157 9.3999 8ZM13.5 9.5C14.3284 9.5 15 8.82843 15 8C15 7.17157 14.3284 6.5 13.5 6.5C12.6716 6.5 12 7.17157 12 8C12 8.82843 12.6716 9.5 13.5 9.5Z"
-                                Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
+                            Width="16"
+                            Height="16"
+                            Data="M4 8C4 8.82843 3.32843 9.5 2.5 9.5C1.67157 9.5 1 8.82843 1 8C1 7.17157 1.67157 6.5 2.5 6.5C3.32843 6.5 4 7.17157 4 8ZM9.3999 8C9.3999 8.82843 8.72833 9.5 7.8999 9.5C7.07148 9.5 6.3999 8.82843 6.3999 8C6.3999 7.17157 7.07148 6.5 7.8999 6.5C8.72833 6.5 9.3999 7.17157 9.3999 8ZM13.5 9.5C14.3284 9.5 15 8.82843 15 8C15 7.17157 14.3284 6.5 13.5 6.5C12.6716 6.5 12 7.17157 12 8C12 8.82843 12.6716 9.5 13.5 9.5Z"
+                            Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
                     </Button>
                 </Grid>
             </Border>
 
             <StackPanel Margin="15,0,15,0">
                 <TextBlock
-                        Margin="0,0,0,10" FontWeight="Normal" 
-                        Foreground="{StaticResource color.sys.text.neutral.lv2}"
-                        Style="{StaticResource PropertyHeaderLv2}"
-                        Text="{Binding T_Font}" />
+                    Margin="0,0,0,10"
+                    FontWeight="Normal"
+                    Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                    Style="{StaticResource PropertyHeaderLv2}"
+                    Text="{Binding T_Font}" />
 
                 <StackPanel>
                     <CompositeControl:CustomComboControl
-                            x:Name="FontFamilyBox"
-                            Height="32"
-                            IsValueContent="True"
-                            ItemSource="{Binding FontVm.FontFamilyItems,Mode=OneWay}"
-                            SelectedItems="{Binding FontVm.CurrentFontFamily, Mode=TwoWay}" >
+                        x:Name="FontFamilyBox"
+                        Height="32"
+                        IsValueContent="True"
+                        ItemSource="{Binding FontVm.FontFamilyItems, Mode=OneWay}"
+                        SelectedItems="{Binding FontVm.CurrentFontFamily, Mode=TwoWay}">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="ValueChanged">
-                                <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}"/>
+                                <i:InvokeCommandAction Command="{Binding FontFamilyChangedCommand}" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </CompositeControl:CustomComboControl>
 
                     <Grid Margin="0,8">
                         <CompositeControl:CustomComboControl
-                                x:Name="FontStyleBox"
-                                Width="110"
-                                Height="32"
-                                HorizontalAlignment="Left"
-                                IsValueContent="True"
-                                ItemSource="{Binding FontVm.FontStyleItems,Mode=OneWay}"
-                                SelectedItems="{Binding FontVm.CurrrentFontWeightStyle, Mode=TwoWay}">
+                            x:Name="FontStyleBox"
+                            Width="110"
+                            Height="32"
+                            HorizontalAlignment="Left"
+                            IsValueContent="True"
+                            ItemSource="{Binding FontVm.FontStyleItems, Mode=OneWay}"
+                            SelectedItems="{Binding FontVm.CurrrentFontWeightStyle, Mode=TwoWay}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="ValueChanged">
-                                    <i:InvokeCommandAction Command="{Binding FontStyleWeightChangedCommand}"/>
+                                    <i:InvokeCommandAction Command="{Binding FontStyleWeightChangedCommand}" />
                                 </i:EventTrigger>
                             </i:Interaction.Triggers>
                         </CompositeControl:CustomComboControl>
 
-
                         <CompositeControl:CustomComboControl
-                                x:Name="FontSizeBox"
-                                Width="110"
-                                Height="32"
-                                HorizontalAlignment="Right"
-                                SelectedItems="{Binding FontVm.CurrentFontSize, Mode=TwoWay}" >
+                            x:Name="FontSizeBox"
+                            Width="110"
+                            Height="32"
+                            HorizontalAlignment="Right"
+                            SelectedItems="{Binding FontVm.CurrentFontSize, Mode=TwoWay}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="ValueChanged">
-                                    <i:InvokeCommandAction Command="{Binding FontSizeChangedCommand}"/>
+                                    <i:InvokeCommandAction Command="{Binding FontSizeChangedCommand}" />
                                 </i:EventTrigger>
                             </i:Interaction.Triggers>
                         </CompositeControl:CustomComboControl>
@@ -181,198 +221,201 @@
                     <Grid>
                         <StackPanel Orientation="Horizontal">
                             <RadioButton
-                                    x:Name="TextAlignLeftBtn"
-                                    Width="32"
-                                    Height="32"
-                                    VerticalContentAlignment="Center"
-                                    Background="Transparent"
-                                    Foreground="#616469"
-                                    GroupName="TextAlign"
-                                    IsChecked="{Binding FontVm.StrTextAlign,Mode=OneWay,Converter={StaticResource TextAlignToCheckedConverter},ConverterParameter=AlignLeft}"
-                                    Style="{DynamicResource GreyBgRadioBtnStyle}"
-                                    Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignLeftBtn, Path=Tag}" 
-                                    Tag="AlignLeft">
+                                x:Name="TextAlignLeftBtn"
+                                Width="32"
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Background="Transparent"
+                                Command="{Binding TextAlignCheckedCommand}"
+                                CommandParameter="{Binding ElementName=TextAlignLeftBtn, Path=Tag}"
+                                Foreground="#616469"
+                                GroupName="TextAlign"
+                                IsChecked="{Binding FontVm.StrTextAlign, Mode=OneWay, Converter={StaticResource TextAlignToCheckedConverter}, ConverterParameter=AlignLeft}"
+                                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                                Tag="AlignLeft">
                                 <RadioButton.Content>
                                     <Grid Width="32" Height="32">
                                         <Canvas Margin="5,10,0,0">
                                             <Rectangle
-                                                    Canvas.Top="0.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="0.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Top="4.25"
-                                                    Width="8"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="4.25"
+                                                Width="8"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Top="12.25"
-                                                    Width="8"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="12.25"
+                                                Width="8"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Top="8.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="8.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignLeftBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                         </Canvas>
                                     </Grid>
                                 </RadioButton.Content>
                             </RadioButton>
                             <RadioButton
-                                    x:Name="TextAlignCenterBtn"
-                                    Width="32"
-                                    Height="32"
-                                    Margin="8,0"
-                                    VerticalContentAlignment="Center"
-                                    Background="Transparent"
-                                    Foreground="#616469"
-                                    GroupName="TextAlign"
-                                    Style="{DynamicResource GreyBgRadioBtnStyle}"
-                                    IsChecked="{Binding FontVm.StrTextAlign,Mode=OneWay,Converter={StaticResource TextAlignToCheckedConverter},ConverterParameter=AlignCenter}"
-                                    Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignCenterBtn, Path=Tag}" 
-                                    Tag="AlignCenter">
+                                x:Name="TextAlignCenterBtn"
+                                Width="32"
+                                Height="32"
+                                Margin="8,0"
+                                VerticalContentAlignment="Center"
+                                Background="Transparent"
+                                Command="{Binding TextAlignCheckedCommand}"
+                                CommandParameter="{Binding ElementName=TextAlignCenterBtn, Path=Tag}"
+                                Foreground="#616469"
+                                GroupName="TextAlign"
+                                IsChecked="{Binding FontVm.StrTextAlign, Mode=OneWay, Converter={StaticResource TextAlignToCheckedConverter}, ConverterParameter=AlignCenter}"
+                                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                                Tag="AlignCenter">
                                 <RadioButton.Content>
                                     <Grid Width="32" Height="32">
                                         <Canvas Margin="5,10,0,0">
                                             <Rectangle
-                                                    Canvas.Top="0.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="0.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Left="3"
-                                                    Canvas.Top="4.25"
-                                                    Width="8"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Left="3"
+                                                Canvas.Top="4.25"
+                                                Width="8"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Left="3"
-                                                    Canvas.Top="12.25"
-                                                    Width="8"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Left="3"
+                                                Canvas.Top="12.25"
+                                                Width="8"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Top="8.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="8.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignCenterBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                         </Canvas>
                                     </Grid>
                                 </RadioButton.Content>
                             </RadioButton>
 
                             <RadioButton
-                                    x:Name="TextAlignRightBtn"
-                                    Grid.Column="2"
-                                    Width="32"
-                                    Height="32"
-                                    VerticalContentAlignment="Center"
-                                    Background="Transparent"
-                                    Foreground="#616469"
-                                    GroupName="TextAlign"
-                                    Style="{DynamicResource GreyBgRadioBtnStyle}"
-                                    IsChecked="{Binding FontVm.StrTextAlign,Mode=OneWay,Converter={StaticResource TextAlignToCheckedConverter},ConverterParameter=AlignRight}"
-                                    Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignRightBtn, Path=Tag}" 
-                                   Tag="AlignRight">
+                                x:Name="TextAlignRightBtn"
+                                Grid.Column="2"
+                                Width="32"
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Background="Transparent"
+                                Command="{Binding TextAlignCheckedCommand}"
+                                CommandParameter="{Binding ElementName=TextAlignRightBtn, Path=Tag}"
+                                Foreground="#616469"
+                                GroupName="TextAlign"
+                                IsChecked="{Binding FontVm.StrTextAlign, Mode=OneWay, Converter={StaticResource TextAlignToCheckedConverter}, ConverterParameter=AlignRight}"
+                                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                                Tag="AlignRight">
                                 <RadioButton.Content>
                                     <Grid Width="32" Height="32">
                                         <Canvas Margin="5,10,0,0">
                                             <Rectangle
-                                                    Canvas.Top="0.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="0.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Left="6"
-                                                    Canvas.Top="4.25"
-                                                    Width="8"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Left="6"
+                                                Canvas.Top="4.25"
+                                                Width="8"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Left="6"
-                                                    Canvas.Top="12.25"
-                                                    Width="8"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Left="6"
+                                                Canvas.Top="12.25"
+                                                Width="8"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Top="8.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="8.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignRightBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                         </Canvas>
                                     </Grid>
                                 </RadioButton.Content>
                             </RadioButton>
 
                             <RadioButton
-                                    x:Name="TextAlignBtn"
-                                    Grid.Column="3"
-                                    Width="32"
-                                    Height="32"
-                                    Margin="8,0"
-                                    VerticalContentAlignment="Center"
-                                    Background="Transparent"
-                                    Foreground="#616469"
-                                    GroupName="TextAlign"
-                                    Style="{DynamicResource GreyBgRadioBtnStyle}"
-                                    IsChecked="{Binding FontVm.StrTextAlign,Mode=OneWay,Converter={StaticResource TextAlignToCheckedConverter},ConverterParameter=Justify}"
-                                    Command="{Binding TextAlignCheckedCommand}" CommandParameter="{Binding ElementName=TextAlignBtn, Path=Tag}" 
-                                    Tag="Justify">
+                                x:Name="TextAlignBtn"
+                                Grid.Column="3"
+                                Width="32"
+                                Height="32"
+                                Margin="8,0"
+                                VerticalContentAlignment="Center"
+                                Background="Transparent"
+                                Command="{Binding TextAlignCheckedCommand}"
+                                CommandParameter="{Binding ElementName=TextAlignBtn, Path=Tag}"
+                                Foreground="#616469"
+                                GroupName="TextAlign"
+                                IsChecked="{Binding FontVm.StrTextAlign, Mode=OneWay, Converter={StaticResource TextAlignToCheckedConverter}, ConverterParameter=Justify}"
+                                Style="{DynamicResource GreyBgRadioBtnStyle}"
+                                Tag="Justify">
                                 <RadioButton.Content>
                                     <Grid Width="32" Height="32">
                                         <Canvas Margin="5,10,0,0">
                                             <Rectangle
-                                                    Canvas.Top="0.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="0.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Top="8.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="8.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Top="4.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="4.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                             <Rectangle
-                                                    Canvas.Top="12.25"
-                                                    Width="14"
-                                                    Height="1.5"
-                                                    Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
-                                                    StrokeThickness="1.5" />
+                                                Canvas.Top="12.25"
+                                                Width="14"
+                                                Height="1.5"
+                                                Stroke="{Binding ElementName=TextAlignBtn, Path=Foreground}"
+                                                StrokeThickness="1.5" />
                                         </Canvas>
                                     </Grid>
                                 </RadioButton.Content>
                             </RadioButton>
                         </StackPanel>
                         <cusColor:ColorContent
-                                x:Name="FontColorBox"
-                                Width="56"
-                                HorizontalAlignment="Right"
-                                ShowColorList="Collapsed"  
-                                UIColor="{Binding FontVm.CurrentFontColor,Mode=OneWay}"
-                            >
+                            x:Name="FontColorBox"
+                            Width="56"
+                            HorizontalAlignment="Right"
+                            ShowColorList="Collapsed"
+                            UIColor="{Binding FontVm.CurrentFontColor, Mode=OneWay}">
                             <i:Interaction.Triggers>
                                 <i:EventTrigger EventName="SelectedColorInvoke">
-                                    <i:InvokeCommandAction Command="{Binding SelectedColorCommand}" CommandParameter="{Binding ElementName=FontColorBox,Path=SelectedColor}"/>
+                                    <i:InvokeCommandAction Command="{Binding SelectedColorCommand}" CommandParameter="{Binding ElementName=FontColorBox, Path=SelectedColor}" />
                                 </i:EventTrigger>
                             </i:Interaction.Triggers>
                         </cusColor:ColorContent>
@@ -381,111 +424,210 @@
             </StackPanel>
             <Grid Margin="15,18,15,0">
                 <Grid.RowDefinitions>
-                    <RowDefinition Height="auto"/>
-                    <RowDefinition/>
+                    <RowDefinition Height="auto" />
+                    <RowDefinition />
                 </Grid.RowDefinitions>
-                <TextBlock Text="{Binding T_Fill}" FontWeight="Normal" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center"/>
-                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"
-                                              InitValue="{Binding BasicVm.FillOpacity,Mode=OneWay}"
-                    Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"                           
-                                              >
+                <TextBlock
+                    VerticalAlignment="Center"
+                    FontWeight="Normal"
+                    Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                    Text="{Binding T_Fill}" />
+                <CompositeControl:SlidContent
+                    x:Name="layerThick"
+                    HorizontalAlignment="Right"
+                    InitValue="{Binding BasicVm.FillOpacity, Mode=OneWay}"
+                    Visibility="{Binding BasicVm.IsMultiSelected, Converter={StaticResource InvertBoolToVisibleConvert}}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedValueChanged">
-                            <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick,Path=Value}"/>
+                            <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick, Path=Value}" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:SlidContent>
-                <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor" Margin="0,8,0,0"
-                                               ItemSource="{Binding BasicVm.FillColorItems}"
-                                               ColorType="Fill"
-                                               UIColor="{Binding BasicVm.CurrentFillColor,Mode=OneWay}">
+                <CompositeControl:ColorContent
+                    x:Name="cusColor"
+                    Grid.Row="1"
+                    Margin="0,8,0,0"
+                    ColorType="Fill"
+                    ItemSource="{Binding BasicVm.FillColorItems}"
+                    UIColor="{Binding BasicVm.CurrentFillColor, Mode=OneWay}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">
-                            <i:InvokeCommandAction Command="{Binding SelectedFillColorCommand}" CommandParameter="{Binding ElementName=cusColor,Path=SelectedColor}"/>
+                            <i:InvokeCommandAction Command="{Binding SelectedFillColorCommand}" CommandParameter="{Binding ElementName=cusColor, Path=SelectedColor}" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:ColorContent>
             </Grid>
 
-
-            <StackPanel Visibility="{Binding IsFillFreeTextAnnot,Converter={StaticResource BoolToVisible}}">
-                <TextBlock Margin="0,8,0,8" Text="Date Type" Foreground="{StaticResource color.sys.text.neutral.lv2}" />
+            <StackPanel Visibility="{Binding IsFillFreeTextAnnot, Converter={StaticResource BoolToVisible}}">
+                <TextBlock
+                    Margin="0,8,0,8"
+                    Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                    Text="Date Type" />
                 <CompositeControl:CustomComboControl
-                                x:Name="DateTimeBox"
-                                Width="228"
-                                Height="32"
-                                HorizontalAlignment="Left"
-                                IsValueContent="True"
-                                ItemSource="{Binding DateFormatItems,Mode=OneWay}"
-                                SelectedItems="{Binding CurrrentDateFormat, Mode=TwoWay}">
+                    x:Name="DateTimeBox"
+                    Width="228"
+                    Height="32"
+                    HorizontalAlignment="Left"
+                    IsValueContent="True"
+                    ItemSource="{Binding DateFormatItems, Mode=OneWay}"
+                    SelectedItems="{Binding CurrrentDateFormat, Mode=TwoWay}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="ValueChanged">
-                            <i:InvokeCommandAction Command="{Binding DateFormatChangedCommand}"/>
+                            <i:InvokeCommandAction Command="{Binding DateFormatChangedCommand}" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:CustomComboControl>
 
-                <CheckBox x:Name="isShowTime" Margin="0,16,0,0" Content="Show Time" IsChecked="{Binding IsCheckedTime,Mode=TwoWay}"
-                      Command="{Binding ShowTimeCheckedChnagedCommand}"
-                      >
-
-                </CheckBox>
-
+                <CheckBox
+                    x:Name="isShowTime"
+                    Margin="0,16,0,0"
+                    Command="{Binding ShowTimeCheckedChnagedCommand}"
+                    Content="Show Time"
+                    IsChecked="{Binding IsCheckedTime, Mode=TwoWay}" />
             </StackPanel>
-        
-            <!--MVP不上-->
 
-            <TextBlock x:Name="thicknessText" Visibility="Collapsed" FontFamily="Segoe UI Semibold" FontWeight="SemiBold" FontSize="14" LineHeight="20" Margin="12,14,0,0" >Thickness</TextBlock>
+            <!--  MVP不上  -->
+
+            <TextBlock
+                x:Name="thicknessText"
+                Margin="12,14,0,0"
+                FontFamily="Segoe UI Semibold"
+                FontSize="14"
+                FontWeight="SemiBold"
+                LineHeight="20"
+                Visibility="Collapsed">
+                Thickness
+            </TextBlock>
 
             <Grid Visibility="Collapsed">
                 <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="*"></ColumnDefinition>
-                    <ColumnDefinition Width="auto"></ColumnDefinition>
+                    <ColumnDefinition Width="*" />
+                    <ColumnDefinition Width="auto" />
                 </Grid.ColumnDefinitions>
 
-                <Slider Name="ThicknessSlider" VerticalAlignment="Center" Margin="12,0,0,0" Width="148"  Minimum="0" Maximum="24" IsSelectionRangeEnabled="True" IsMoveToPointEnabled="True" 
-                    Style="{StaticResource RoundThumbSlider}"  TickFrequency="1" IsSnapToTickEnabled="True" >
+                <Slider
+                    Name="ThicknessSlider"
+                    Width="148"
+                    Margin="12,0,0,0"
+                    VerticalAlignment="Center"
+                    IsMoveToPointEnabled="True"
+                    IsSelectionRangeEnabled="True"
+                    IsSnapToTickEnabled="True"
+                    Maximum="24"
+                    Minimum="0"
+                    Style="{StaticResource RoundThumbSlider}"
+                    TickFrequency="1">
                     <Slider.Resources>
                         <SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="#477EDE" />
                         <SolidColorBrush x:Key="{x:Static SystemColors.ControlDarkDarkBrushKey}" Color="#E2E3E6" />
                     </Slider.Resources>
                 </Slider>
 
-
-                <Border Grid.Column="1" BorderBrush="#E2E3E6"  Width="80" Height="32" Margin="0,0,11,0"  BorderThickness="0">
+                <Border
+                    Grid.Column="1"
+                    Width="80"
+                    Height="32"
+                    Margin="0,0,11,0"
+                    BorderBrush="#E2E3E6"
+                    BorderThickness="0">
                     <Grid>
-                        <ComboBox Name="ThicknessBox" BorderThickness="1" Padding="10" Background="Transparent" BorderBrush="#FFE2E3E6"
-                                  MaxDropDownHeight="200">
+                        <ComboBox
+                            Name="ThicknessBox"
+                            Padding="10"
+                            Background="Transparent"
+                            BorderBrush="#FFE2E3E6"
+                            BorderThickness="1"
+                            MaxDropDownHeight="200">
                             <ComboBox.ItemContainerStyle>
                                 <Style TargetType="{x:Type ComboBoxItem}">
-                                    <Setter Property="Padding" Value="10 0 0 0"/>
+                                    <Setter Property="Padding" Value="10,0,0,0" />
                                 </Style>
                             </ComboBox.ItemContainerStyle>
-                            <ComboBoxItem Content="1" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="3" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="6" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="9" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="12" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="15" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="18" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="21" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
-                            <ComboBoxItem Content="24" Height="32" VerticalContentAlignment="Center" Template="{StaticResource comboxitem}"/>
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="1"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="3"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="6"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="9"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="12"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="15"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="18"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="21"
+                                Template="{StaticResource comboxitem}" />
+                            <ComboBoxItem
+                                Height="32"
+                                VerticalContentAlignment="Center"
+                                Content="24"
+                                Template="{StaticResource comboxitem}" />
                         </ComboBox>
-                        <TextBox Name="ThicknessText" Background="White" FontFamily="Segoe UI" FontSize="14"  Height="20" Margin="10,0,35,0" IsReadOnly="True"
-                             BorderThickness="0" VerticalAlignment="Center" TextAlignment="Left" >
-                        </TextBox>
+                        <TextBox
+                            Name="ThicknessText"
+                            Height="20"
+                            Margin="10,0,35,0"
+                            VerticalAlignment="Center"
+                            Background="White"
+                            BorderThickness="0"
+                            FontFamily="Segoe UI"
+                            FontSize="14"
+                            IsReadOnly="True"
+                            TextAlignment="Left" />
                     </Grid>
                 </Border>
             </Grid>
 
-            <StackPanel Visibility="Collapsed" Orientation="Horizontal" Margin="0,20,0,0">
+            <StackPanel
+                Margin="0,20,0,0"
+                Orientation="Horizontal"
+                Visibility="Collapsed">
 
-                <RadioButton x:Name="BtnSolid" Tag="Solid" GroupName="LineMode"
-                                 Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
-                                 VerticalContentAlignment="Center" Background="Transparent"
-                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                <RadioButton
+                    x:Name="BtnSolid"
+                    Width="105"
+                    Height="32"
+                    Margin="0,0,10,0"
+                    VerticalContentAlignment="Center"
+                    Background="Transparent"
+                    Foreground="#616469"
+                    GroupName="LineMode"
+                    Style="{DynamicResource GreyBgRadioBtnStyle}"
+                    Tag="Solid">
                     <RadioButton.Content>
-                        <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" />
+                        <Line
+                            Stroke="Black"
+                            StrokeThickness="2"
+                            X1="10"
+                            X2="90"
+                            Y1="5"
+                            Y2="5" />
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
@@ -494,12 +636,26 @@
                     </i:Interaction.Triggers>
                 </RadioButton>
 
-                <RadioButton x:Name="BtnDashed" Tag="Dashed" GroupName="LineMode"
-                                 Width="105" Height="32" Margin="0,0" Foreground="#616469"
-                                 VerticalContentAlignment="Center" Background="Transparent"
-                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                <RadioButton
+                    x:Name="BtnDashed"
+                    Width="105"
+                    Height="32"
+                    Margin="0,0"
+                    VerticalContentAlignment="Center"
+                    Background="Transparent"
+                    Foreground="#616469"
+                    GroupName="LineMode"
+                    Style="{DynamicResource GreyBgRadioBtnStyle}"
+                    Tag="Dashed">
                     <RadioButton.Content>
-                        <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
+                        <Line
+                            Stroke="Black"
+                            StrokeDashArray="2"
+                            StrokeThickness="2"
+                            X1="10"
+                            X2="90"
+                            Y1="5"
+                            Y2="5" />
                     </RadioButton.Content>
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="Checked">
@@ -507,8 +663,7 @@
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </RadioButton>
-
             </StackPanel>
         </StackPanel>
     </Grid>
-</UserControl>
+</UserControl>

+ 13 - 12
PDF Office/Views/PropertyPanel/AnnotPanel/ImageAnnotProperty.xaml

@@ -1,12 +1,13 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.ImageAnnotProperty"
-             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.PropertyPanel.AnnotPanel"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-            
-    </Grid>
-</UserControl>
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.ImageAnnotProperty"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    d:DesignHeight="450"
+    d:DesignWidth="260"
+    Background="{StaticResource color.sys.layout.mg}"
+    mc:Ignorable="d">
+    <Grid />
+</UserControl>

+ 3 - 2
PDF Office/Views/PropertyPanel/AnnotPanel/LinkAnnotProperty.xaml

@@ -18,6 +18,7 @@
     d:DesignHeight="680"
     d:DesignWidth="260"
     prism:ViewModelLocator.AutoWireViewModel="True"
+    Background="{StaticResource color.sys.layout.mg}"
     mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
@@ -32,7 +33,7 @@
         </ResourceDictionary>
     </UserControl.Resources>
     <Grid>
-        <StackPanel Background="White" Orientation="Vertical">
+        <StackPanel Background="{StaticResource color.sys.layout.mg}" Orientation="Vertical">
             <TextBlock
                 Name="AnnotTypeTitle"
                 Margin="16,14,0,16"
@@ -41,7 +42,7 @@
                 FontSize="14"
                 FontWeight="Bold"
                 LineHeight="24"
-                Text="{Binding T_Title}"/>
+                Text="{Binding T_Title}" />
             <StackPanel
                 Name="ToggleButtonTab"
                 Margin="12,0,0,0"

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

@@ -12,7 +12,8 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
     d:DesignHeight="450"
-    d:DesignWidth="800"
+    d:DesignWidth="260"
+    Background="{StaticResource color.sys.layout.mg}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
     <UserControl.Resources>
@@ -24,7 +25,7 @@
             <Convert:ColorToBrushConverter x:Key="ColorToBrushConvert" />
             <Convert:CheckToVisibleMutiConvert x:Key="CheckToVisibleMutiConvert" />
             <DashConvert:DashStyleConverter x:Key="DashStyleConverter" />
-            <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
+            <Convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
             <Style x:Key="line1Style" TargetType="{x:Type Line}">
                 <Setter Property="Visibility">
                     <Setter.Value>
@@ -55,7 +56,6 @@
                     </Setter.Value>
                 </Setter>
             </Style>
-
         </ResourceDictionary>
     </UserControl.Resources>
     <Grid Margin="16,0,16,0">
@@ -77,8 +77,7 @@
                 BorderBrush="#DDDDDD"
                 BorderThickness="1"
                 CornerRadius="2"
-                Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                >
+                Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
                 <Grid>
                     <Path
                         Name="SharpPath"
@@ -98,15 +97,13 @@
                 </Grid>
             </Border>
 
-
             <Border
                 Width="162"
                 Height="32"
                 Margin="0,12,0,0"
                 BorderBrush="#FFE2E3E6"
                 BorderThickness="0"  HorizontalAlignment="Left"
-                Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                >
+                Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
                 <Grid Name="ToolGrid">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="40.5" />
@@ -115,21 +112,21 @@
                         <ColumnDefinition Width="40.5" />
                     </Grid.ColumnDefinitions>
 
-                    <RadioButton x:Name="SharpRectBtn" Tag="Rect" GroupName="Shape" 
+                    <RadioButton x:Name="SharpRectBtn" Tag="Rect" GroupName="Shape"
                                  Width="32" Height="32" Margin="0,0" ToolTip="矩形" Padding="7,0,0,0"
                                  VerticalContentAlignment="Center" Background="Transparent"
                                  Style="{DynamicResource GreyBgRadioBtnStyle}">
                         <RadioButton.Content>
                             <Rectangle
-                            Width="16"
-                            Height="16"
-                            HorizontalAlignment="Center"
-                            VerticalAlignment="Center"
-                            Stroke="#273C62" />
+                                Width="16"
+                                Height="16"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Stroke="#273C62" />
                         </RadioButton.Content>
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
-                                <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpRectBtn, Path=Tag}"/>
+                                <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpRectBtn, Path=Tag}" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
@@ -140,15 +137,15 @@
                                  Style="{DynamicResource GreyBgRadioBtnStyle}">
                         <RadioButton.Content>
                             <Ellipse
-                            Width="16"
-                            Height="16"
-                            HorizontalAlignment="Center"
-                            VerticalAlignment="Center"
-                            Stroke="#273C62" />
+                                Width="16"
+                                Height="16"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Stroke="#273C62" />
                         </RadioButton.Content>
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
-                                <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpCircleBtn, Path=Tag}"/>
+                                <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpCircleBtn, Path=Tag}" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
@@ -159,11 +156,11 @@
                                  Style="{DynamicResource GreyBgRadioBtnStyle}">
                         <RadioButton.Content>
                             <Path
-                            Width="16"
-                            Height="16"
-                            HorizontalAlignment="Center"
-                            VerticalAlignment="Center"
-                            Fill="#273C62">
+                                Width="16"
+                                Height="16"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Fill="#273C62">
                                 <Path.Data>
                                     M13.4,2.6 L13.4,8 L12.2,8 L12.1997359,4.648 L2.02426407,14.8242641 L1.17573593,13.9757359 L11.3517359,3.799 L8,3.8 L8,2.6 L13.4,2.6 Z
                                 </Path.Data>
@@ -171,7 +168,7 @@
                         </RadioButton.Content>
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
-                                <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpArrowBtn, Path=Tag}"/>
+                                <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpArrowBtn, Path=Tag}" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
@@ -182,11 +179,11 @@
                                  Style="{DynamicResource GreyBgRadioBtnStyle}">
                         <RadioButton.Content>
                             <Polygon
-                            Width="16"
-                            Height="16"
-                            HorizontalAlignment="Center"
-                            VerticalAlignment="Center"
-                            Fill="#273C62">
+                                Width="16"
+                                Height="16"
+                                HorizontalAlignment="Center"
+                                VerticalAlignment="Center"
+                                Fill="#273C62">
                                 <Polygon.Points>
                                     13.1757359 1.97573593 14.0242641 2.82426407 2.82426407 14.0242641 1.97573593 13.1757359
                                 </Polygon.Points>
@@ -194,7 +191,7 @@
                         </RadioButton.Content>
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
-                                <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpLineBtn, Path=Tag}"/>
+                                <i:InvokeCommandAction Command="{Binding SharpsTypeCommand}" CommandParameter="{Binding ElementName=SharpLineBtn, Path=Tag}" />
                             </i:EventTrigger>
                         </i:Interaction.Triggers>
                     </RadioButton>
@@ -206,24 +203,23 @@
                     <RowDefinition Height="auto" />
                     <RowDefinition />
                 </Grid.RowDefinitions>
-                <TextBlock Text="Fill" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center"/>
+                <TextBlock Text="Fill" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center" />
                 <CompositeControl:SlidContent x:Name="layerFill" HorizontalAlignment="Right"
                                               InitValue="{Binding BasicVm.FillOpacity,Mode=OneWay}"
-                                              Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                                              >
+                                              Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedValueChanged">
-                            <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerFill,Path=Value}"/>
+                            <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerFill,Path=Value}" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:SlidContent>
                 <CompositeControl:ColorContent x:Name="cusFillColor" Grid.Row="1" Margin="0,8,0,0"
                                                ItemSource="{Binding BasicVm.FillColorItems}"
                                                ColorType="Fill"
-                                               UIColor="{Binding BasicVm.CurrentFillColor,Mode=OneWay}" >
+                                               UIColor="{Binding BasicVm.CurrentFillColor,Mode=OneWay}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">
-                            <i:InvokeCommandAction Command="{Binding SelectedFillColorCommand}" CommandParameter="{Binding ElementName=cusFillColor,Path=SelectedColor}"/>
+                            <i:InvokeCommandAction Command="{Binding SelectedFillColorCommand}" CommandParameter="{Binding ElementName=cusFillColor,Path=SelectedColor}" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:ColorContent>
@@ -234,14 +230,13 @@
                     <RowDefinition Height="auto" />
                     <RowDefinition />
                 </Grid.RowDefinitions>
-                <TextBlock Text="Border" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center"/>
-                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right" 
+                <TextBlock Text="Border" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center" />
+                <CompositeControl:SlidContent x:Name="layerThick" HorizontalAlignment="Right"
                                               InitValue="{Binding BasicVm.FillOpacity,Mode=OneWay}"
-                                              Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                                              >
+                                              Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedValueChanged">
-                            <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick,Path=Value}"/>
+                            <i:InvokeCommandAction Command="{Binding SelectedOpacityValueCommand}" CommandParameter="{Binding ElementName=layerThick,Path=Value}" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:SlidContent>
@@ -249,20 +244,19 @@
                 <CompositeControl:ColorContent x:Name="cusColor" Grid.Row="1" Margin="0,8,0,0"
                                                ItemSource="{Binding BasicVm.ColorItems}"
                                                ColorType="Border"
-                                               UIColor="{Binding BasicVm.CurrentBorderColor,Mode=OneWay}" >
+                                               UIColor="{Binding BasicVm.CurrentBorderColor,Mode=OneWay}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">
-                            <i:InvokeCommandAction Command="{Binding SelectedBorderColorCommand}" CommandParameter="{Binding ElementName=cusColor,Path=SelectedColor}"/>
+                            <i:InvokeCommandAction Command="{Binding SelectedBorderColorCommand}" CommandParameter="{Binding ElementName=cusColor,Path=SelectedColor}" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:ColorContent>
-
             </Grid>
 
             <CompositeControl:SlidComboControl x:Name="thickness" Margin="0,0,0,0"  ItemsSource="{Binding ThicknessItems}" Value="{Binding  BasicVm.AnnotThickness,Mode=TwoWay}">
                 <i:Interaction.Triggers>
                     <i:EventTrigger EventName="ValueChanged">
-                        <i:InvokeCommandAction Command="{Binding SelectedThickCommand}" CommandParameter="{Binding ElementName=thickness,Path=Value}"/>
+                        <i:InvokeCommandAction Command="{Binding SelectedThickCommand}" CommandParameter="{Binding ElementName=thickness,Path=Value}" />
                     </i:EventTrigger>
                 </i:Interaction.Triggers>
             </CompositeControl:SlidComboControl>
@@ -270,31 +264,29 @@
             <StackPanel  x:Name="PnlLineStyle" Orientation="Horizontal" Margin="0,20,0,0">
 
                 <RadioButton x:Name="BtnSolid" Tag="Solid" GroupName="LineMode"
-                                 Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
-                                 VerticalContentAlignment="Center" Background="Transparent"
-                                 Command="{Binding LineStyleCommand}"
-                                 CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}" 
-                                 IsChecked="{Binding BasicVm.IsSolidLine}"
-                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                             Width="105" Height="32" Margin="0,0,10,0" Foreground="#616469"
+                             VerticalContentAlignment="Center" Background="Transparent"
+                             Command="{Binding LineStyleCommand}"
+                             CommandParameter="{Binding ElementName=BtnSolid, Path=Tag}"
+                             IsChecked="{Binding BasicVm.IsSolidLine}"
+                             Style="{DynamicResource GreyBgRadioBtnStyle}">
                     <RadioButton.Content>
                         <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" />
                     </RadioButton.Content>
                 </RadioButton>
 
                 <RadioButton x:Name="BtnDashed" Tag="Dashed" GroupName="LineMode"
-                                 Width="105" Height="32" Margin="0,0" Foreground="#616469"
-                                 VerticalContentAlignment="Center" Background="Transparent"
-                                 Command="{Binding LineStyleCommand}"
-                                 CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}"
-                                 IsChecked="{Binding BasicVm.IsDashLine}"
-                                 Style="{DynamicResource GreyBgRadioBtnStyle}">
+                             Width="105" Height="32" Margin="0,0" Foreground="#616469"
+                             VerticalContentAlignment="Center" Background="Transparent"
+                             Command="{Binding LineStyleCommand}"
+                             CommandParameter="{Binding ElementName=BtnDashed, Path=Tag}"
+                             IsChecked="{Binding BasicVm.IsDashLine}"
+                             Style="{DynamicResource GreyBgRadioBtnStyle}">
                     <RadioButton.Content>
-                        <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2"/>
+                        <Line X1="10" Y1="5" X2="90" Y2="5" Stroke="Black" StrokeThickness="2" StrokeDashArray="2" />
                     </RadioButton.Content>
                 </RadioButton>
-
             </StackPanel>
-
         </StackPanel>
     </Grid>
-</UserControl>
+</UserControl>

+ 50 - 50
PDF Office/Views/PropertyPanel/AnnotPanel/SignatureAnnotProperty.xaml

@@ -1,125 +1,125 @@
 <UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.SignatureAnnotProperty"
              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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel" xmlns:customcontrol="clr-namespace:PDF_Office.CustomControl" xmlns:annotpanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel" xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert" d:DataContext="{d:DesignInstance Type=annotpanel:SignatureAnnotPropertyViewModel}"
              KeyDown="UserControl_KeyDown"
-             Loaded="UserControl_Loaded"
-             mc:Ignorable="d" >
+             Loaded="UserControl_Loaded" Background="{StaticResource color.sys.layout.mg}"
+             mc:Ignorable="d">
     <UserControl.Resources>
         <PathGeometry x:Key="Ic_AddButtonPath" Figures="M13.5 8C13.5 11.0376 11.0376 13.5 8 13.5C4.96243 13.5 2.5 11.0376 2.5 8C2.5 4.96243 4.96243 2.5 8 2.5C11.0376 2.5 13.5 4.96243 13.5 8ZM15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1C11.866 1 15 4.13401 15 8ZM7.25005 4.80003V7.25003H4.80005V8.75003H7.25005V11.2H8.75005V8.75003H11.2V7.25003H8.75005V4.80003H7.25005Z"  FillRule="EvenOdd" />
-        <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
-        <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert"/>
-        <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3DDADADA"/>
-        <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FFDADADA"/>
+        <dataconvert:ListCountToVisible x:Key="ListCountToVisible" />
+        <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert" />
+        <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3DDADADA" />
+        <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FFDADADA" />
     </UserControl.Resources>
-    <Grid  Background="Transparent">
+    <Grid  Background="{StaticResource color.sys.layout.mg}">
         <Grid.RowDefinitions>
-            <RowDefinition Height="50"/> 
-            <RowDefinition Height="*"/>
+            <RowDefinition Height="50" />
+            <RowDefinition Height="*" />
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="16"/>
-            <ColumnDefinition Width="*"/>
-            <ColumnDefinition Width="16"/>
+            <ColumnDefinition Width="16" />
+            <ColumnDefinition Width="*" />
+            <ColumnDefinition Width="16" />
         </Grid.ColumnDefinitions>
-        <Grid x:Name="Header" Grid.Column="1" >
+        <Grid x:Name="Header" Grid.Column="1">
             <Grid.ColumnDefinitions>
-                <ColumnDefinition Width="16"/>
-                <ColumnDefinition Width="*"/>
-                <ColumnDefinition Width="16"/>
+                <ColumnDefinition Width="16" />
+                <ColumnDefinition Width="*" />
+                <ColumnDefinition Width="16" />
             </Grid.ColumnDefinitions>
             <TextBlock Grid.Column="1" x:Name="TxtTitle" HorizontalAlignment="Left"
-                    VerticalAlignment="Center" FontSize="14" FontWeight="SemiBold"/>
+                    VerticalAlignment="Center" FontSize="14" FontWeight="SemiBold" />
             <customcontrol:PathButton Grid.Column="1"
             HorizontalAlignment="Right"
             HorizontalContentAlignment="Center"
             x:Name="BtnAdd"
             BorderThickness="1"
-            CornerRadius="4"                         
+            CornerRadius="4"
             Command="{Binding ShowDialogCommand}"
-            Height="32" Width="32"  IconHeight="16"  IconWidth="16" 
+            Height="32" Width="32"  IconHeight="16"  IconWidth="16"
             Icon="{StaticResource Ic_AddButtonPath}"  IconFill="#585A63"
             IconPress="{StaticResource Ic_AddButtonPath}" IconPressFill="#585A63"
             IconMouseOver="{StaticResource Ic_AddButtonPath}" IconMouseOverFill="#585A63"
             MouseOverBackground="{StaticResource color.item-state.hov.bg}"
-            MouseDownBackground="{StaticResource color.item-state.sel.bg.lv3}"                          
-            MouseDownBorderBrush="{StaticResource color.item-state.sel.border.lv3}"/>
+            MouseDownBackground="{StaticResource color.item-state.sel.bg.lv3}"
+            MouseDownBorderBrush="{StaticResource color.item-state.sel.border.lv3}" />
         </Grid>
         <Grid Grid.Row="1" Grid.Column="1">
             <StackPanel VerticalAlignment="Center" x:Name="NoSignatureStackPanel" Visibility="{Binding SignatureList.Count, Converter={StaticResource ListCountToVisible}}">
                 <Image Width="128" Height="128" Source="pack://application:,,,/PDF Office;component/Resources/PropertyPanel/nosign.png" />
-                <TextBlock Text="No signature created" FontSize="14" FontFamily="Segoe UI" Height="22" HorizontalAlignment="Center"/>
-                <TextBlock Width="168" Text="Click the Add button in the upper right corner to create a new signature." FontSize="12" FontFamily="Segoe UI" TextWrapping="Wrap" Foreground="#94989C" HorizontalAlignment="Center"/>
+                <TextBlock Text="No signature created" FontSize="14" FontFamily="Segoe UI" Height="22" HorizontalAlignment="Center" />
+                <TextBlock Width="168" Text="Click the Add button in the upper right corner to create a new signature." FontSize="12" FontFamily="Segoe UI" TextWrapping="Wrap" Foreground="#94989C" HorizontalAlignment="Center" />
             </StackPanel>
-            <ListBox ItemsSource="{Binding SignatureList}"  
+            <ListBox ItemsSource="{Binding SignatureList}"
                      SelectedIndex="{Binding CurrentListboxIndex,Mode=TwoWay}"
                      Visibility="{Binding ElementName=NoSignatureStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"
                      SelectionMode="Single" Height="auto" VerticalAlignment="Stretch"  BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                 <ListBox.ItemTemplate>
-                    <DataTemplate >
+                    <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 x:Name="SavePNG" Header="PNG" Tag="PNG" Click="Save_Click" />
+                                        <MenuItem x:Name="SavePDF" Header="PDF" Tag="PDF" Click="Save_Click" />
                                     </MenuItem>
-                                    <MenuItem x:Name="Delete" Header="删除签名" Click="Delete_Click"/>
-                                    <MenuItem x:Name="DeleteAll" Header="删除全部签名" Click="DeleteAll_Click"/>
+                                    <MenuItem x:Name="Delete" Header="删除签名" Click="Delete_Click" />
+                                    <MenuItem x:Name="DeleteAll" Header="删除全部签名" Click="DeleteAll_Click" />
                                 </ContextMenu>
                             </Grid.ContextMenu>
-                            <Image Source="{Binding SourcePath}" Stretch="Uniform" Height="48"/>
+                            <Image Source="{Binding SourcePath}" Stretch="Uniform" Height="48" />
                         </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="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}"/>
+                                        <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                                     </Border>
                                     <ControlTemplate.Triggers>
                                         <MultiTrigger>
                                             <MultiTrigger.Conditions>
-                                                <Condition Property="IsMouseOver" Value="True"/>
+                                                <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}"/>
+                                            <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"/>
+                                                <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}"/>
+                                            <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"/>
+                                                <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}"/>
+                                            <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}}"/>
+                                            <Setter Property="TextElement.Foreground" TargetName="Bd" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
                                         </Trigger>
                                     </ControlTemplate.Triggers>
                                 </ControlTemplate>
                             </Setter.Value>
                         </Setter>
-                        <EventSetter Event="PreviewMouseDown" Handler="ListBoxItem_PreviewMouseDown"/>
+                        <EventSetter Event="PreviewMouseDown" Handler="ListBoxItem_PreviewMouseDown" />
                     </Style>
                 </ListBox.ItemContainerStyle>
             </ListBox>
         </Grid>
     </Grid>
-</UserControl>
+</UserControl>

Những thai đổi đã bị hủy bỏ vì nó quá lớn
+ 55 - 58
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNoteProperty.xaml


+ 116 - 65
PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml

@@ -1,96 +1,147 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.TextAnnotProperty"
-             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.PropertyPanel.AnnotPanel"
-              xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
-             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
-             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
-             xmlns:prism="http://prismlibrary.com/"             
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             xmlns:AnnotPanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
-             d:DataContext="{d:DesignInstance Type=AnnotPanel:TextAnnotPropertyViewModel}"
-             xmlns:Convert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
-             xmlns:mainpage="clr-namespace:PDF_Office.Strings.MainPage"
-             xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.TextAnnotProperty"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:AnnotPanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
+    xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
+    xmlns:Convert="clr-namespace:PDF_Office.ViewModels.PropertyPanel.AnnotPanel"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:dataconvert="clr-namespace:PDF_Office.DataConvert"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+    xmlns:mainpage="clr-namespace:PDF_Office.Strings.MainPage"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    d:DataContext="{d:DesignInstance Type=AnnotPanel:TextAnnotPropertyViewModel}"
+    d:DesignHeight="450"
+    d:DesignWidth="260"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    Background="{StaticResource color.sys.layout.mg}"
+    mc:Ignorable="d">
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../../Styles/SliderStyle.xaml"></ResourceDictionary>
+                <ResourceDictionary Source="../../../Styles/SliderStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
-            <Convert:AnnotArgsTypeConverter x:Key="AnnotArgsTypeConverter"/>
-            <dataconvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
+            <Convert:AnnotArgsTypeConverter x:Key="AnnotArgsTypeConverter" />
+            <dataconvert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
         </ResourceDictionary>
-      
     </UserControl.Resources>
-    <Grid  VerticalAlignment="Stretch" Background="#F3F3F3">
-        <StackPanel Margin="16 0 16 0">
-            <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="0,16,0,8"
-                       Text="{Binding BasicVm.AnnotTypeTitle,Mode=OneWay}"
-                       ></TextBlock>
-            
-            <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0"
-                     Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
-                    >
+    <Grid VerticalAlignment="Stretch" Background="#F3F3F3">
+        <StackPanel Margin="16,0,16,0">
+            <TextBlock
+                Name="AnnotTypeTitle"
+                Margin="0,16,0,8"
+                HorizontalAlignment="Left"
+                FontFamily="Segoe UI"
+                FontSize="18"
+                FontWeight="Bold"
+                LineHeight="24"
+                Text="{Binding BasicVm.AnnotTypeTitle, Mode=OneWay}" />
+
+            <Border
+                Width="228"
+                Height="100"
+                Margin="0,8,0,0"
+                Background="White"
+                BorderBrush="#DDDDDD"
+                BorderThickness="1"
+                CornerRadius="2"
+                Visibility="{Binding BasicVm.IsMultiSelected, Converter={StaticResource InvertBoolToVisibleConvert}}">
                 <Grid>
                     <Grid.ColumnDefinitions>
-                        <ColumnDefinition Width="*"/>
-                        <ColumnDefinition Width="Auto"/>
-                        <ColumnDefinition Width="*"/>
+                        <ColumnDefinition Width="*" />
+                        <ColumnDefinition Width="Auto" />
+                        <ColumnDefinition Width="*" />
                     </Grid.ColumnDefinitions>
                     <Grid.RowDefinitions>
-                        <RowDefinition Height="*"/>
-                        <RowDefinition Height="Auto"/>
-                        <RowDefinition Height="*"/>
+                        <RowDefinition Height="*" />
+                        <RowDefinition Height="Auto" />
+                        <RowDefinition Height="*" />
                     </Grid.RowDefinitions>
-                    <Rectangle Grid.Row="1" Grid.Column="1"  VerticalAlignment="Stretch" HorizontalAlignment="Stretch" 
-                               Opacity="{Binding BasicVm.FillOpacity}"
-                               Fill="{Binding BasicVm.FontColor}" Visibility="{Binding BasicVm.AnnotType,Converter={StaticResource AnnotArgsTypeConverter},ConverterParameter=AnnotHighlight}" />
-                  
-                    <Rectangle Grid.Row="1" Grid.Column="1" Height="2" StrokeThickness="2" HorizontalAlignment="Stretch"
-                               Opacity="{Binding BasicVm.FillOpacity}"
-                               Stroke="{Binding BasicVm.FontColor}" Visibility="{Binding BasicVm.AnnotType,Converter={StaticResource AnnotArgsTypeConverter},ConverterParameter=AnnotStrikeout}"/>
-                    
-                    <Rectangle Grid.Row="1" Grid.Column="1" VerticalAlignment="Bottom"  Height="2" StrokeThickness="2" HorizontalAlignment="Stretch" 
-                               Opacity="{Binding BasicVm.FillOpacity}"
-                               Stroke="{Binding BasicVm.FontColor}" Visibility="{Binding BasicVm.AnnotType,Converter={StaticResource AnnotArgsTypeConverter},ConverterParameter=AnnotUnderline}" />
+                    <Rectangle
+                        Grid.Row="1"
+                        Grid.Column="1"
+                        HorizontalAlignment="Stretch"
+                        VerticalAlignment="Stretch"
+                        Fill="{Binding BasicVm.FontColor}"
+                        Opacity="{Binding BasicVm.FillOpacity}"
+                        Visibility="{Binding BasicVm.AnnotType, Converter={StaticResource AnnotArgsTypeConverter}, ConverterParameter=AnnotHighlight}" />
+
+                    <Rectangle
+                        Grid.Row="1"
+                        Grid.Column="1"
+                        Height="2"
+                        HorizontalAlignment="Stretch"
+                        Opacity="{Binding BasicVm.FillOpacity}"
+                        Stroke="{Binding BasicVm.FontColor}"
+                        StrokeThickness="2"
+                        Visibility="{Binding BasicVm.AnnotType, Converter={StaticResource AnnotArgsTypeConverter}, ConverterParameter=AnnotStrikeout}" />
 
-                    <TextBlock Name="SampleText" Padding="4,2,4,2" Grid.Row="1" Grid.Column="1" Text="{x:Static mainpage:MainPage.Sample}" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontFamily="Segoe UI" FontSize="18" >
-                    </TextBlock>
+                    <Rectangle
+                        Grid.Row="1"
+                        Grid.Column="1"
+                        Height="2"
+                        HorizontalAlignment="Stretch"
+                        VerticalAlignment="Bottom"
+                        Opacity="{Binding BasicVm.FillOpacity}"
+                        Stroke="{Binding BasicVm.FontColor}"
+                        StrokeThickness="2"
+                        Visibility="{Binding BasicVm.AnnotType, Converter={StaticResource AnnotArgsTypeConverter}, ConverterParameter=AnnotUnderline}" />
+
+                    <TextBlock
+                        Name="SampleText"
+                        Grid.Row="1"
+                        Grid.Column="1"
+                        Padding="4,2,4,2"
+                        HorizontalAlignment="Center"
+                        VerticalAlignment="Center"
+                        FontFamily="Segoe UI"
+                        FontSize="18"
+                        FontWeight="Bold"
+                        Text="{x:Static mainpage:MainPage.Sample}" />
                 </Grid>
             </Border>
 
             <Grid Margin="0,18,0,0">
                 <Grid.RowDefinitions>
-                    <RowDefinition Height="auto"/>
-                    <RowDefinition/>
+                    <RowDefinition Height="auto" />
+                    <RowDefinition />
                 </Grid.RowDefinitions>
-                <CompositeControl:SlidContent x:Name="SlidOpacity" Margin="0,0,5,0" HorizontalAlignment="Right" 
-                                              InitValue="{Binding BasicVm.FillOpacity,Mode=OneWay}"
-                                              Visibility="{Binding BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}">
+                <CompositeControl:SlidContent
+                    x:Name="SlidOpacity"
+                    Margin="0,0,5,0"
+                    HorizontalAlignment="Right"
+                    InitValue="{Binding BasicVm.FillOpacity, Mode=OneWay}"
+                    Visibility="{Binding BasicVm.IsMultiSelected, Converter={StaticResource InvertBoolToVisibleConvert}}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedValueChanged">
-                            <i:InvokeCommandAction Command="{Binding SelectedOpacityChangedCommand}" CommandParameter="{Binding ElementName=SlidOpacity,Path=Value}"/>
+                            <i:InvokeCommandAction Command="{Binding SelectedOpacityChangedCommand}" CommandParameter="{Binding ElementName=SlidOpacity, Path=Value}" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:SlidContent>
-                <TextBlock Text="Color"  Foreground="{StaticResource color.sys.text.neutral.lv2}" FontSize="12" FontFamily="Segoe UI" HorizontalAlignment="Left"/>
-               
-                <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor" Margin="0,8,0,0"
-                                               ItemSource="{Binding BasicVm.ColorItems}"
-                                               ColorType="{Binding ColorType}"
-                                               UIColor="{Binding BasicVm.CurrentFontColor,Mode=OneWay}" >
+                <TextBlock
+                    HorizontalAlignment="Left"
+                    FontFamily="Segoe UI"
+                    FontSize="12"
+                    Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                    Text="Color" />
+
+                <CompositeControl:ColorContent
+                    x:Name="cusColor"
+                    Grid.Row="1"
+                    Margin="0,8,0,0"
+                    ColorType="{Binding ColorType}"
+                    ItemSource="{Binding BasicVm.ColorItems}"
+                    UIColor="{Binding BasicVm.CurrentFontColor, Mode=OneWay}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">
-                            <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" CommandParameter="{Binding ElementName=cusColor,Path=SelectedColor}"/>
+                            <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" CommandParameter="{Binding ElementName=cusColor, Path=SelectedColor}" />
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:ColorContent>
             </Grid>
-            
         </StackPanel>
     </Grid>
-</UserControl>
+</UserControl>

+ 34 - 24
PDF Office/Views/PropertyPanel/PropertyPanelContent.xaml

@@ -1,31 +1,41 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.PropertyPanelContent"
-             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.PropertyPanel"
-             xmlns:AnnotPanel="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
-              xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
-             xmlns:prism="http://prismlibrary.com/"             
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             xmlns:PropertyPanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel"
-             d:DataContext="{d:DesignInstance Type=PropertyPanel:PropertyPanelContentViewModel}"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
+<UserControl
+    x:Class="PDF_Office.Views.PropertyPanel.PropertyPanelContent"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:AnnotPanel="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
+    xmlns:Convert="clr-namespace:PDF_Office.DataConvert"
+    xmlns:PropertyPanel="clr-namespace:PDF_Office.ViewModels.PropertyPanel"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    d:DataContext="{d:DesignInstance Type=PropertyPanel:PropertyPanelContentViewModel}"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    Background="{StaticResource color.sys.layout.mg}"
+    mc:Ignorable="d">
     <UserControl.Resources>
-        <Convert:PropertyPanelVisible x:Key="PropertyPanelVisible"/>
+        <Convert:PropertyPanelVisible x:Key="PropertyPanelVisible" />
     </UserControl.Resources>
-    <Grid  VerticalAlignment="Stretch">
+    <Grid VerticalAlignment="Stretch">
 
         <Grid>
-            <StackPanel VerticalAlignment="Center" x:Name="NoStampStackPanel">
-                <Image Width="128" Height="128" Source="pack://application:,,,/PDF Office;component/Resources/PropertyPanel/EmptyAnnot.png" />
-                <TextBlock  Width="128" FontSize="12" FontFamily="Segoe UI" TextWrapping="Wrap" Foreground="#94989C"
-                            Text="Show/Hide Annotation Properties Panel" TextAlignment="Center"
-                            HorizontalAlignment="Center"/>
-              
+            <StackPanel x:Name="NoStampStackPanel" VerticalAlignment="Center">
+                <Image
+                    Width="128"
+                    Height="128"
+                    Source="pack://application:,,,/PDF Office;component/Resources/PropertyPanel/EmptyAnnot.png" />
+                <TextBlock
+                    Width="128"
+                    HorizontalAlignment="Center"
+                    FontFamily="Segoe UI"
+                    FontSize="12"
+                    Foreground="#94989C"
+                    Text="Show/Hide Annotation Properties Panel"
+                    TextAlignment="Center"
+                    TextWrapping="Wrap" />
             </StackPanel>
         </Grid>
-     
     </Grid>
-</UserControl>
+</UserControl>

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

@@ -47,7 +47,7 @@ namespace PDF_Office.Views.PropertyPanel.ViewModular
                     {
                         //viewContent.RbtnReadMode(sender, e);
                         ViewContentViewModel model = viewContent.DataContext as ViewContentViewModel;
-                        model.RbtnReadMode();
+                        model.On_ReadMode();
                     }
                 }
             }
@@ -55,29 +55,30 @@ namespace PDF_Office.Views.PropertyPanel.ViewModular
 
         private void btnRotateRight_Click(object sender, RoutedEventArgs e)
         {
-            if (Window.GetWindow(this) is MainWindow window)
-            {
-                if (window.TabablzControl.SelectedItem is MainContent main)
-                {
-                    if (main.ContentMain.Content is ViewContent viewContent)
-                    {
-                        foreach (var item in viewContent.GridViewer.Children)
-                        {
-                            if (item is ContentControl control)
-                            {
-                                if (control.Content is SplitScreenContent splitScreenContent)
-                                {
-                                    if (splitScreenContent.PDFViewerContent.Content != null)
-                                    {
-                                        viewModel.SplitScreenPDFViewer = (ComPDFKitViewer.PdfViewer.CPDFViewer)splitScreenContent.PDFViewerContent.Content;
-                                        break;
-                                    }
-                                }
-                            }
-                        }
-                    }
-                }
-            }
+            //分屏视图,同步旋转
+            //if (Window.GetWindow(this) is MainWindow window)
+            //{
+            //    if (window.TabablzControl.SelectedItem is MainContent main)
+            //    {
+            //        if (main.ContentMain.Content is ViewContent viewContent)
+            //        {
+            //            foreach (var item in viewContent.GridViewer.Children)
+            //            {
+            //                if (item is ContentControl control)
+            //                {
+            //                    if (control.Content is SplitScreenContent splitScreenContent)
+            //                    {
+            //                        if (splitScreenContent.PDFViewerContent.Content != null)
+            //                        {
+            //                            viewModel.SplitScreenPDFViewer = (ComPDFKitViewer.PdfViewer.CPDFViewer)splitScreenContent.PDFViewerContent.Content;
+            //                            break;
+            //                        }
+            //                    }
+            //                }
+            //            }
+            //        }
+            //    }
+            //}
             viewModel.RotateCommand.Execute((sender as Button).Tag.ToString());
         }
     }

+ 31 - 0
PDF Office/Views/TipContent/EnterReadModeTip.xaml

@@ -0,0 +1,31 @@
+<UserControl
+    x:Class="PDF_Office.Views.TipContent.EnterReadModeTip"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.Views.TipContent"
+    xmlns:mainpage="clr-namespace:PDF_Office.Strings.MainPage"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:prism="http://prismlibrary.com/"
+    d:DesignHeight="450"
+    d:DesignWidth="800"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
+    <Grid>
+        <Border
+            Width="316"
+            Height="40"
+            VerticalAlignment="Top"
+            Background="{StaticResource color.sys.layout.dark.bg}"
+            CornerRadius="4">
+            <TextBlock
+                x:Name="ReadModelTip1"
+                Width="316"
+                Padding="11"
+                HorizontalAlignment="Left"
+                Foreground="#FFFFFFFF"
+                Text="{x:Static mainpage:MainPage.GlobalTip_ESCReadMode}"
+                TextAlignment="Center" />
+        </Border>
+    </Grid>
+</UserControl>

+ 28 - 0
PDF Office/Views/TipContent/EnterReadModeTip.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.TipContent
+{
+    /// <summary>
+    /// EnterReadModeTip.xaml 的交互逻辑
+    /// </summary>
+    public partial class EnterReadModeTip : UserControl
+    {
+        public EnterReadModeTip()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 0 - 1
PDF Office/Views/Tools/AnnotToolContent.xaml

@@ -41,7 +41,6 @@
                 <customControl:CustomIconToggleBtn
                     x:Name="BtnHand" Tag="Hand"
                     Command="{Binding HandCommand}"
-                    CommandParameter="{Binding ElementName=ToolPanel}"
                     Foreground="Black"
                     IsChecked="{Binding BtnHandIsChecked}"
                     Style="{StaticResource ToggleBtnViewModeStyle}">

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

@@ -31,7 +31,7 @@
             <prism:InvokeCommandAction Command="{Binding MouseDown}" />
         </i:EventTrigger>
     </i:Interaction.Triggers>
-    
+
     <UserControl.Resources>
         <ResourceDictionary>
             <ResourceDictionary.MergedDictionaries>
@@ -43,25 +43,49 @@
                 <Setter Property="Height" Value="20" />
             </Style>
             <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
-            <RoutedUICommand x:Key="CloseLeft" Text="CloseLeft"/>
-            <RoutedUICommand x:Key="CloseRight" Text="CloseRight"/>
+            <RoutedUICommand x:Key="CloseLeft" Text="CloseLeft" />
+            <RoutedUICommand x:Key="CloseRight" Text="CloseRight" />
         </ResourceDictionary>
     </UserControl.Resources>
     <UserControl.InputBindings>
-        <KeyBinding Command="{StaticResource CloseLeft}" Modifiers="Ctrl" Key="F4" />
-        <KeyBinding Command="{StaticResource CloseRight}" Modifiers="Ctrl+Shift" Key="F4" />
-        <KeyBinding Command="{Binding OpenFileCommand}" Gesture="Ctrl+O"></KeyBinding>
-        <KeyBinding Command="{Binding mainViewModel.mainWindowViewModel.AddTab}" Gesture="Ctrl+T"></KeyBinding>
-        <KeyBinding Command="{Binding SaveFile}" Gesture="Ctrl+S"></KeyBinding>
-        <KeyBinding Command="{Binding SaveAsFile}" Gesture="Ctrl+Shift+S"></KeyBinding>
-        <KeyBinding Command="{Binding CloseWindowCommand}" Gesture="Ctrl+Shift+W"></KeyBinding>
-        <KeyBinding Command="{Binding mainViewModel.CloseTab}" Gesture="Ctrl+W"></KeyBinding>
-        <KeyBinding Command="{Binding SettingsCommand}" Gesture="Ctrl+P"></KeyBinding>
+        <KeyBinding
+            Key="F4"
+            Command="{StaticResource CloseLeft}"
+            Modifiers="Ctrl" />
+        <KeyBinding
+            Key="F4"
+            Command="{StaticResource CloseRight}"
+            Modifiers="Ctrl+Shift" />
+        <KeyBinding Command="{Binding OpenFileCommand}" Gesture="Ctrl+O" />
+        <KeyBinding Command="{Binding mainViewModel.mainWindowViewModel.AddTab}" Gesture="Ctrl+T" />
+        <KeyBinding Command="{Binding SaveFile}" Gesture="Ctrl+S" />
+        <KeyBinding Command="{Binding SaveAsFile}" Gesture="Ctrl+Shift+S" />
+        <KeyBinding Command="{Binding CloseWindowCommand}" Gesture="Ctrl+Shift+W" />
+        <KeyBinding Command="{Binding mainViewModel.CloseTab}" Gesture="Ctrl+W" />
+        <KeyBinding
+            Key="P"
+            Command="{Binding PrintCommand}"
+            Modifiers="Ctrl" />
+        <KeyBinding
+            Key="S"
+            Command="{Binding SaveFile}"
+            Modifiers="Ctrl" />
+        <KeyBinding
+            Key="Z"
+            Command="{Binding UndoCommand}"
+            Modifiers="Ctrl" />
+        <KeyBinding Command="{Binding RedoCommand}" Gesture="Ctrl+Shift+Z" />
     </UserControl.InputBindings>
 
     <UserControl.CommandBindings>
-        <CommandBinding x:Name="CloseLeftCommand" Command="{StaticResource CloseLeft}" Executed="CloseLeftCommand_Executed"/>
-        <CommandBinding x:Name="CloseRightCommand" Command="{StaticResource CloseRight}" Executed="CloseRightCommand_Executed"/>
+        <CommandBinding
+            x:Name="CloseLeftCommand"
+            Command="{StaticResource CloseLeft}"
+            Executed="CloseLeftCommand_Executed" />
+        <CommandBinding
+            x:Name="CloseRightCommand"
+            Command="{StaticResource CloseRight}"
+            Executed="CloseRightCommand_Executed" />
     </UserControl.CommandBindings>
 
     <Grid Background="{StaticResource color.sys.layout.mg}">
@@ -177,12 +201,12 @@
                             <MenuItem Command="{Binding PropertyCommand}" Header="Properties" />
                             <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
                             <MenuItem Command="{Binding ShareCommand}" Header="Share" />
-                            <MenuItem Command="{Binding PrintCommand}" Header="Print" />
-                            <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
                             <MenuItem
-                                Command="{Binding SettingsCommand}"
-                                Header="Settings"
+                                Command="{Binding PrintCommand}"
+                                Header="Print"
                                 InputGestureText="Ctrl+P" />
+                            <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
+                            <MenuItem Command="{Binding SettingsCommand}" Header="Settings" />
                             <MenuItem Header="Help">
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
@@ -191,7 +215,8 @@
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
                                     CommandParameter="Online"
-                                    Header="在线帮助" />
+                                    Header="在线帮助"
+                                    Visibility="Collapsed" />
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
                                     CommandParameter="More"
@@ -203,7 +228,8 @@
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
                                     CommandParameter="Blog"
-                                    Header="订阅电子报" />
+                                    Header="订阅电子报"
+                                    Visibility="Collapsed" />
                                 <MenuItem
                                     Command="{Binding HelpCommand}"
                                     CommandParameter="ComPDF"
@@ -524,5 +550,32 @@
             <ContentControl Name="ContentTool" prism:RegionManager.RegionName="{Binding ToolContentRegionName}" />
         </Border>
         <cus:LoadingControl Grid.RowSpan="3" Visibility="{Binding IsLoading}" />
+
+        <!--  阅读模式下的页面控件  -->
+        <Border
+            x:Name="ReadModeContent"
+            Grid.RowSpan="4"
+            Height="44"
+            Margin="0,0,0,5"
+            HorizontalAlignment="Center"
+            VerticalAlignment="Bottom"
+            CornerRadius="4"
+            MouseEnter="RectangleReadMode_MouseEnter"
+            MouseLeave="ReadModeContent_MouseLeave"
+            Visibility="Collapsed">
+            <ContentControl prism:RegionManager.RegionName="{Binding ReadModeRegionName}" />
+        </Border>
+
+        <Rectangle
+            x:Name="RectangleReadMode"
+            Grid.RowSpan="4"
+            Width="{Binding ActualWidth, ElementName=ReadModeContent, Mode=OneWay}"
+            Height="44"
+            Margin="0,0,0,5"
+            HorizontalAlignment="Center"
+            VerticalAlignment="Bottom"
+            Fill="Transparent"
+            MouseEnter="RectangleReadMode_MouseEnter"
+            Visibility="Collapsed" />
     </Grid>
 </UserControl>

+ 69 - 3
PDF Office/Views/ViewContent.xaml.cs

@@ -4,6 +4,7 @@ using PDF_Office.EventAggregators;
 using PDF_Office.Helper;
 using PDF_Office.Model;
 using PDF_Office.ViewModels;
+using PDF_Office.ViewModels.PropertyPanel.ViewModular;
 using PDF_Office.ViewModels.Tools;
 using PDF_Office.Views.Dialog;
 using PDF_Office.Views.PropertyPanel.ViewModular;
@@ -62,6 +63,71 @@ namespace PDF_Office.Views
         public ViewContent(IEventAggregator eventAggregator) : this()
         {
             eventAggregator.GetEvent<SplitEvent>().Subscribe(ChangeSplitModeUI, e => e.Unicode == unicode);
+
+            eventAggregator.GetEvent<ReadModeEvent>().Subscribe(ChangeReadModeUI, e => e.Unicode == unicode);
+
+            eventAggregator.GetEvent<ReadModePropertyOpenEvent>().Subscribe(ChangeReadModePropertyOpenUI, e => e.Unicode == unicode);
+        }
+
+        private void ChangeReadModePropertyOpenUI(ReadModePropertyOpenArgs obj)
+        {
+            Grid.SetColumnSpan(GridViewer, 3);
+            Grid.SetColumn(GridViewer, 0);
+            Grid.SetColumn(Scroller, 4);
+        }
+
+        private void ChangeReadModeUI(ReadModeArgs obj)
+        {
+            if (obj.IsReadMode)
+            {
+                ReadModeContent.Visibility = Visibility.Visible;
+                RectangleReadMode.Visibility = Visibility.Collapsed;
+                this.TbtnProperty.IsChecked = false;
+                Grid.SetRowSpan(DocumentView, 4);
+                Grid.SetRow(DocumentView, 0);
+                Grid.SetColumnSpan(GridViewer, 4);
+                Grid.SetColumn(GridViewer, 0);
+            }
+            else
+            {
+                ReadModeContent.Visibility = Visibility.Collapsed;
+                RectangleReadMode.Visibility = Visibility.Collapsed;
+                //this.TbtnProperty.IsChecked=true;
+                Grid.SetRowSpan(DocumentView, 1);
+                Grid.SetRow(DocumentView, 2);
+                Grid.SetColumnSpan(GridViewer, 1);
+                Grid.SetColumn(GridViewer, 2);
+            }
+        }
+
+        /// <summary>
+        /// 鼠标移动到控件范围时显示控件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void RectangleReadMode_MouseEnter(object sender, MouseEventArgs e)
+        {
+            //Dispatcher.BeginInvoke(DispatcherPriority.Send, new Action(delegate
+            //{
+            if (viewModel.mainViewModel.IsBookMode)
+            {
+                this.ReadModeContent.Visibility = Visibility.Visible;
+                this.RectangleReadMode.Visibility = Visibility.Collapsed;
+            }
+            //}));
+        }
+
+        /// <summary>
+        /// 鼠标移开页面控件,三秒后隐藏该控件
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private async void ReadModeContent_MouseLeave(object sender, MouseEventArgs e)
+        {
+            await System.Threading.Tasks.Task.Delay(3000);
+            //Thread.Sleep(3000);
+            this.ReadModeContent.Visibility = Visibility.Collapsed;
+            this.RectangleReadMode.Visibility = Visibility.Visible;
         }
 
         /// <summary>
@@ -135,14 +201,14 @@ namespace PDF_Office.Views
                         }
                         if (viewModel.mainViewModel.IsBookMode == true)
                         {
-                            viewModel.UnReadModel();
+                            viewModel.Off_ReadModel();
                         }
                     }
                     else
                     {
                         if (viewModel.mainViewModel.IsBookMode == true)
                         {
-                            viewModel.UnReadModel();
+                            viewModel.Off_ReadModel();
                         }
                     }
                 }
@@ -243,7 +309,7 @@ namespace PDF_Office.Views
 
                 string[] file = (string[])e.Data.GetData(DataFormats.FileDrop);
                 //页面编辑模式下 不响应拖拽打开文件
-                if (file!=null  &&file.Length > 0&&!(this.DataContext as ViewContentViewModel).isInPageEdit)
+                if (file != null && file.Length > 0 && !(this.DataContext as ViewContentViewModel).isInPageEdit)
                 {
                     App.mainWindowViewModel.AddTab.Execute();
                     (App.mainWindowViewModel.SelectedItem.DataContext as MainContentViewModel).homeContentViewModel.AddFileFromDrag(file.ToList());