Parcourir la source

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

OYXH\oyxh il y a 2 ans
Parent
commit
32e73e0e4a
97 fichiers modifiés avec 2190 ajouts et 761 suppressions
  1. 6 2
      PDF Office/App.xaml
  2. 0 1
      PDF Office/App.xaml.cs
  3. 5 1
      PDF Office/CustomControl/AlertsMessage.xaml.cs
  4. 22 4
      PDF Office/CustomControl/CompositeControl/ColorContent.xaml
  5. 31 7
      PDF Office/CustomControl/CompositeControl/ColorContent.xaml.cs
  6. 34 1
      PDF Office/DataConvert/ListCountToVisible.cs.cs
  7. 43 0
      PDF Office/DataConvert/SignatureButtonConvert.cs
  8. 29 22
      PDF Office/Helper/ConverterHelper.cs
  9. 209 139
      PDF Office/Helper/ServiceHelper.cs
  10. 4 1
      PDF Office/Helper/ToolMethod.cs
  11. 92 6
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/AnnotBasePropertyVM.cs
  12. 12 15
      PDF Office/ViewModels/PropertyPanel/FontBoardVM.cs
  13. 1 1
      PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs
  14. 11 0
      PDF Office/Model/Dialog/ToolsDialogs/MergeObject.cs
  15. 3 10
      PDF Office/PDF Office.csproj
  16. 25 0
      PDF Office/Styles/ContextMenuStyle.xaml
  17. 4 0
      PDF Office/Styles/ExpanderStyle.xaml
  18. 7 0
      PDF Office/Styles/WindowsStyle.xaml
  19. 0 1
      PDF Office/ViewModels/BOTA/OutLineControlViewModel.cs
  20. 1 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  21. 1 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  22. 1 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs
  23. 1 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs
  24. 1 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs
  25. 1 1
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs
  26. 1 1
      PDF Office/ViewModels/Dialog/ServiceDialog/CodeRegionViewModel.cs
  27. 42 4
      PDF Office/ViewModels/Dialog/ServiceDialog/LoginPasswordRegionViewModel.cs
  28. 26 9
      PDF Office/ViewModels/Dialog/ServiceDialog/LoginRegionViewModel.cs
  29. 75 3
      PDF Office/ViewModels/Dialog/ServiceDialog/PasswordUpdataRegionVIewModel.cs
  30. 1 3
      PDF Office/ViewModels/Dialog/ServiceDialog/RegisterOKRegionViewModel.cs
  31. 102 9
      PDF Office/ViewModels/Dialog/ServiceDialog/RegisterRegionViewModel.cs
  32. 18 6
      PDF Office/ViewModels/Dialog/ToolsDialogs/CompressDialogs/CompressDialogViewModel.cs
  33. 40 19
      PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs
  34. 12 2
      PDF Office/ViewModels/MainContentViewModel.cs
  35. 10 4
      PDF Office/ViewModels/MainWindowViewModel.cs
  36. 15 5
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs
  37. 8 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs
  38. 0 41
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/MultiSelectAnnotPropertyViewModel.cs
  39. 16 2
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs
  40. 26 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SignatureAnnotPropertyViewModel.cs
  41. 40 1
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/SignatureCreateDialogViewModel.cs
  42. 16 0
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs
  43. 37 7
      PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs
  44. 1 0
      PDF Office/ViewModels/PropertyPanel/PDFEdit/PDFEditVM.cs
  45. 1 0
      PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs
  46. 144 109
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs
  47. 18 9
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs
  48. 3 0
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Properties.cs
  49. 23 1
      PDF Office/ViewModels/Tools/AnnotToolContentViewModel.cs
  50. 46 1
      PDF Office/ViewModels/ViewContentViewModel.cs
  51. 4 0
      PDF Office/Views/BOTA/SearchContent.xaml.cs
  52. 4 5
      PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml
  53. 2 2
      PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml
  54. 2 2
      PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml
  55. 1 1
      PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml
  56. 89 6
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml
  57. 8 2
      PDF Office/Views/Dialog/ServiceDialog/CodeRegion.xaml
  58. 117 40
      PDF Office/Views/Dialog/ServiceDialog/CodeRegion.xaml.cs
  59. 1 0
      PDF Office/Views/Dialog/ServiceDialog/LoginDialog.xaml
  60. 10 2
      PDF Office/Views/Dialog/ServiceDialog/LoginPasswordRegion.xaml
  61. 8 0
      PDF Office/Views/Dialog/ServiceDialog/LoginPasswordRegion.xaml.cs
  62. 2 1
      PDF Office/Views/Dialog/ServiceDialog/LoginRegion.xaml
  63. 9 0
      PDF Office/Views/Dialog/ServiceDialog/LoginRegion.xaml.cs
  64. 28 3
      PDF Office/Views/Dialog/ServiceDialog/PasswordUpdataRegion.xaml
  65. 9 0
      PDF Office/Views/Dialog/ServiceDialog/PasswordUpdataRegion.xaml.cs
  66. 1 0
      PDF Office/Views/Dialog/ServiceDialog/RegisterDialog.xaml
  67. 49 22
      PDF Office/Views/Dialog/ServiceDialog/RegisterRegion.xaml
  68. 10 0
      PDF Office/Views/Dialog/ServiceDialog/RegisterRegion.xaml.cs
  69. 1 0
      PDF Office/Views/Dialog/ServiceDialog/UserDialog.xaml
  70. 7 1
      PDF Office/Views/Dialog/ServiceDialog/UserOutCodeRegion.xaml
  71. 116 39
      PDF Office/Views/Dialog/ServiceDialog/UserOutCodeRegion.xaml.cs
  72. 4 4
      PDF Office/Views/Dialog/ToolsDialogs/MergeDialog.xaml
  73. 0 1
      PDF Office/Views/Dialog/ToolsDialogs/MergeDialog.xaml.cs
  74. 1 1
      PDF Office/Views/HomeContent.xaml
  75. 15 1
      PDF Office/Views/HomeContent.xaml.cs
  76. 64 54
      PDF Office/Views/HomePanel/PromotionContent.xaml
  77. 14 12
      PDF Office/Views/HomePanel/RecentFiles/DocItemControl.xaml
  78. 1 0
      PDF Office/Views/HomePanel/RecentFiles/DocItemControl.xaml.cs
  79. 10 5
      PDF Office/Views/HomePanel/RecentFiles/DocItemListViewControl.xaml
  80. 15 3
      PDF Office/Views/HomePanel/RecentFiles/RecentFilesContent.xaml
  81. 6 4
      PDF Office/Views/MainContent.xaml
  82. 1 0
      PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml
  83. 1 0
      PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml
  84. 0 15
      PDF Office/Views/PropertyPanel/AnnotPanel/MultiSelectAnnotProperty.xaml
  85. 0 28
      PDF Office/Views/PropertyPanel/AnnotPanel/MultiSelectAnnotProperty.xaml.cs
  86. 2 0
      PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml
  87. 5 6
      PDF Office/Views/PropertyPanel/AnnotPanel/SignatureAnnotProperty.xaml
  88. 10 1
      PDF Office/Views/PropertyPanel/AnnotPanel/SignatureAnnotProperty.xaml.cs
  89. 25 6
      PDF Office/Views/PropertyPanel/AnnotPanel/SignatureCreateDialog.xaml
  90. 27 1
      PDF Office/Views/PropertyPanel/AnnotPanel/SignatureCreateDialog.xaml.cs
  91. 1 1
      PDF Office/Views/PropertyPanel/AnnotPanel/StampAnnotProperty.xaml.cs
  92. 36 8
      PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml
  93. 78 9
      PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs
  94. 3 1
      PDF Office/Views/PropertyPanel/AnnotPanel/StickyNoteProperty.xaml
  95. 1 0
      PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml
  96. 108 13
      PDF Office/Views/Tools/AnnotToolContent.xaml
  97. 19 6
      PDF Office/Views/ViewContent.xaml

+ 6 - 2
PDF Office/App.xaml

@@ -521,6 +521,7 @@
                                     <Setter TargetName="arrow" Property="Fill" Value="{StaticResource color.icon.arrow.gray.dis}" />
                                     <Setter TargetName="templateRoot" Property="Background" Value="{StaticResource color.field.bg.dis}" />
                                     <Setter TargetName="templateRoot" Property="BorderBrush" Value="{StaticResource color.field.border.dis}" />
+                                    
                                 </Trigger>
                             </ControlTemplate.Triggers>
                         </ControlTemplate>
@@ -605,6 +606,9 @@
                     <Trigger Property="HasItems" Value="false">
                         <Setter TargetName="dropDownBorder" Property="Height" Value="95" />
                     </Trigger>
+                    <Trigger Property="IsEnabled" Value="false">
+                        <Setter  Property="Foreground" Value="{StaticResource color.field.text.dis}"/>
+                    </Trigger>
                     <MultiTrigger>
                         <MultiTrigger.Conditions>
                             <Condition Property="IsGrouping" Value="true" />
@@ -692,7 +696,8 @@
                         Style="{StaticResource ComboBoxToggleButton}" />
                     <Border
                         x:Name="border"
-                        Margin="{TemplateBinding BorderThickness}"
+                        Margin="4 1 8 1"
+                        HorizontalAlignment="Left"
                         Background="{StaticResource TextBox.Static.Background}">
                         <TextBox
                             x:Name="PART_EditableTextBox"
@@ -748,7 +753,6 @@
                 <Style.Triggers>
                     <Trigger Property="IsEditable" Value="true">
                         <Setter Property="IsTabStop" Value="false" />
-                        <Setter Property="Padding" Value="2" />
                         <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
                     </Trigger>
                 </Style.Triggers>

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

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

+ 5 - 1
PDF Office/CustomControl/AlertsMessage.xaml.cs

@@ -73,7 +73,11 @@ namespace PDF_Office.CustomControl
             BtnGrid.ColumnDefinitions.Add(column);
             BtnGrid.ColumnDefinitions.Add(column2);
 
-            ShowDialog();
+            if (ownerWindow != null)
+            {
+                this.Owner = ownerWindow;
+                ShowDialog();
+            }
         }
 
 

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

@@ -17,11 +17,27 @@
             </ResourceDictionary.MergedDictionaries>
 
             <convert:ColorBrushConvert x:Key="colorBrushConvert" />
+            <convert:BoolToVisible x:Key="BoolToVisible"/>
+            <convert:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
             <DataTemplate x:Key="listboxData">
-                <Ellipse
+                <Grid>
+                    <Ellipse
                     Width="20"
-                    Height="20"
-                    Fill="{Binding Color}" />
+                    Height="20" StrokeThickness="1"
+                    Stroke="{StaticResource color.sys.layout.divider}"
+                    Fill="{Binding Color}" 
+                    Visibility="{Binding IsTransparent,Converter={StaticResource InvertBoolToVisibleConvert}}"
+                     />
+                    <Grid Visibility="{Binding IsTransparent,Converter={StaticResource BoolToVisible}}">
+                        <Ellipse
+                    Width="20"
+                    Height="20" StrokeThickness="1" Stroke="{StaticResource color.sys.layout.divider}"
+                    Fill="White" />
+                        <Path Margin="0,0,2,2" VerticalAlignment="Center" HorizontalAlignment="Center" Data="M15 1L0.999618 14.9999" Stroke="{StaticResource color.icon.base.state.error}" StrokeThickness="1"/>
+                    </Grid>
+      
+                </Grid>
+               
             </DataTemplate>
 
             <ContextMenu x:Key="FlyoutMenu" FontSize="14">
@@ -43,6 +59,7 @@
                 <Setter Property="Height" Value="32"/>
                 <Setter Property="Width" Value="32"/>
                 <Setter Property="Margin" Value="0,0,8,0" />
+                <Setter Property="BorderThickness"  Value="0" />
                 <EventSetter Event="PreviewMouseLeftButtonUp" Handler="listboxItem_PreviewMouseLeftButtonUp"/>
                 <EventSetter Event="PreviewMouseRightButtonDown" Handler="listboxItem_PreviewMouseRightButtonDown" />
 
@@ -51,7 +68,7 @@
                         <ControlTemplate TargetType="{x:Type ContentControl}">
                             <Border CornerRadius="4"
                                 x:Name="border"
-                                Padding="0,0"
+                                Padding="0,0" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{StaticResource color.item-state.sel.border.lv3}"
                                 Background="{TemplateBinding Background}">
                                 <ContentPresenter />
                             </Border>
@@ -68,6 +85,7 @@
                     </Trigger>
                     <Trigger Property="IsSelected" Value="True">
                         <Setter Property="Background" Value="#e2e3e5" />
+                        <Setter Property="BorderThickness"  Value="1" />
                     </Trigger>
                 </Style.Triggers>
               

+ 31 - 7
PDF Office/CustomControl/CompositeControl/ColorContent.xaml.cs

@@ -27,9 +27,18 @@ namespace PDF_Office.CustomControl.CompositeControl
             set
             {
                 SetProperty(ref _color, value);
+                var solid = _color as SolidColorBrush;
+                if (solid != null)
+                {
+                    if (solid.Color == Colors.Transparent || solid.Color.A == 0x00)
+                        IsTransparent = true;
+                    else
+                        IsTransparent = false;
+                }
             }
         }
 
+        //颜色默认值,用于恢复最初始的颜色值
         public Brush defaultColor { get; private set; }
 
         private bool _isTransparent;
@@ -42,24 +51,19 @@ namespace PDF_Office.CustomControl.CompositeControl
             }
         }
 
-        public ColorItem(Color color, bool isTransparent = false)
+        public ColorItem(Color color)
         {
             var colorBrush = new SolidColorBrush(color);
             Color = colorBrush;
             defaultColor = colorBrush;
-            IsTransparent = isTransparent;
         }
 
+        //恢复颜色默认值
         public void RestoreColor()
         {
             Color = defaultColor;
         }
 
-
-
-
-
-
     }
 
     //类说明:
@@ -97,7 +101,27 @@ namespace PDF_Office.CustomControl.CompositeControl
         public static readonly DependencyProperty ceshiColorProperty =
             DependencyProperty.Register("UIColor", typeof(Brush), typeof(ColorContent), new PropertyMetadata(new SolidColorBrush(Color.FromArgb(0x6C,0x33,0xF8,0xCC)), SelectedColorPropertyChanged));
 
+        public List<ColorItem> ItemSource
+        {
+            get { return (List<ColorItem>)GetValue(ItemSourceProperty); }
+            set { SetValue(ItemSourceProperty, value); }
+        }
+
+        // Using a DependencyProperty as the backing store for ShowColorList.  This enables animation, styling, binding, etc...
+        public static readonly DependencyProperty ItemSourceProperty =
+            DependencyProperty.Register("ItemSource", typeof(List<ColorItem>), typeof(ColorContent), new PropertyMetadata(null, ItemSourcePropertyChanged));
 
+        private static void ItemSourcePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+        {
+            var control = d as ColorContent;
+            var co = (List<ColorItem>)e.NewValue;
+            if (control != null && co != null && control.colors != null)
+            {
+                control.colors.Clear();
+                foreach (var item in co)
+                    control.colors.Add(item);
+            }
+        }
         public Visibility ShowColorList
         {
             get { return (Visibility)GetValue(ShowColorListProperty); }

+ 34 - 1
PDF Office/DataConvert/ListCountToVisible.cs.cs

@@ -19,7 +19,7 @@ namespace PDF_Office.DataConvert
             }
             else
             {
-                if ((int)value==0)
+                if ((int)value == 0)
                 {
                     return Visibility.Visible;
                 }
@@ -35,4 +35,37 @@ namespace PDF_Office.DataConvert
             throw new NotImplementedException();
         }
     }
+
+
+    public class ListCountAndBoolToVisible : IMultiValueConverter
+    {
+        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (values[0] == null || values[1] == null)
+            {
+                return Visibility.Collapsed;
+            }
+            else
+            {
+                if ((int)values[0] == 0 && (bool)values[1])
+                {
+                    return Visibility.Collapsed;
+                }
+
+                if ((int)values[0] == 0)
+                {
+                    return Visibility.Visible;
+                }
+                else
+                {
+                    return Visibility.Collapsed;
+                }
+            }
+        }
+
+        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
 }

+ 43 - 0
PDF Office/DataConvert/SignatureButtonConvert.cs

@@ -0,0 +1,43 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace PDF_Office.DataConvert
+{
+    public class SignatureButtonConvert : IMultiValueConverter
+    {
+        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+        {
+            if (values[0] == null || values[1] == null || values[2] == null)
+            {
+                return false;
+            }
+            else
+            {
+                if ((int)values[0] == 0 && !string.IsNullOrEmpty((string)values[1]))
+                {
+                    return true;
+                }
+                if ((int)values[0] == 1 && (int)values[2]>0)
+                {
+                    return true;
+                }
+                if ((int)values[0] == 2 && values[3]!=null)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+
+        public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+        {
+            throw new NotImplementedException();
+        }
+    }
+}

+ 29 - 22
PDF Office/Helper/ConverterHelper.cs

@@ -183,9 +183,10 @@ namespace PDF_Office.Helper
             return result;
         }
 
-        public static void ImageMagickPDFToImage(string imageType,string filePath,string outputFolder,string outputFileName) {
-            ZipFile.ExtractToDirectory(filePath, outputFolder + "\\" + outputFileName);
-            var files = Directory.GetFiles(outputFolder + "\\" + outputFileName, "*.png");
+        public static void ImageMagickPDFToImage(string imageType,string filePath,string outputFolder,string outputFileName,ref string FileName) {
+            FileName = CommonHelper.CreateFolder(outputFolder +"\\"+ outputFileName);
+            ZipFile.ExtractToDirectory(filePath, FileName);
+            var files = Directory.GetFiles(FileName, "*.png");
             int i=0;
             var images = new MagickImageCollection();
             foreach (var file in files)
@@ -237,31 +238,32 @@ namespace PDF_Office.Helper
                 else { images.Write(outputFolder + "\\" + outputFileName + ".gif"); }
                
             }
-            else {
-                int fileIndex = 1;
+            //else {
+            //    int fileIndex = 1;
                 
-                if (File.Exists(outputFolder + "\\" + outputFileName + ".zip"))
-                {
-                    while (fileIndex>=1) {
-                        if (!File.Exists(outputFolder + "\\" + outputFileName + "_" + fileIndex + ".zip"))
-                        {
-                            ZipFile.CreateFromDirectory(outputFolder + "\\" + outputFileName, outputFolder + "\\" + outputFileName + "_" + fileIndex + ".zip");
-                            fileIndex=-1;
-                        }
-                        fileIndex++;
-                    }
-                }
-                else { ZipFile.CreateFromDirectory(outputFolder + "\\" + outputFileName, outputFolder + "\\" + outputFileName + ".zip"); }
+            //    if (File.Exists(outputFolder + "\\" + outputFileName + ".zip"))
+            //    {
+            //        while (fileIndex>=1) {
+            //            if (!File.Exists(outputFolder + "\\" + outputFileName + "_" + fileIndex + ".zip"))
+            //            {
+            //                ZipFile.CreateFromDirectory(outputFolder + "\\" + outputFileName, outputFolder + "\\" + outputFileName + "_" + fileIndex + ".zip");
+            //                fileIndex=-1;
+            //            }
+            //            fileIndex++;
+            //        }
+            //    }
+            //    else { ZipFile.CreateFromDirectory(outputFolder + "\\" + outputFileName, outputFolder + "\\" + outputFileName + ".zip"); }
                 
-            }
-            DirectoryInfo di = new DirectoryInfo(outputFolder + "\\" + outputFileName);
-            di.Delete(true);
+            //}
+            //DirectoryInfo di = new DirectoryInfo(outputFolder + "\\" + outputFileName);
+            //di.Delete(true);
 
 
         }       
 
         public static async Task<bool> ImgConvert(string inputpath, string outputpath, OnProgress getProgress, List<int> pageIndexLists,string pawssword,string imageType=".png", CPDFConvertImgOptions imgOptions = null)
         {
+            string FileName = "";
             bool result = false;
             try
             {
@@ -274,6 +276,10 @@ namespace PDF_Office.Helper
                 if (imageType == ".png" || imageType == ".jpg")
                 {
                     result = await Task.Run(() => imgConverter.Convert(outputFolder, ref outputFileName, imgOptions, pageArray, ref error, getProgress));
+                    FileName = CommonHelper.CreateFolder(outputFileName.Replace(".zip", ""));
+                    ZipFile.ExtractToDirectory(outputFileName, FileName);
+                    FileInfo file = new FileInfo(outputFileName);
+                    if (file.Exists) { file.Delete(); }
                 }
                 else
                 { //创建缓存文件夹
@@ -296,14 +302,15 @@ namespace PDF_Office.Helper
                     string saveName = Guid.NewGuid().ToString();
                     string savePath = Path.Combine(folderPath, saveName);
                      result = await Task.Run(() => imgConverter.Convert(folderPath, ref saveName, imgOptions, pageArray, ref error, getProgress));
-                    ImageMagickPDFToImage(imageType, saveName, outputFolder, outputFileName);
+                    ImageMagickPDFToImage(imageType, saveName, outputFolder, outputFileName,ref FileName);
                     DirectoryInfo di = new DirectoryInfo(folderPath);
                     di.Delete(true);
                 }
 
                 if (result)
                 {
-                    Process.Start(outputFolder.Replace("/", "\\"));
+                    //Process.Start(FileName.Replace("/", "\\"));
+                    CommonHelper.ShowFileBrowser(FileName);
                 }
             }
             catch (Exception ex)

+ 209 - 139
PDF Office/Helper/ServiceHelper.cs

@@ -73,7 +73,7 @@ namespace PDF_Office.Helper
             request.ContentType = "text/html;charset=UTF-8";
             //request.Accept = "application/vnd.api+json;version=1";
             request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
-            request.Timeout = 10000;
+            request.Timeout = 20000;
             request.ServicePoint.Expect100Continue = false;
             try
             {
@@ -97,7 +97,7 @@ namespace PDF_Office.Helper
         }
             catch
             {
-                return "";
+                return "网络不稳定请重试";
             }
            
                
@@ -116,7 +116,7 @@ namespace PDF_Office.Helper
             request.ContentType = "application/json";
             //request.Accept = "application/vnd.api+json;version=1";
             request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
-            request.Timeout = 10000;
+            request.Timeout = 20000;
             request.ServicePoint.Expect100Continue = false;
             StringWriter sw = new StringWriter();
             using (JsonWriter writer = new JsonTextWriter(sw))
@@ -138,29 +138,37 @@ namespace PDF_Office.Helper
                 writer.Write(postBody);
                 writer.Close();
             }
-
-            response = (HttpWebResponse)request.GetResponse();
-            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+            try
             {
-                string responseData = reader.ReadToEnd();
-                Console.WriteLine(responseData);
-                reader.Close();
-                JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
-                //outemail = jobject["msg"].ToObject<string>().ToLower();
-                if (response != null)
-                {
-                    response.Close();
-                }
-                if (request != null)
+                response = (HttpWebResponse)request.GetResponse();
+                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
-                    request.Abort();
+                    string responseData = reader.ReadToEnd();
+                    Console.WriteLine(responseData);
+                    reader.Close();
+                    JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
+                    //outemail = jobject["msg"].ToObject<string>().ToLower();
+                    if (response != null)
+                    {
+                        response.Close();
+                    }
+                    if (request != null)
+                    {
+                        request.Abort();
+                    }
+                    return jobject["msg"].ToObject<string>().ToLower();
+
+
                 }
-                return jobject["msg"].ToObject<string>().ToLower();
-               
-                
             }
+            catch
+            {
+                return "网络不稳定请重试";
+            }
+           
         }
 
+        //⑤报错
         public static void Get_code(string action, string email)
         {
             string post = $"?action={action}&appId=16&receiver={email}&type=0";
@@ -172,26 +180,36 @@ namespace PDF_Office.Helper
             request.ContentType = "text/html;charset=UTF-8";
             //request.Accept = "application/vnd.api+json;version=1";
             request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
-            request.Timeout = 10000;
+            request.Timeout = 20000;
             request.ServicePoint.Expect100Continue = false;
-            response = (HttpWebResponse)request.GetResponse();
-            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+            try
             {
-                string responseData = reader.ReadToEnd();
-                Console.WriteLine(responseData);
-                reader.Close();
-                JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
-                if (response != null)
-                {
-                    response.Close();
-                }
-                if (request != null)
+                response = (HttpWebResponse)request.GetResponse();
+                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
-                    request.Abort();
+                    string responseData = reader.ReadToEnd();
+                    Console.WriteLine(responseData);
+                    reader.Close();
+                    JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
+                    if (response != null)
+                    {
+                        response.Close();
+                    }
+                    if (request != null)
+                    {
+                        request.Abort();
+                    }
+
+
                 }
-               
+            }
+            catch
+            {
                 
             }
+
+
+            
         }
         public static String Ok_code(string email, string code, string type)
         {
@@ -205,26 +223,34 @@ namespace PDF_Office.Helper
             request.ContentType = "text/html;charset=UTF-8";
             //request.Accept = "application/vnd.api+json;version=1";
             request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
-            request.Timeout = 10000;
+            request.Timeout = 20000;
             request.ServicePoint.Expect100Continue = false;
-            response = (HttpWebResponse)request.GetResponse();
-            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+            try
             {
-                string responseData = reader.ReadToEnd();
-                Console.WriteLine(responseData);
-                reader.Close();
-                JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
-                if (response != null)
-                {
-                    response.Close();
-                }
-                if (request != null)
+                response = (HttpWebResponse)request.GetResponse();
+                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
-                    request.Abort();
+                    string responseData = reader.ReadToEnd();
+                    Console.WriteLine(responseData);
+                    reader.Close();
+                    JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
+                    if (response != null)
+                    {
+                        response.Close();
+                    }
+                    if (request != null)
+                    {
+                        request.Abort();
+                    }
+                    return jobject["msg"].ToObject<string>().ToLower();
+
                 }
-               return jobject["msg"].ToObject<string>().ToLower();
-                
             }
+            catch
+            {
+                return "网络不稳定请重试";
+            }
+           
         }
         public static String Register_email(string intemail, string intpassword, string intcode, string uuid)
         {
@@ -236,7 +262,7 @@ namespace PDF_Office.Helper
             request.ContentType = "application/json";
             //request.Accept = "application/vnd.api+json;version=1";
             request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
-            request.Timeout = 10000;
+            request.Timeout = 20000;
             request.ServicePoint.Expect100Continue = false;
             StringWriter sw = new StringWriter();
             using (JsonWriter writer = new JsonTextWriter(sw))
@@ -263,26 +289,39 @@ namespace PDF_Office.Helper
                 writer.Write(postBody);
                 writer.Close();
             }
-
-            response = (HttpWebResponse)request.GetResponse();
-            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+            try
             {
-                string responseData = reader.ReadToEnd();
-                Console.WriteLine(responseData);
-                reader.Close();
-                JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
-                if (response != null)
-                {
-                    response.Close();
-                }
-                if (request != null)
+                response = (HttpWebResponse)request.GetResponse();
+                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
-                    request.Abort();
-                }
-               
-                return jobject["msg"].ToObject<string>().ToLower();
+                    string responseData = reader.ReadToEnd();
+                    Console.WriteLine(responseData);
+                    reader.Close();
+                    JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
+                    if (response != null)
+                    {
+                        response.Close();
+                    }
+                    if (request != null)
+                    {
+                        request.Abort();
+                    }
 
+                    if (jobject["msg"].ToObject<string>().ToLower() == "success")
+                    {
+                        access_token = jobject["result"]["access_token"].ToObject<string>().ToLower();
+                        Settings.Default.AppProperties.LoginToken = jobject["result"]["access_token"].ToObject<string>().ToLower();
+                        Settings.Default.Save();
+                    }
+                    return jobject["msg"].ToObject<string>().ToLower();
+
+                }
             }
+            catch
+            {
+                return "网络不稳定请重试";
+            }
+          
         }
         public static String Login(string intemail, string intpassword, string uuid)
         {
@@ -295,37 +334,45 @@ namespace PDF_Office.Helper
             request.ContentType = "application/x-www-form-urlencoded";
             //request.Accept = "application/vnd.api+json;version=1";
             request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
-            request.Timeout = 10000;
+            request.Timeout = 20000;
             request.ServicePoint.Expect100Continue = false;
-
-            response = (HttpWebResponse)request.GetResponse();
-            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+            try
             {
-                string responseData = reader.ReadToEnd();
-                Console.WriteLine(responseData);
-                reader.Close();
-                JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
-                outlogin = jobject["msg"].ToObject<string>().ToLower();
-
-                if (response != null)
-                {
-                    response.Close();
-                }
-                if (request != null)
-                {
-                    request.Abort();
-                }
-                if (jobject["msg"].ToObject<string>().ToLower() == "success")
+                response = (HttpWebResponse)request.GetResponse();
+                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
-                    access_token = jobject["result"]["access_token"].ToObject<string>().ToLower();
-                    Settings.Default.AppProperties.LoginToken= jobject["result"]["access_token"].ToObject<string>().ToLower();
-                    Settings.Default.Save();
-                }
-                return jobject["msg"].ToObject<string>().ToLower();
+                    string responseData = reader.ReadToEnd();
+                    Console.WriteLine(responseData);
+                    reader.Close();
+                    JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
+                    outlogin = jobject["msg"].ToObject<string>().ToLower();
+
+                    if (response != null)
+                    {
+                        response.Close();
+                    }
+                    if (request != null)
+                    {
+                        request.Abort();
+                    }
+                    if (jobject["msg"].ToObject<string>().ToLower() == "success")
+                    {
+                        access_token = jobject["result"]["access_token"].ToObject<string>().ToLower();
+                        Settings.Default.AppProperties.LoginToken = jobject["result"]["access_token"].ToObject<string>().ToLower();
+                        Settings.Default.Save();
+                    }
+                    return jobject["msg"].ToObject<string>().ToLower();
 
+                }
+            }
+            catch
+            {
+                return "网络不稳定请重试";
             }
+           
         }
 
+        //⑤报错
         public static void Logout(string uuid)
         {
             
@@ -338,26 +385,33 @@ namespace PDF_Office.Helper
             request.ContentType = "application/x-www-form-urlencoded";
             //request.Accept = "application/vnd.api+json;version=1";
             request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
-            request.Timeout = 10000;
+            request.Timeout = 20000;
             request.ServicePoint.Expect100Continue = false;
-
-            response = (HttpWebResponse)request.GetResponse();
-            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+            try
             {
-                string responseData = reader.ReadToEnd();
-                Console.WriteLine(responseData);
-                reader.Close();
-                JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
-                if (response != null)
-                {
-                    response.Close();
-                }
-                if (request != null)
+                response = (HttpWebResponse)request.GetResponse();
+                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
-                    request.Abort();
+                    string responseData = reader.ReadToEnd();
+                    Console.WriteLine(responseData);
+                    reader.Close();
+                    JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
+                    if (response != null)
+                    {
+                        response.Close();
+                    }
+                    if (request != null)
+                    {
+                        request.Abort();
+                    }
+
                 }
-              
             }
+            catch
+            {
+               
+            }
+           
         }
         public static String Usergout(string code)
         {
@@ -371,30 +425,37 @@ namespace PDF_Office.Helper
             request.ContentType = "application/x-www-form-urlencoded";
             //request.Accept = "application/vnd.api+json;version=1";
             request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
-            request.Timeout = 10000;
+            request.Timeout = 20000;
             request.ServicePoint.Expect100Continue = false;
-
-            response = (HttpWebResponse)request.GetResponse();
-            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+            try
             {
-                string responseData = reader.ReadToEnd();
-                Console.WriteLine(responseData);
-                reader.Close();
-                JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
-                if (response != null)
-                {
-                    response.Close();
-                }
-                if (request != null)
+                response = (HttpWebResponse)request.GetResponse();
+                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
-                    request.Abort();
-                }
-      
-                return jobject["msg"].ToObject<string>().ToLower();
+                    string responseData = reader.ReadToEnd();
+                    Console.WriteLine(responseData);
+                    reader.Close();
+                    JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
+                    if (response != null)
+                    {
+                        response.Close();
+                    }
+                    if (request != null)
+                    {
+                        request.Abort();
+                    }
 
+                    return jobject["msg"].ToObject<string>().ToLower();
 
-               
+
+
+                }
+            }
+            catch
+            {
+                return "网络不稳定请重试";
             }
+           
         }
 
         public static String Rebirth(string intemail, string firstpassword, string secondPassword, string intcode)
@@ -408,7 +469,7 @@ namespace PDF_Office.Helper
             request.ContentType = "application/json";
             //request.Accept = "application/vnd.api+json;version=1";
             request.UserAgent = "Apifox/1.0.0 (https://www.apifox.cn)";
-            request.Timeout = 10000;
+            request.Timeout = 20000;
             request.ServicePoint.Expect100Continue = false;
             StringWriter sw = new StringWriter();
             using (JsonWriter writer = new JsonTextWriter(sw))
@@ -435,27 +496,36 @@ namespace PDF_Office.Helper
                 writer.Write(postBody);
                 writer.Close();
             }
-
-            response = (HttpWebResponse)request.GetResponse();
-            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
+            try
             {
-                string responseData = reader.ReadToEnd();
-                Console.WriteLine(responseData);
-                reader.Close();
-                JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
-                if (response != null)
-                {
-                    response.Close();
-                }
-                if (request != null)
+                response = (HttpWebResponse)request.GetResponse();
+                using (StreamReader reader = new StreamReader(response.GetResponseStream()))
                 {
-                    request.Abort();
+                    string responseData = reader.ReadToEnd();
+                    Console.WriteLine(responseData);
+                    reader.Close();
+                    JObject jobject = (JObject)JsonConvert.DeserializeObject(responseData);
+                    if (response != null)
+                    {
+                        response.Close();
+                    }
+                    if (request != null)
+                    {
+                        request.Abort();
+                    }
+                    return jobject["msg"].ToObject<string>().ToLower();
+
+
                 }
-               return jobject["msg"].ToObject<string>().ToLower();
 
-               
             }
+            catch
+            {
+                return "网络不稳定请重试";
+            }
+           
         }
+         
     }
 }
 

+ 4 - 1
PDF Office/Helper/ToolMethod.cs

@@ -161,7 +161,10 @@ namespace PDF_Office.Helper
                     MessageBoxEx.Show("LoadFile_GetThumbnailFailedWarning");
                 }
             }
-
+            if(tempdoc!=null)
+            {
+                tempdoc.Release();
+            }
         }
 
 

+ 92 - 6
PDF Office/ViewModels/PropertyPanel/AnnotPanel/AnnotBasePropertyVM.cs

@@ -1,4 +1,5 @@
 using ComPDFKitViewer.AnnotEvent;
+using PDF_Office.CustomControl.CompositeControl;
 using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
@@ -7,10 +8,10 @@ using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Media;
 
-namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
+namespace PDF_Office.Model.AnnotPanel
 {
-
-    public class AnnotBasePropertyVM : BindableBase
+    //注释的通用属性
+    public class AnnotCommon : BindableBase
     {
         //注释类型
         private AnnotArgsType _annotType;
@@ -72,6 +73,22 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             get { return fillColor; }
             set { SetProperty(ref fillColor, value); CurrentFillColor = fillColor; }
         }
+
+        //边框颜色集合
+        private List<ColorItem> _colorItems = new List<ColorItem>();
+        public List<ColorItem> ColorItems
+        {
+            get { return _colorItems; }
+            set => SetProperty(ref _colorItems, value);
+        }
+
+        //填充颜色集合
+        private List<ColorItem> _fillColorItems = new List<ColorItem>();
+        public List<ColorItem> FillColorItems
+        {
+            get { return _fillColorItems; }
+            set => SetProperty(ref _fillColorItems, value);
+        }
         #endregion 填充
 
         #region 边框
@@ -103,7 +120,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         {
             get { return _fontColor; }
             set { SetProperty(ref _fontColor, value); CurrentFontColor = _fontColor; }
-            
+
         }
 
         //当前边框颜色
@@ -135,7 +152,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         //多选注释:用处 - 多选注释使得下拉框为空内容,刷新最新的UI布局
         private bool _isMultiSelected = false;
-        public bool IsMultiSelected{
+        public bool IsMultiSelected
+        {
             get { return _isMultiSelected; }
             set => SetProperty(ref _isMultiSelected, value);
         }
@@ -149,11 +167,79 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         //Todo:由于考虑到有些UI在VM不太方便处理,因此需要触发该函数到外部xaml.cs里更改UI属性。
         //更改多个属性:value可为键值对集合
         //适应范围:若VM在Loaded进行绑定,需要UI初始化之后,才能起到作用
-        public void InvokeToUI(object sender,object value)
+        public void InvokeToUI(object sender, object value)
         {
             SelectedAnnotInvokeToUI?.Invoke(sender, value);
         }
 
     }
 
+    //注释的通用颜色集合
+    public class AnnotColorList
+    {
+        //用于高亮注释颜色
+        public static List<ColorItem> GetHighlightColorList()
+        {
+            List<ColorItem> HighlightItems = new List<ColorItem>();
+            HighlightItems = new List<ColorItem>();
+            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xff, 0xC7, 0x00));
+            HighlightItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xFC, 0x1F, 0x1F));
+            HighlightItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x3E, 0xED, 0x92));
+            HighlightItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x47, 0xC8, 0xFF));
+            HighlightItems.Add(colorItem);
+            return HighlightItems;
+        }
+
+        //用于边框颜色
+        public static List<ColorItem> GetBorderColorList()
+        {
+            List<ColorItem> BorderItems = new List<ColorItem>();
+            BorderItems = new List<ColorItem>();
+            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xFC, 0x1F, 0x1F));
+            BorderItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x29, 0x53, 0x93));
+            BorderItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x1E, 0x89, 0x56));
+            BorderItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xB8, 0x08, 0xD4));
+            BorderItems.Add(colorItem);
+            return BorderItems;
+        }
+
+        //用于填充颜色
+        public static List<ColorItem> GetFillColorList()
+        {
+            List<ColorItem> FillItems = new List<ColorItem>();
+            FillItems = new List<ColorItem>();
+            ColorItem colorItem = new ColorItem(Colors.Transparent);
+            FillItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xff, 0xff, 0xff));
+            FillItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xDF, 0xE1, 0xE4));
+            FillItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xFF, 0xF1, 0xC1));
+            FillItems.Add(colorItem);
+            return FillItems;
+        }
+
+        //用于注释样式颜色:如便签样式颜色
+        public static List<ColorItem> GetStyleColorList()
+        {
+            List<ColorItem> StyleItems = new List<ColorItem>();
+            StyleItems = new List<ColorItem>();
+            ColorItem colorItem = new ColorItem(Color.FromArgb(0xff, 0xff, 0xD5, 0x73));
+            StyleItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0xF8, 0x59, 0xC8));
+            StyleItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x1A, 0xD5, 0x98));
+            StyleItems.Add(colorItem);
+            colorItem = new ColorItem(Color.FromArgb(0xff, 0x68, 0xAC, 0xF8));
+            StyleItems.Add(colorItem);
+            return StyleItems;
+        }
+
+    }
 }

+ 12 - 15
PDF Office/ViewModels/PropertyPanel/FontBoardVM.cs

@@ -11,7 +11,7 @@ using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Media;
 
-namespace PDF_Office.ViewModels.PropertyPanel
+namespace PDF_Office.Model.AnnotPanel
 {
     //属性触发事件的标识
     public enum FontSetModeType
@@ -120,8 +120,8 @@ namespace PDF_Office.ViewModels.PropertyPanel
             {
                 bool isChange = IsEqualComboData(_currentFontSize, value);
 
-                if(isChange && value.Value > 0)
-                SetProperty(ref _currentFontSize, value);
+                if (isChange && value.Value > 0)
+                    SetProperty(ref _currentFontSize, value);
 
                 if (isChange && value.Value > 0)
                 {
@@ -196,7 +196,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
             get { return _textAlignment; }
             set { SetProperty(ref _textAlignment, value); }
         }
- 
+
         //颜色
         private Brush selectColor = new SolidColorBrush(Colors.Black);
         public Brush SelectColor
@@ -213,11 +213,11 @@ namespace PDF_Office.ViewModels.PropertyPanel
                 {
                     CurrentFontColor = selectColor;
                 }
-                    
+
             }
         }
 
-        private Brush _currentFontColor =new SolidColorBrush(Colors.Transparent);
+        private Brush _currentFontColor = new SolidColorBrush(Colors.Transparent);
         public Brush CurrentFontColor
         {
             get { return _currentFontColor; }
@@ -229,7 +229,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
         private bool IsEqualComboData(ComboDataItem oldValue, ComboDataItem newValue)
         {
-            if (newValue == null  || IsCanSave == false)
+            if (newValue == null || IsCanSave == false)
                 return false;
 
             if (oldValue != null && newValue != null)
@@ -267,13 +267,13 @@ namespace PDF_Office.ViewModels.PropertyPanel
                     strValue = "Regular";
                     strContent = "常规";
                 }
-                    
+
                 else
                 {
                     strValue = "Bold";
                     strContent = "粗体";
                 }
-                  
+
             }
             else
             {
@@ -287,7 +287,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
                     strValue = "Bold Italic";
                     strContent = "粗斜体";
                 }
-                    
+
             }
 
             CurrrentFontWeightStyle = new ComboDataItem(strValue, strContent);
@@ -299,7 +299,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
             CurrentFontSize = new ComboDataItem(size);
         }
 
-        protected void GetCurrentFontFamily(string fontFamily,string uiStr)
+        protected void GetCurrentFontFamily(string fontFamily, string uiStr)
         {
             CurrentFontFamily = new ComboDataItem(fontFamily, uiStr);
         }
@@ -309,9 +309,6 @@ namespace PDF_Office.ViewModels.PropertyPanel
 
 
 
-
-
-
     //设置字体大小、字体内容排版、字体颜色、字体样式、字重
     public class FontBoardVm : BindableBase
     {
@@ -467,7 +464,7 @@ namespace PDF_Office.ViewModels.PropertyPanel
         }
 
         //外部UI引用,判断是否选中左对齐、居中对齐、右对齐,或都不选中
-        public string strAglinState{ get; private set; }
+        public string strAglinState { get; private set; }
         //VM赋值
         public void SetStrAglinState(string str)
         {

+ 1 - 1
PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs

@@ -14,7 +14,7 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
     public class ConvertOptions
     {
         public COCRLanguage OCRLanguage = COCRLanguage.English;
-        public bool IsAllowOCR = false;
+        public bool IsAllowOCR = true;
         public bool IsContainOCRBgImage =false;
         public bool IsContainAnnotations = true;
         public bool IsContainImages = true;

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

@@ -150,5 +150,16 @@ namespace PDF_Office.Model.Dialog.ToolsDialogs
             }
         }
 
+        private int itemIndex;
+
+        public int ItemIndex
+        {
+            get { return itemIndex; }
+            set
+            {
+                SetProperty(ref itemIndex, value);
+            }
+        }
+
     }
 }

+ 3 - 10
PDF Office/PDF Office.csproj

@@ -303,6 +303,7 @@
     <Compile Include="DataConvert\ListCountToVisible.cs.cs" />
     <Compile Include="DataConvert\ObjectConvert.cs" />
     <Compile Include="DataConvert\PropertyPanelVisible.cs" />
+    <Compile Include="DataConvert\SignatureButtonConvert.cs" />
     <Compile Include="DataConvert\StringToDateConvert.cs" />
     <Compile Include="DataConvert\StringToVisibleConvert.cs" />
     <Compile Include="DataConvert\UnVisivleConvert.cs" />
@@ -336,6 +337,8 @@
     <Compile Include="Helper\SettingHelper.cs" />
     <Compile Include="Helper\ToolMethod.cs" />
     <Compile Include="Helper\UpdateAttributeHelper.cs" />
+    <Compile Include="Model\AnnotPanel\AnnotCommon.cs" />
+    <Compile Include="Model\AnnotPanel\FontBoard.cs" />
     <Compile Include="Model\AnnotPanel\Signature.cs" />
     <Compile Include="Model\BOTA\AnnotationHandlerEventArgs.cs" />
     <Compile Include="Model\AnnotPanel\Stamp.cs" />
@@ -508,13 +511,10 @@
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkTemplateListTextContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\PDFToolsContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\QuickToolsContentViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\AnnotBasePropertyVM.cs" />
-    <Compile Include="ViewModels\PropertyPanel\AnnotPanel\MultiSelectAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureAnnotPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureCreateDialogViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SnapshotEditMenuViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\StickyNotePropertyViewModel.cs" />
-    <Compile Include="ViewModels\PropertyPanel\FontBoardVM.cs" />
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\ImageEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\ImageTextEditPropertyViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\PDFEdit\PDFEditVM.cs" />
@@ -1050,9 +1050,6 @@
     <Compile Include="Views\PropertyPanel\AnnotPanel\LinkAnnotProperty.xaml.cs">
       <DependentUpon>LinkAnnotProperty.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\PropertyPanel\AnnotPanel\MultiSelectAnnotProperty.xaml.cs">
-      <DependentUpon>MultiSelectAnnotProperty.xaml</DependentUpon>
-    </Compile>
     <Compile Include="Views\PropertyPanel\AnnotPanel\SharpsAnnotProperty.xaml.cs">
       <DependentUpon>SharpsAnnotProperty.xaml</DependentUpon>
     </Compile>
@@ -1828,10 +1825,6 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\PropertyPanel\AnnotPanel\MultiSelectAnnotProperty.xaml">
-      <SubType>Designer</SubType>
-      <Generator>MSBuild:Compile</Generator>
-    </Page>
     <Page Include="Views\PropertyPanel\AnnotPanel\SharpsAnnotProperty.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 25 - 0
PDF Office/Styles/ContextMenuStyle.xaml

@@ -19,6 +19,31 @@
             IsEnabled="True" />
     </ContextMenu>
 
+    <!--便签ToolTip-->
+    <Style x:Key="FlowToolTip" TargetType="ToolTip">
+        <Setter Property="HorizontalAlignment" Value="Left"/>
+        <Setter Property="VerticalAlignment" Value="Top"/>
+        <Setter Property="Template">
+            <Setter.Value>
+                <ControlTemplate>
+                    <Grid>
+                        <Border Background="{StaticResource color.sys.layout.dark.bg}" CornerRadius="4" BorderBrush="{StaticResource color.sys.layout.dark.bg}" BorderThickness="4">
+                            <Border.Effect>
+                                <DropShadowEffect Direction="0" BlurRadius="7" ShadowDepth="0" Color="Black" Opacity="0.09" />
+                            </Border.Effect>
+                        </Border>
+                        <TextBlock  
+                            Margin="16,8,16,8"
+                            FontSize="13"
+                            TextWrapping="Wrap"
+                            Foreground="{StaticResource color.sys.text.anti.norm}"
+                            Text="{TemplateBinding ContentControl.Content}"/>
+                    </Grid>
+                </ControlTemplate>
+            </Setter.Value>
+        </Setter>
+    </Style>
+
     <!--  注释 - 高亮、下划线、删除线 -右键菜单  -->
     <Style x:Key="UIElementMenuItem" TargetType="MenuItem">
         <Setter Property="Template">

+ 4 - 0
PDF Office/Styles/ExpanderStyle.xaml

@@ -52,8 +52,12 @@
 
     <Style x:Key="PromotionExpanderStyle" TargetType="{x:Type Expander}">
         <Setter Property="Background" Value="Transparent" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
         <Setter Property="HorizontalContentAlignment" Value="Stretch" />
         <Setter Property="VerticalContentAlignment" Value="Stretch" />
+        <Setter Property="FontSize" Value="12" />
+        <Setter Property="FontWeight" Value="SemiBold" />
+        <Setter Property="FontFamily" Value="Segoe UI" />
         <Setter Property="BorderBrush" Value="Transparent" />
         <Setter Property="BorderThickness" Value="1" />
         <Setter Property="Template">

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

@@ -134,4 +134,11 @@
         </Setter>
         <Setter Property="Background" Value="Transparent" />
     </Style>
+
+
+    <Style x:Key="stlWindowEx" TargetType="{x:Type Window}">
+        <Setter Property="Height" Value="554"/>
+        <Setter Property="Width" Value="892"/>
+    </Style>
+
 </ResourceDictionary>

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

@@ -641,7 +641,6 @@ namespace PDF_Office.ViewModels.BOTA
                 {
                     node.CanDown = false;
                 }
-
             }
             return node;
         }

+ 1 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs

@@ -74,7 +74,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private bool oCRCheckBoxIsCheckBox = false;
+        private bool oCRCheckBoxIsCheckBox = true;
         public bool OCRCheckBoxIsCheckBox
         {
             get { return oCRCheckBoxIsCheckBox; }

+ 1 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs

@@ -48,7 +48,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private bool oCRCheckBoxIsCheckBox = false;
+        private bool oCRCheckBoxIsCheckBox = true;
         public bool OCRCheckBoxIsCheckBox
         {
             get { return oCRCheckBoxIsCheckBox; }

+ 1 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs

@@ -48,7 +48,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private bool oCRCheckBoxIsCheckBox = false;
+        private bool oCRCheckBoxIsCheckBox = true;
         public bool OCRCheckBoxIsCheckBox
         {
             get { return oCRCheckBoxIsCheckBox; }

+ 1 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs

@@ -48,7 +48,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private bool oCRCheckBoxIsCheckBox = false;
+        private bool oCRCheckBoxIsCheckBox = true;
         public bool OCRCheckBoxIsCheckBox
         {
             get { return oCRCheckBoxIsCheckBox; }

+ 1 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs

@@ -49,7 +49,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private bool oCRCheckBoxIsCheckBox = false;
+        private bool oCRCheckBoxIsCheckBox = true;
         public bool OCRCheckBoxIsCheckBox
         {
             get { return oCRCheckBoxIsCheckBox; }

+ 1 - 1
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs

@@ -48,7 +48,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         }
 
-        private bool oCRCheckBoxIsCheckBox = false;
+        private bool oCRCheckBoxIsCheckBox = true;
         public bool OCRCheckBoxIsCheckBox
         {
             get { return oCRCheckBoxIsCheckBox; }

+ 1 - 1
PDF Office/ViewModels/Dialog/ServiceDialog/CodeRegionViewModel.cs

@@ -267,7 +267,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 
         private void Code6Changed()
         {
-            if(Code6.Length==1)
+           if(Code6.Length==1)
             {
                 Codesum = Code1 + Code2 + Code3 + Code4 + Code5 + Code6;
                 if (Codesum.Length == 6)

+ 42 - 4
PDF Office/ViewModels/Dialog/ServiceDialog/LoginPasswordRegionViewModel.cs

@@ -79,6 +79,15 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             set
             {
                 SetProperty(ref _LoginPassword, value);
+                LoginPasswordlookVis = Visibility.Collapsed;
+                if (string.IsNullOrEmpty(LoginPassword))
+                {
+                    ChkVis = Visibility.Collapsed;
+                }
+                else
+                {
+                    ChkVis = Visibility.Visible;
+                }
                 CheckEnableNextStepEncrypt();
             }
 
@@ -123,6 +132,13 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
                 SetProperty(ref _LoginPasswordVisibility, value);
             }
         }
+        private Visibility _ChkVis = Visibility.Collapsed;
+        public Visibility ChkVis
+        {
+            get { return _ChkVis; }
+            set { SetProperty(ref _ChkVis, value); }
+        }
+
 
         private Visibility _LoginTextVisibility = Visibility.Collapsed;
         public Visibility LoginTextVisibility
@@ -144,6 +160,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         public DelegateCommand GoCodeUpdataCommand { get; set; }
         public DelegateCommand LoginCommand { get; set; }
         public DelegateCommand LinkLicenseCommand { get; set; }
+        public DelegateCommand LoginPasswordChangedCommand { get; set; }
         LoginPasswordRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
             dialogs = dialogService;
@@ -152,8 +169,28 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             LoginCommand = new DelegateCommand(Login);
             ChangeEmailCommand = new DelegateCommand(ChangeEmail);
             GoCodeUpdataCommand = new DelegateCommand(GoCodeUpdata);
+            LoginPasswordChangedCommand = new DelegateCommand(LoginPasswordChanged);
+        }
+        private void LoginPasswordChanged()
+        {
+
+            if (LoginPassword.Length < 6)
+            {
+                LoginPasswordlook = "At least 6 characters";
+            }
+            else if (LoginPassword.Length > 24)
+            {
+                LoginPasswordlook = "Up to 24 characters";
+            }
+            else
+            {
+                LoginPasswordlook = "";
+            }
+
         }
 
+
+
         private void GoCodeUpdata()
         {
             ServiceHelper.Get_code("user_reset_password", LoginEmail);
@@ -203,10 +240,11 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             EnableNextStep = true;
 
-            if (string.IsNullOrEmpty(LoginPassword))
-            {
-                EnableNextStep = false;
-            }
+            if (LoginPassword.Length < 6 || LoginPassword.Length > 24 )
+                {
+                    EnableNextStep = false;
+                }
+
         }
 
         public void DisplayPassword(object e)

+ 26 - 9
PDF Office/ViewModels/Dialog/ServiceDialog/LoginRegionViewModel.cs

@@ -9,6 +9,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -52,7 +53,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         public string LoginEmaillook
         {
             get { return _LoginEmaillook; }
-            set { SetProperty(ref _LoginEmaillook, value); }
+            set { SetProperty(ref _LoginEmaillook, value);}
         }
 
 
@@ -75,6 +76,15 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             set
             {
                 SetProperty(ref _LoginEmail, value);
+
+                if (LoginEmail == "")
+                {
+                    LoginEmaillook = "";
+                }
+                else
+                {
+                    CheckMail(LoginEmail);
+                }
                 CheckEnableNextStepEncrypt();
             }
         }
@@ -123,19 +133,26 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         }
 
 
+        private void CheckMail(string mail)
+        {
+            string str = "^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$";
+            Regex mReg = new Regex(str);
 
+            if (mReg.IsMatch(mail))
+            {
+                LoginEmaillook = "";
+            }
+            else
+            {
+                LoginEmaillook = "请输入正确的邮箱格式";
+            }
+        }
         private void GoLogin()
         {
 
 
             LoginDialogViewModel.Close();
-
-            dialogs.ShowDialog(DialogNames.RegisterDialog, new DialogParameters(""), r =>
-            {
-
-
-            });
-
+            App.mainWindowViewModel.OpenRegister();
 
         }
 
@@ -143,7 +160,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             EnableNextStep = true;
 
-            if (string.IsNullOrEmpty(LoginEmail))
+            if (string.IsNullOrEmpty(LoginEmail)||LoginEmaillook!="")
             {
                 EnableNextStep = false;
             }

+ 75 - 3
PDF Office/ViewModels/Dialog/ServiceDialog/PasswordUpdataRegionVIewModel.cs

@@ -70,7 +70,12 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             set { SetProperty(ref _LoginPasswordlook, value); }
         }
 
-
+        private string _LoginPasswordlook2;
+        public string LoginPasswordlook2
+        {
+            get { return _LoginPasswordlook2; }
+            set { SetProperty(ref _LoginPasswordlook2, value); }
+        }
 
 
         private string _LoginPassword = "";
@@ -80,6 +85,14 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             set
             {
                 SetProperty(ref _LoginPassword, value);
+                if (string.IsNullOrEmpty(LoginPassword))
+                {
+                    ChkVis = Visibility.Collapsed;
+                }
+                else
+                {
+                    ChkVis = Visibility.Visible;
+                }
                 CheckEnableNextStepEncrypt();
             }
 
@@ -95,7 +108,19 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             }
         }
 
+        private Visibility _ChkVis = Visibility.Collapsed;
+        public Visibility ChkVis
+        {
+            get { return _ChkVis; }
+            set { SetProperty(ref _ChkVis, value); }
+        }
 
+        private Visibility _ChkVis2 = Visibility.Collapsed;
+        public Visibility ChkVis2
+        {
+            get { return _ChkVis2; }
+            set { SetProperty(ref _ChkVis2, value); }
+        }
         private Visibility _LoginPasswordVisibility = Visibility.Visible;
         public Visibility LoginPasswordVisibility
         {
@@ -131,6 +156,14 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             set
             {
                 SetProperty(ref _LoginPassword2, value);
+                if (string.IsNullOrEmpty(LoginPassword2))
+                {
+                    ChkVis2 = Visibility.Collapsed;
+                }
+                else
+                {
+                    ChkVis2 = Visibility.Visible;
+                }
                 CheckEnableNextStepEncrypt();
             }
 
@@ -197,21 +230,60 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 
 
         public DelegateCommand<object> DisplayPasswordCommand { get; set; }
+        public DelegateCommand<object> DisplayPasswordCommand2 { get; set; }
 
         public DelegateCommand ChangeEmailCommand { get; set; }
         public DelegateCommand GoCodeUpdataCommand { get; set; }
         public DelegateCommand PasswordUpdataCommand { get; set; }
         public DelegateCommand LinkLicenseCommand { get; set; }
+
+        public DelegateCommand LoginPasswordChangedCommand { get; set; }
+        public DelegateCommand LoginPasswordChanged2Command { get; set; }
         PasswordUpdataRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
             dialogs = dialogService;
 
             DisplayPasswordCommand = new DelegateCommand<object>(DisplayPassword);
-            DisplayPasswordCommand = new DelegateCommand<object>(DisplayPassword2);
+            DisplayPasswordCommand2 = new DelegateCommand<object>(DisplayPassword2);
             PasswordUpdataCommand = new DelegateCommand(PasswordUpdata);
+            LoginPasswordChangedCommand = new DelegateCommand(LoginPasswordChanged);
+            LoginPasswordChanged2Command = new DelegateCommand(LoginPasswordChanged2);
         }
 
+        private void LoginPasswordChanged()
+        {
 
+            if (LoginPassword.Length < 6)
+            {
+                LoginPasswordlook = "At least 6 characters";
+            }
+            else if (LoginPassword.Length > 24)
+            {
+                LoginPasswordlook = "Up to 24 characters";
+            }
+            else
+            {
+                LoginPasswordlook = "";
+            }
+
+        }
+        private void LoginPasswordChanged2()
+        {
+
+            if (LoginPassword2.Length < 6)
+            {
+                LoginPasswordlook2 = "At least 6 characters";
+            }
+            else if (LoginPassword2.Length > 24)
+            {
+                LoginPasswordlook2 = "Up to 24 characters";
+            }
+            else
+            {
+                LoginPasswordlook2 = "";
+            }
+
+        }
 
         private void PasswordUpdata()
         {
@@ -233,7 +305,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             EnableNextStep = true;
 
-            if (string.IsNullOrEmpty(LoginPassword)|| string.IsNullOrEmpty(LoginPassword2))
+            if (LoginPassword.Length < 6 || LoginPassword.Length > 24 || LoginPassword2.Length < 6 || LoginPassword2.Length > 24)
             {
                 EnableNextStep = false;
             }

+ 1 - 3
PDF Office/ViewModels/Dialog/ServiceDialog/RegisterOKRegionViewModel.cs

@@ -58,9 +58,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
 
             RegisterDialogViewModel.Close();
-            App.mainWindowViewModel.UserVis = Visibility.Collapsed;
-            App.mainWindowViewModel.RegisterVis = Visibility.Collapsed;
-            App.mainWindowViewModel.LoginVis = Visibility.Visible;
+            
 
         }
     }

+ 102 - 9
PDF Office/ViewModels/Dialog/ServiceDialog/RegisterRegionViewModel.cs

@@ -9,6 +9,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.Linq;
 using System.Text;
+using System.Text.RegularExpressions;
 using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Controls;
@@ -86,6 +87,14 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             }
         }
 
+        private bool _isRegisterPasswordDisplayed = false;
+        public bool IsRegisterPasswordDisplayed
+        {
+            get { return _isRegisterPasswordDisplayed; }
+            set { SetProperty(ref _isRegisterPasswordDisplayed, value); }
+        }
+
+
         private string _registerText1 = "Already have an account?";
         public string Registertext1
         {
@@ -116,7 +125,16 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             get { return _registerPassword; }
             set
             {
+                
                 SetProperty(ref _registerPassword, value);
+                if (string.IsNullOrEmpty(RegisterPassword))
+                {
+                    ChkVis = Visibility.Collapsed;
+                }
+                else
+                {
+                    ChkVis = Visibility.Visible;
+                }
                 CheckEnableNextStepEncrypt();
             }
 
@@ -129,6 +147,16 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             set
             {
                 SetProperty(ref _registerEmail, value);
+
+                if(RegisterEmail=="")
+                {
+                    RegisterEmaillook = "";
+                }
+                else
+                {
+                    CheckMail(RegisterEmail);
+                }
+               
                 CheckEnableNextStepEncrypt();
             }
         }
@@ -152,7 +180,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
                 SetProperty(ref _registerPasswordMsg, value);
             }
         }
-
+        
         private Visibility _registerPasswordVisibility = Visibility.Visible;
         public Visibility RegisterPasswordVisibility
         {
@@ -170,6 +198,13 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
                 SetProperty(ref _registerPasswordVisibility, value);
             }
         }
+        private Visibility _ChkVis = Visibility.Collapsed;
+        public Visibility ChkVis
+        {
+            get { return _ChkVis; }
+            set { SetProperty(ref _ChkVis, value); }
+        }
+        
         private Visibility _registerTextVisibility = Visibility.Collapsed;
         public Visibility RegisterTextVisibility
         {
@@ -183,11 +218,14 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             get { return _isPermissionsPasswordDisplayed; }
             set { SetProperty(ref _isPermissionsPasswordDisplayed, value); }
         }
-
+        
         public DelegateCommand<object> DisplayPasswordCommand { get; set; }
         public DelegateCommand LinkPolicyCommand { get; set; }
+        public DelegateCommand CloseDialogCommand { get; set; }
         public DelegateCommand RegisterNextCommand { get; set; }
         public DelegateCommand GoLoginCommand { get; set; }
+        public DelegateCommand RegisterPasswordChangedCommand { get; set; }
+        
         public DelegateCommand LinkLicenseCommand { get; set; }
         RegisterRegionViewModel(IRegionManager regionManager, IDialogService dialogService)
         {
@@ -197,6 +235,52 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             LinkLicenseCommand = new DelegateCommand(LinkLicense);
             GoLoginCommand = new DelegateCommand(GoLogin);
             RegisterNextCommand = new DelegateCommand(RegisterNext);
+            CloseDialogCommand = new DelegateCommand(CloseDialog);
+            RegisterPasswordChangedCommand = new DelegateCommand(RegisterPasswordChanged);
+            
+        }
+
+
+        private void RegisterPasswordChanged()
+        {
+
+           if(RegisterPassword.Length<6)
+            {
+                RegisterePasswordlook = "At least 6 characters";
+            }
+           else if(RegisterPassword.Length>24)
+            {
+                RegisterePasswordlook = "Up to 24 characters";
+            }
+           else
+            {
+                RegisterePasswordlook = "";
+            }
+
+        }
+
+
+
+        private void CheckMail(string mail)
+        {
+            string str = "^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$";
+            Regex mReg = new Regex(str);
+
+            if (mReg.IsMatch(mail))
+            {
+                RegisterEmaillook = "";
+            }
+            else
+            {
+                RegisterEmaillook = "请输入正确的邮箱格式";
+            }
+        }
+
+        private void CloseDialog()
+        {
+
+            RegisterDialogViewModel.Close();
+         
         }
 
 
@@ -210,6 +294,9 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
                 RegisterDialogViewModel.RegisterPassword = RegisterPassword;
                 ServiceHelper.Get_code("user_register", RegisterEmail);
                 RegisterDialogViewModel.RegionMan( "CodeRegion");
+                App.mainWindowViewModel.UserVis = Visibility.Visible;
+                App.mainWindowViewModel.RegisterVis = Visibility.Collapsed;
+                App.mainWindowViewModel.LoginVis = Visibility.Collapsed;
             }
             else 
             {
@@ -217,7 +304,16 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
             }
         }
 
-
+        public void SetOpenPassword(object e)
+        {
+            var chk = e as CheckBox;
+            if (chk != null)
+            {
+                IsRegisterPasswordDisplayed = false;
+                RegisterPasswordVisibility = Visibility.Visible;
+            }
+            CheckEnableNextStepEncrypt();
+        }
 
         private void GoLogin()
         {
@@ -225,11 +321,8 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
 
             RegisterDialogViewModel.Close();
 
-            dialogs.ShowDialog(DialogNames.LoginDialog, new DialogParameters(""), r =>
-            {
-               
-
-            });
+            App.mainWindowViewModel.OpenLogin();
+    
 
 
         }
@@ -255,7 +348,7 @@ namespace PDF_Office.ViewModels.Dialog.ServiceDialog
         {
             EnableNextStep = true;
            
-            if (string.IsNullOrEmpty(RegisterPassword) || string.IsNullOrEmpty(RegisterEmail))
+            if (RegisterPassword.Length<6|| RegisterPassword.Length >24 || string.IsNullOrEmpty(RegisterEmail)|| RegisterEmaillook!="")
             {
                 EnableNextStep = false;
             }

+ 18 - 6
PDF Office/ViewModels/Dialog/ToolsDialogs/CompressDialogs/CompressDialogViewModel.cs

@@ -104,13 +104,25 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs
         private void Compress()
         {
 
-            FolderBrowserDialog dlg = new FolderBrowserDialog();
-            string saveSelectedPath = "";
-            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
+            /*
+             *设置这个对话框的起始保存路径
+             */
+            sfd.InitialDirectory = pdfviewer.Document.FilePath;
+            /*
+             *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
+             */
+            sfd.Filter = "PDF|*.pdf;";
+            /*
+             *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
+             */
+            sfd.FileName = pdfviewer.Document.FileName + "_Compress.pdf";
+            /*
+             * 做一些工作
+             */
+            if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
             {
-                saveSelectedPath = dlg.SelectedPath.Trim();
-                saveSelectedPath = saveSelectedPath + "\\"+document.FileName+"_Compress.pdf";
-                saveSelectedPath = CommonHelper.CreateFilePath(saveSelectedPath);
+               string saveSelectedPath = sfd.FileName;
             /*
              * 做一些工作
              */

+ 40 - 19
PDF Office/ViewModels/Dialog/ToolsDialogs/MergeDialogViewModel.cs

@@ -20,6 +20,7 @@ using System.Windows;
 using System.Windows.Controls;
 using System.Windows.Media;
 using System.Windows.Media.Imaging;
+using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 
 namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
 {
@@ -114,6 +115,15 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
         #endregion
 
         #region 私有方法
+
+        private void UpDataMergeObjectIndex()
+        {
+            for (int i = 0; i < MergeObjectlist.Count; i++)
+            {
+                MergeObjectlist[i].ItemIndex = i + 1;
+            }
+        }
+
         private void Cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
@@ -317,6 +327,9 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
             MergeObjectlist.Remove(merge);
         }
 
+        /// <summary>
+        /// 拖拽插入
+        /// </summary>
         public void MoveMerge(MergeObject targetNode, MergeObject soureNode)
         {
             int targetindex = MergeObjectlist.IndexOf(targetNode);
@@ -336,6 +349,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
             {
                 MergeObjectlist.Insert(targetindex, soureNode);
             }
+            UpDataMergeObjectIndex();
         }
 
         public void AddFiles(string[] FilePath)
@@ -364,9 +378,18 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                     continue;
                 }
                 string FileType = Path.GetExtension(mergeObject.FilePath).Trim().ToLower();
+                if (string.IsNullOrEmpty(FileType))
+                {
+                    //获取不到文件类型
+                    continue;
+                }
                 if (FileType != ".pdf")
                 {
-                    if (!Properties.Resources.imageex.Contains(FileType))
+                    string imagetype = "*" + FileType;
+                    string[] x = Properties.Resources.imageex.ToLower().Split(';');
+                    List<string> list = x.ToList();
+                    int imageindex = list.IndexOf(imagetype);
+                    if (imageindex < 0)
                     {
                         //图片格式不支持
                         continue;
@@ -381,28 +404,25 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                 else
                 {
                     CPDFDocument doc = CPDFDocument.InitWithFilePath(mergeObject.FilePath);
-                    if (doc.IsLocked)
+                    if (doc == null)
                     {
-                        DialogParameters value = new DialogParameters();
-                        value.Add(ParameterNames.PDFDocument, doc);
-                        dialogs.ShowDialog(DialogNames.VerifyPassWordDialog, value, e =>
-                        {
-                            if (e.Result != ButtonResult.OK)
-                            {
-                                result = false;
-                            }
-                            else
-                            {
-                                mergeObject.Password = e.Parameters.GetValue<string>(ParameterNames.PassWord);
-                            }
-
-                        });
-                        if (!result)
+                        //图片格式不支持
+                        continue;
+                    }
+                    VerifyPasswordResult condition = SecurityHelper.VerifyPasswordByPasswordKind(doc, EnumPasswordKind.StatusPermissionsPassword, dialogs);
+                    if (condition.IsDiscryptied)
+                    {
+                        if (condition.Password != null)
                         {
-                            doc.Release();
-                            continue;
+                            mergeObject.Password = condition.Password;
+                            doc.UnlockWithPassword(condition.Password);
                         }
                     }
+                    else
+                    {
+                        doc.Release();
+                        continue;
+                    }
                     mergeObject.DocName = doc.FileName;
                     mergeObject.DocPageCount = doc.PageCount.ToString() + "页";
                     mergeObject.SDKPageCount = doc.PageCount;
@@ -423,6 +443,7 @@ namespace PDF_Office.ViewModels.Dialog.ToolsDialogs
                 }
                 MergeObjectlist.Add(mergeObject);
             }
+            UpDataMergeObjectIndex();
         }
         #endregion
     }

+ 12 - 2
PDF Office/ViewModels/MainContentViewModel.cs

@@ -79,7 +79,7 @@ namespace PDF_Office.ViewModels
 
         public DelegateCommand<object> CloseTab { get; set; }
 
-        public DelegateCommand<object> Loaded { get; set; }
+        public DelegateCommand UnLoaded { get; set; }
 
         public DelegateCommand ShowInFolderCommand { get; set; }
 
@@ -156,17 +156,27 @@ namespace PDF_Office.ViewModels
             CloseTab = new DelegateCommand<object>(CloseTabItem);
             ShowInFolderCommand = new DelegateCommand(showInFolder);
             RenameCommand = new DelegateCommand(rename);
+            UnLoaded = new DelegateCommand(unload);
 
             MainContentRegionName = Guid.NewGuid().ToString();
         }
 
+        //关闭页签
+        private void unload()
+        {
+            if(PDFViewer!=null)
+            {
+                PDFViewer.CloseDocument();
+            }
+        }
+
         /// <summary>
         /// 执行重命名操作
         /// </summary>
         private void dorenameFile()
         {
             var folder = PDFViewer.Document.FilePath.Substring(0, PDFViewer.Document.FilePath.LastIndexOf("\\"));
-            ////File.Move(PDFViewer.Document.FilePath,Path.Combine(folder,FileName));
+            ////File.Replace(PDFViewer.Document.FilePath,Path.Combine(folder,FileName),Path.Combine(folder,"back.bak"),true);
             ///TODO:会被占用 无法操作
             IsReNameTextShow = Visibility.Collapsed;
         }

+ 10 - 4
PDF Office/ViewModels/MainWindowViewModel.cs

@@ -221,10 +221,14 @@ namespace PDF_Office.ViewModels
                 System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
                 {
                     region.RequestNavigate(RegionNames.MainRegion, "MainContent");
+                    if (App.IsShowRegist)
+                    {
+                        OpenRegister();
+                    }
+
                 }
                 ));
                 App.IsFirstOpen = false;
-
                 if (Settings.Default.AppProperties.LoginToken != "")
                 {
                     UserVis = Visibility.Visible;
@@ -233,11 +237,13 @@ namespace PDF_Office.ViewModels
                 {
                     RegisterVis = Visibility.Visible;
                 }
+               
             }
+            
         }
 
         //打开注册弹窗
-        private void OpenRegister()
+        public void OpenRegister()
         {
             dialogs.ShowDialog(DialogNames.RegisterDialog, new DialogParameters(), r =>
             {
@@ -245,7 +251,7 @@ namespace PDF_Office.ViewModels
         }
 
         //打开登录弹窗
-        private void OpenLogin()
+        public void OpenLogin()
         {
             dialogs.ShowDialog(DialogNames.LoginDialog, new DialogParameters(""), r =>
             {
@@ -253,7 +259,7 @@ namespace PDF_Office.ViewModels
         }
 
         //打开用户弹窗
-        private void OpenUser()
+        public void OpenUser()
         {
             dialogs.ShowDialog(DialogNames.UserDialog, new DialogParameters(""), r =>
             {

+ 15 - 5
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -3,6 +3,7 @@ using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
 using PDFSettings;
@@ -46,8 +47,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public List<ComboDataItem> PenSizeItems { get; protected set; }
         public List<ComboDataItem> EraserSizeItems { get; protected set; }
 
-        private AnnotBasePropertyVM _basicVm = new AnnotBasePropertyVM();
-        public AnnotBasePropertyVM BasicVm
+        private AnnotCommon _basicVm = new AnnotCommon();
+        public AnnotCommon BasicVm
         {
             get { return _basicVm; }
             set => SetProperty(ref _basicVm, value);
@@ -60,7 +61,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set => SetProperty(ref _isPen, value);
         }
 
-        private double _erasethicknessLine = 1;
+        private double _erasethicknessLine = 10;
         public double EraseThicknessLine
         {
             get { return _erasethicknessLine; }
@@ -99,6 +100,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         {
             InitPenSizeItems();
             InitEraserSizeItems();
+            InitColorItems();
         }
 
         private void InitPenSizeItems()
@@ -130,6 +132,11 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
           
         }
 
+        private void InitColorItems()
+        {
+            BasicVm.ColorItems = AnnotColorList.GetBorderColorList();
+        }
+
         //设置颜色
         private void SelectedColorChanged(object obj)
         {
@@ -218,19 +225,22 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             var btn = obj as ToggleButton;
             if(btn.IsChecked == true)
             {
+                //属性面板,切换橡皮擦后,再回到画笔时,需要恢复最近画笔的属性值
+                CurrenFreeHandAnnot = PropertyPanel.annot as FreehandAnnotArgs;
                 PropertyPanel.InvokeToMyTools(AnnotArgsType.AnnotErase, btn);
                 IsPen = false;
             }
         }
 
+        private FreehandAnnotArgs CurrenFreeHandAnnot;//用来切换橡皮擦时,保存当前的手绘;
         //选择画笔
         private void Pen_Command(object obj)
         {
             var btn = obj as ToggleButton;
             if (btn.IsChecked == true)
             {
-                PropertyPanel.InvokeToMyTools(AnnotArgsType.AnnotErase, btn);
-                IsPen = true;
+                PropertyPanel.InvokeToMyTools(AnnotArgsType.AnnotFreehand, CurrenFreeHandAnnot);
+                IsPen = true;;
             }
         }
 

+ 8 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -2,6 +2,7 @@
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
 using PDFSettings;
@@ -28,8 +29,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set { SetProperty(ref _fontVm, value); }
         }
 
-        private AnnotBasePropertyVM _basicVm = new AnnotBasePropertyVM();
-        public AnnotBasePropertyVM BasicVm
+        private AnnotCommon _basicVm = new AnnotCommon();
+        public AnnotCommon BasicVm
         {
             get { return _basicVm; }
             set => SetProperty(ref _basicVm, value);
@@ -128,8 +129,13 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             DateFormatItems = new List<ComboDataItem>();
             DateFormatItems = TextFont.GetDateFormats();
             UpdateDateFormatLists();
+            InitFillColorItems();
 
+        }
 
+        private void InitFillColorItems()
+        {
+            BasicVm.FillColorItems = AnnotColorList.GetFillColorList();
         }
 
         private void UpdateDateFormatLists()

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

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

+ 16 - 2
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs

@@ -3,6 +3,7 @@ using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -50,8 +51,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
     public class SharpsAnnotPropertyViewModel : BindableBase, INavigationAware
     {
         #region 属性
-        private AnnotBasePropertyVM _basicVm = new AnnotBasePropertyVM();
-        public AnnotBasePropertyVM BasicVm
+        private AnnotCommon _basicVm = new AnnotCommon();
+        public AnnotCommon BasicVm
         {
             get { return _basicVm; }
             set => SetProperty(ref _basicVm, value);
@@ -128,6 +129,9 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public event EventHandler<object> LoadPropertyHandler;
         public SharpsAnnotPropertyViewModel()
         {
+            InitColorItems();
+            InitFillColorItems();
+
             SharpsTypeCommand = new DelegateCommand<object>(SharpsType_Command);
             SelectedFillOpacityCommand = new DelegateCommand<object>(SelectedFillOpacity_Command);
             SelectedFillColorCommand = new DelegateCommand<object>(SelectedFillColor_Command);
@@ -140,6 +144,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             LineStyleCommand = new DelegateCommand<object>(LineStyle_Command);
         }
 
+        private void InitColorItems()
+        {
+            BasicVm.ColorItems = AnnotColorList.GetBorderColorList();
+        }
+
+        private void InitFillColorItems()
+        {
+            BasicVm.FillColorItems = AnnotColorList.GetFillColorList();
+        }
+
         private void ThicknessChanged_Command(object obj)
         {
             if (obj != null)

+ 26 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SignatureAnnotPropertyViewModel.cs

@@ -28,8 +28,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         private IDialogService dialogs;
         public DelegateCommand ShowDialogCommand { get; set; }
 
+        private Signature currentSignature=null;
 
         private int currentListboxIndex = -1;
+        private ViewContentViewModel viewContentViewModel;
 
         public int CurrentListboxIndex
         {
@@ -69,6 +71,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 }
             }
         }
+
+        /// <summary>
+        /// 应用签名
+        /// </summary>
         public void SetSignature(Signature signature)
         {
             switch (signature.Type)
@@ -82,6 +88,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                         stampArgs.ImagePath = signature.SourcePath;
                         PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
                         PDFViewer.SetToolParam(stampArgs);
+                        currentSignature = signature;
                     }
                     break;
                 case SignatureType.Drawing:
@@ -90,6 +97,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                         stampArgs.SetInkData(GetPoints(signature.DrawingPath), signature.inkThickness, signature.inkColor);
                         PDFViewer.SetMouseMode(MouseModes.AnnotCreate);
                         PDFViewer.SetToolParam(stampArgs);
+                        currentSignature = signature;
                     }
                     break;
                 default:
@@ -188,6 +196,12 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             CurrentListboxIndex = SignatureList.Count - 1;
         }
 
+        public void Close()
+        {
+            PDFViewer.SetMouseMode(MouseModes.PanTool);
+            viewContentViewModel.IsPropertyOpen = false;
+        }
+
         /// <summary>
         /// 导出签名
         /// </summary>
@@ -237,6 +251,15 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
 
         public void DeleteSignature(Signature Item)
         {
+            if (currentSignature.Equals(Item))
+            {
+                PDFViewer.SetMouseMode(MouseModes.PanTool);
+            }
+            if (SignatureList.IndexOf(currentSignature)<0)
+            {
+                PDFViewer.SetMouseMode(MouseModes.PanTool);
+            }
+           
             int index = SignatureList.IndexOf(Item);
             App.CachePath.AddToDeleteFiles(Item.SourcePath);
             if (!string.IsNullOrEmpty(Item.DrawingPath))
@@ -265,6 +288,8 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             PDFSettings.SignatureList signature = Settings.Default.SignatureList;
             signature.Clear();
             Settings.Default.Save();
+            PDFViewer.SetMouseMode(MouseModes.PanTool);
+            currentSignature = null;
         }
         public bool IsNavigationTarget(NavigationContext navigationContext)
         {
@@ -283,6 +308,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             {
                 return;
             }
+            navigationContext.Parameters.TryGetValue<ViewContentViewModel>(ParameterNames.ViewContentViewModel, out viewContentViewModel);
         }
     }
 }

+ 40 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SignatureCreateDialogViewModel.cs

@@ -34,6 +34,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         public DelegateCommand<object> CheckedCommnad { get; set; }
 
         public DelegateCommand OpenImageCommnad { get; set; }
+        public DelegateCommand ClearTextCommnad { get; set; }
         public DelegateCommand ClearInkCanvasCommnad { get; set; }
         public ObservableCollection<string> FontNameList { get; set; }
         public ObservableCollection<string> ThicknessList { get; set; }
@@ -86,8 +87,18 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         }
 
 
-        private Visibility showImageButton = Visibility.Visible;
+        private Visibility showTextButton = Visibility.Collapsed;
+        public Visibility ShowTextButton
+        {
+            get { return showTextButton; }
+            set
+            {
+                SetProperty(ref showTextButton, value);
+            }
+        }
+
 
+        private Visibility showImageButton = Visibility.Visible;
         public Visibility ShowImageButton
         {
             get { return showImageButton; }
@@ -151,6 +162,29 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             }
         }
 
+        private bool isMouseDown = false;
+
+        public bool IsMouseDown
+        {
+            get { return isMouseDown; }
+            set
+            {
+                SetProperty(ref isMouseDown, value);
+            }
+        }
+
+
+        private Visibility showPlanGrid = Visibility.Visible;
+
+        public Visibility ShowPlanGrid
+        {
+            get { return showPlanGrid; }
+            set
+            {
+                SetProperty(ref showPlanGrid, value);
+            }
+        }
+
         private int imageRadioButtonIndex = 1;
 
         public int ImageRadioButtonIndex
@@ -223,6 +257,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             CreateCommnad = new DelegateCommand(Create);
             CheckedCommnad = new DelegateCommand<object>(Checked);
             OpenImageCommnad = new DelegateCommand(OpenImage);
+            ClearTextCommnad = new DelegateCommand(ClearText);
             ClearInkCanvasCommnad = new DelegateCommand(ClearInkCanvas);
             DrawingAttributeObject.Color = Colors.Black;
             DrawingAttributeObject.Width = 1;
@@ -267,6 +302,10 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 item.DrawingAttributes = DrawingAttributeObject;
             }
         }
+        private void ClearText()
+        {
+            InputText = "";
+        }
 
         private void OpenImage()
         {

+ 16 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -1,6 +1,8 @@
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
+using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.ViewModels.Tools;
 using Prism.Commands;
 using Prism.Mvvm;
@@ -63,6 +65,14 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set => SetProperty(ref _annotTypeTitle, value);
         }
 
+        //样式颜色集合
+        private List<ColorItem> _colorItems = new List<ColorItem>();
+        public List<ColorItem> ColorItems
+        {
+            get { return _colorItems; }
+            set => SetProperty(ref _colorItems, value);
+        }
+
         Dictionary<string, string> StickyNoteTypes = new Dictionary<string, string>();
         public event EventHandler<object> LoadPropertyHandler;
         public DelegateCommand<object> SelectedColorChangedCommand { get; set; }
@@ -78,11 +88,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             StrickyNoteShapeCommand = new DelegateCommand<object>(StrickyNoteShape);
             SelectedOpacityValueCommand = new DelegateCommand<object>(SelectedOpacityValue);
             InitStickyNoteTypes();
+            InitColorItems();
             var data = StickyNoteTypes["Comment"];
             var converter = TypeDescriptor.GetConverter(typeof(Geometry));
             ExmpleData = (Geometry)converter.ConvertFrom(data);
         }
 
+        private void InitColorItems()
+        {
+            ColorItems = AnnotColorList.GetStyleColorList();
+        }
 
         private void SelectedValueChanged_Command(object obj)
         {
@@ -263,6 +278,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     SharpColor = new SolidColorBrush(annot.Color);
                     Transpent = annot.Transparency;
                     strOtherTag = annot.IconName;
+                    
                 }
                 
             }

+ 37 - 7
PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs

@@ -1,19 +1,17 @@
 using ComPDFKitViewer;
 using ComPDFKitViewer.AnnotEvent;
-using PDF_Office.Helper;
+using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Properties;
 using PDF_Office.ViewModels.Tools;
-using PDFSettings;
 using Prism.Commands;
 using Prism.Mvvm;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
+using System.Collections.ObjectModel;
 using System.Globalization;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
 using System.Windows;
 using System.Windows.Data;
 using System.Windows.Media;
@@ -67,13 +65,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
     {
 
         #region 属性
-        private AnnotBasePropertyVM _basicVm = new AnnotBasePropertyVM();
-        public AnnotBasePropertyVM BasicVm
+        private AnnotCommon _basicVm = new AnnotCommon();
+        public AnnotCommon BasicVm
         {
             get { return _basicVm; }
             set => SetProperty(ref _basicVm, value);
         }
 
+        public List<ColorItem> HighlightItems { get; set; }
+        public List<ColorItem> UnderLineItems { get; set; }
+
         #endregion 属性
 
         public AnnotAttribEvent AnnotEvent { get; set; }
@@ -86,8 +87,22 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
         {
             SelectedColorChangedCommand = new DelegateCommand<object>(SelectedColorChanged);
             SelectedOpacityChangedCommand = new DelegateCommand<object>(SelectedOpacityChanged);
+            InitHighlightItems();
+            InitUnderLinetItems();
+        }
+
+
+        private void InitHighlightItems()
+        {
+            HighlightItems = AnnotColorList.GetHighlightColorList();
+        }
+
+        private void InitUnderLinetItems()
+        {
+            UnderLineItems = AnnotColorList.GetBorderColorList(); 
         }
 
+
         //设置不透明度
         private void SelectedOpacityChanged(object obj)
         {
@@ -171,6 +186,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 //多选注释,默认通用属性颜色为高亮注释的预设颜色
                 if (BasicVm.IsMultiSelected)
                 {
+                    BasicVm.ColorItems = HighlightItems;
                     var annotate = Settings.Default.AppProperties.Annotate;
                     if (annotate != null)
                     {
@@ -180,15 +196,29 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                     {
                         BasicVm.FontColor = new SolidColorBrush(Colors.Transparent);
                     }
+                    
                 }
                 else
                 {
+                    SelectedColorItems();
                     GetAnnotProperty();
                 }
             }
 
         }
 
+        private void SelectedColorItems()
+        {
+            if(BasicVm.AnnotType == AnnotArgsType.AnnotHighlight)
+            {
+                BasicVm.ColorItems = HighlightItems;
+            }
+            else
+            {
+                BasicVm.ColorItems = UnderLineItems;
+            }
+        }
+
         //全局变量,优先集中处理
         private void AllVariable()
         {

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

@@ -1,6 +1,7 @@
 using ComPDFKitViewer;
 using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl.CompositeControl;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using Prism.Mvvm;
 using System;

+ 1 - 0
PDF Office/ViewModels/PropertyPanel/PDFEdit/TextEditPropertyViewModel.cs

@@ -4,6 +4,7 @@ using Microsoft.Win32;
 using PDF_Office.CustomControl.CompositeControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
+using PDF_Office.Model.AnnotPanel;
 using PDF_Office.Model.PropertyPanel.AnnotPanel;
 using PDFSettings;
 using Prism.Commands;

+ 144 - 109
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Command.cs

@@ -126,11 +126,127 @@ namespace PDF_Office.ViewModels.Tools
                 PDFViewer.SnapshotCommandHandler -= PDFViewer_SnapshotCommandHandler;
                 PDFViewer.PDFActionHandler -= PDFViewer_PDFActionHandler;
                 PDFViewer.AnnotHoverHandler -= PDFViewer_AnnotHoverHandler;
+                
             }
         }
 
         #endregion 事件绑定和解绑
 
+        #region 与触发事件调用相关的函数
+
+        //是否为形状注释
+        private bool isShapAnnot(AnnotHandlerEventArgs annot)
+        {
+            if (annot.EventType == AnnotArgsType.AnnotCircle ||
+            annot.EventType == AnnotArgsType.AnnotSquare ||
+            annot.EventType == AnnotArgsType.AnnotLine
+            )
+            {
+                return true;
+            }
+            else
+            {
+                return false;
+            }
+        }
+        //是否为高亮注释
+        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;
+            }
+        }
+        
+        private void GetSelectedAnnots(AnnotAttribEvent e)
+        {
+            var annot = e.AnnotItemsList[0];
+            switch (annot.EventType)
+            {
+                case AnnotArgsType.AnnotHighlight:
+                    GetHighLight(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotUnderline:
+                    GetUnderLine(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotStrikeout:
+                    GetStrikeout(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotSquiggly:
+                    GetSquiggly(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotFreehand:
+                    GetFreehand(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotFreeText:
+                    GetFreetext(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotSquare:
+                    GetRect(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotCircle:
+                    GetCircle(e.AnnotItemsList);
+                    break;
+
+                case AnnotArgsType.AnnotLine:
+                    bool isLine = true;
+                    if (e.Attribs.ContainsKey(AnnotAttrib.LineStart))
+                    {
+                        if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_NONE)
+                        {
+                            isLine = false;
+                        }
+                    }
+                    if (e.Attribs.ContainsKey(AnnotAttrib.LineEnd))
+                    {
+                        if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_NONE)
+                        {
+                            isLine = false;
+                        }
+                    }
+
+                    if (isLine)
+                        GetArrowLine("Line", e.AnnotItemsList);
+                    else
+                        GetArrowLine("Arrow", e.AnnotItemsList);
+
+                    break;
+
+                case AnnotArgsType.AnnotLink:
+                    //viewContentViewModel.IsCreateLink = false;
+                    GetLink(e.AnnotItemsList, e);
+
+                    break;
+
+                case AnnotArgsType.AnnotSticky:
+                    GetStickyNote(e.AnnotItemsList);
+                    customStickyPopup.GetCurrentAnnot = e.AnnotItemsList[0] as StickyAnnotArgs;
+                    customStickyPopup.GetPDFViewer = PDFViewer;
+                    break;
+
+                case AnnotArgsType.AnnotStamp:
+                    GetStamp();
+                    break;
+            }
+        }
+
+        #endregion
+
         #region PDFViewer事件
 
         //选中和非选中注释
@@ -277,113 +393,14 @@ namespace PDF_Office.ViewModels.Tools
             else
             {
                 if (BtnLinkIsChecked == false)
-                    viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
-            }
-        }
-
-        private bool isShapAnnot(AnnotHandlerEventArgs annot)
-        {
-            if (annot.EventType == AnnotArgsType.AnnotCircle ||
-            annot.EventType == AnnotArgsType.AnnotSquare ||
-            annot.EventType == AnnotArgsType.AnnotLine
-            )
-            {
-                return true;
-            }
-            else
-            {
-                return false;
-            }
-        }
+                {
+                    if (PDFViewer.MouseMode != MouseModes.AnnotCreate && PDFViewer.MouseMode != MouseModes.PanTool)
+                        viewContentViewModel.SelectedPrpoertyPanel("PropertyPanelContent", null);
+                }
 
-        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;
             }
         }
 
-        private void GetSelectedAnnots(AnnotAttribEvent e)
-        {
-            var annot = e.AnnotItemsList[0];
-            switch (annot.EventType)
-            {
-                case AnnotArgsType.AnnotHighlight:
-                    GetHighLight(e.AnnotItemsList);
-                    break;
-
-                case AnnotArgsType.AnnotUnderline:
-                    GetUnderLine(e.AnnotItemsList);
-                    break;
-
-                case AnnotArgsType.AnnotStrikeout:
-                    GetStrikeout(e.AnnotItemsList);
-                    break;
-
-                case AnnotArgsType.AnnotSquiggly:
-                    GetSquiggly(e.AnnotItemsList);
-                    break;
-
-                case AnnotArgsType.AnnotFreehand:
-                    GetFreehand(e.AnnotItemsList);
-                    break;
-
-                case AnnotArgsType.AnnotFreeText:
-                    GetFreetext(e.AnnotItemsList);
-                    break;
-
-                case AnnotArgsType.AnnotSquare:
-                    GetRect(e.AnnotItemsList);
-                    break;
-
-                case AnnotArgsType.AnnotCircle:
-                    GetCircle(e.AnnotItemsList);
-                    break;
-
-                case AnnotArgsType.AnnotLine:
-                    bool isLine = true;
-                    if (e.Attribs.ContainsKey(AnnotAttrib.LineStart))
-                    {
-                        if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineStart] != C_LINE_TYPE.LINETYPE_NONE)
-                        {
-                            isLine = false;
-                        }
-                    }
-                    if (e.Attribs.ContainsKey(AnnotAttrib.LineEnd))
-                    {
-                        if ((C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_UNKNOWN && (C_LINE_TYPE)e.Attribs[AnnotAttrib.LineEnd] != C_LINE_TYPE.LINETYPE_NONE)
-                        {
-                            isLine = false;
-                        }
-                    }
-
-                    if (isLine)
-                        GetArrowLine("Line", e.AnnotItemsList);
-                    else
-                        GetArrowLine("Arrow", e.AnnotItemsList);
-
-                    break;
-
-                case AnnotArgsType.AnnotLink:
-                    //viewContentViewModel.IsCreateLink = false;
-                    GetLink(e.AnnotItemsList, e);
-
-                    break;
-
-                case AnnotArgsType.AnnotSticky:
-                    GetStickyNote(e.AnnotItemsList);
-                    break;
-            }
-        }
 
         //在注释工具的状态下,右键菜单
         private void PDFViewer_AnnotCommandHandler(object sender, AnnotCommandArgs e)
@@ -702,7 +719,10 @@ namespace PDF_Office.ViewModels.Tools
                 Pen hoverPen = new Pen(new SolidColorBrush(Color.FromArgb(0xff, 0x11, 0x8A, 0xff)), 1);
                 hoverPen.DashStyle = DashStyles.Dash;
                 e.DrawContext?.DrawRectangle(null, hoverPen, hoverRect);
+
+            
             }
+ 
         }
 
         #endregion PDFViewer事件
@@ -799,14 +819,29 @@ namespace PDF_Office.ViewModels.Tools
                             break;
 
                         case AnnotArgsType.AnnotFreehand:
-                            if (e[argsType] is Color)
-                            {
-                                // FreehandPath.Fill = new SolidColorBrush((Color)e[argsType]);
-                            }
-                            if (e[argsType] is double)
+            
+                            if(e[argsType] is FreehandAnnotArgs)
                             {
-                                //  FreehandPath.Opacity = (double)e[argsType];
+                                var annot = e[argsType] as FreehandAnnotArgs;
+                                if (annot != null)
+                                {
+                                    if (propertyPanel != null)
+                                    {
+                                        //属性面板,切换橡皮擦后,再回到画笔时,需要恢复最近画笔的属性值
+                                        var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                                        propertyPanel.AnnotEvent = AnnotEvent;
+                                        var AnnotEvents = new List<AnnotAttribEvent>();
+                                        AnnotEvents.Add(AnnotEvent);
+                                        propertyPanel.AnnotEvents = AnnotEvents;
+                                        propertyPanel.annot = annot;
+                                        //手绘注释工具按钮的属性
+                                       // FreehandPath.Opacity = annot.Transparency;
+                                       // FreehandPath.Fill = new SolidColorBrush(annot.InkColor);
+                                    }
+                                    PDFViewer.SetToolParam(annot);
+                                }
                             }
+
                             break;
 
                         case AnnotArgsType.AnnotErase:

+ 18 - 9
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -47,6 +47,12 @@ namespace PDF_Office.ViewModels.Tools
 
         //初始化注释的属性值,并存在本地缓存数据集里
         private void InitDefaultValue()
+        {
+            InitToolBtnUI();
+        }
+
+        //注释工具按钮初始化时的属性值
+        private void InitToolBtnUI()
         {
             InitAnnotHighlight();
             InitAnnotUnderline();
@@ -57,7 +63,7 @@ namespace PDF_Office.ViewModels.Tools
         private void InitAnnotHighlight()
         {
             var annotate = Settings.Default.AppProperties.Annotate;
-            if (annotate != null)
+            if (annotate != null && annotate.HighLightColor != Colors.Transparent)
             {
                 HighLightColor = new SolidColorBrush(annotate.HighLightColor);
                 HighLightOpacity = 1;
@@ -72,7 +78,8 @@ namespace PDF_Office.ViewModels.Tools
         private void InitAnnotUnderline()
         {
             var annotate = Settings.Default.AppProperties.Annotate;
-            if (annotate != null)
+            //避免默认值为透明度
+            if (annotate != null && annotate.UnderLineColor != Colors.Transparent)
             {
                 UnderLineColor = new SolidColorBrush(annotate.UnderLineColor);
                 HighLightOpacity = 1;
@@ -87,7 +94,7 @@ namespace PDF_Office.ViewModels.Tools
         private void InitAnnotSquiggly()
         {
             var annotate = Settings.Default.AppProperties.Annotate;
-            if (annotate != null)
+            if (annotate != null && annotate.StrikethroughColor != Colors.Transparent)
             {
                 SquigglyColor = new SolidColorBrush(annotate.StrikethroughColor);
                 SquigglyOpacity = 1;
@@ -102,7 +109,7 @@ namespace PDF_Office.ViewModels.Tools
         private void InitAnnotStrikeout()
         {
             var annotate = Settings.Default.AppProperties.Annotate;
-            if (annotate != null)
+            if (annotate != null && annotate.StrikethroughColor != Colors.Transparent)
             {
                 StrikeoutColor = new SolidColorBrush(annotate.StrikethroughColor);
                 StrikeoutOpacity = 1;
@@ -114,7 +121,10 @@ namespace PDF_Office.ViewModels.Tools
             }
         }
 
-        //用来记录选中和创建注释的标识
+        //在xaml里引用
+        public Dictionary<string, string> GetToolTipDict { get { return ToolTipDict; } }
+
+        //用来记录选中、创建注释的标识
         private void InitToolDict()
         {
             ToolExpandDict.Add("SnapshotEdit", AnnotArgsType.SnapshotWithEditTool);
@@ -133,7 +143,7 @@ namespace PDF_Office.ViewModels.Tools
         }
 
 
-        //工具悬浮文案
+        //注释工具按钮悬浮文案
         private void InitToolTipDict()
         {
             ToolTipDict.Add("Hand", "滚动工具");
@@ -157,7 +167,6 @@ namespace PDF_Office.ViewModels.Tools
             ToolTipDict.Add("ShowAnnot", "显示/隐藏注释");
         }
 
-        public Dictionary<string, string> GetToolTipDict{get{return ToolTipDict;}}
 
         //便签批注弹窗
         private void LoaedStickyNotePopup()
@@ -567,7 +576,6 @@ namespace PDF_Office.ViewModels.Tools
                 squareArgs.Transparency = 1;
                 squareArgs.LineDash = DashStyles.Solid;
                 squareArgs.Content = string.Empty;
-
                 if (squareArgs != null)
                 {
                     selectedArgs = new List<AnnotHandlerEventArgs>();
@@ -662,7 +670,7 @@ namespace PDF_Office.ViewModels.Tools
                 lineArgs.LineWidth = 1;
                 lineArgs.Transparency = 1;
                 lineArgs.Content = string.Empty;
-
+                
                 if (lineArgs != null)
                 {
                     selectedArgs = new List<AnnotHandlerEventArgs>();
@@ -1077,6 +1085,7 @@ namespace PDF_Office.ViewModels.Tools
                     item.DataContext = annot;
                     item.ColorSelected -= AnnotMenu_ColorSelected;
                     item.ColorSelected += AnnotMenu_ColorSelected;
+                    
                     System.Windows.Controls.Primitives.Popup popup = new System.Windows.Controls.Primitives.Popup();
                     popup.Child = item;
                     popup.PlacementRectangle = new Rect(Mouse.GetPosition(App.Current.MainWindow), new Size(item.Width, item.Height));

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

@@ -319,6 +319,9 @@ namespace PDF_Office.ViewModels.Tools
         //图章
         public DelegateCommand<object> StampExportPicture_MenuCommand { get; set; }
 
+        //ESC
+        public DelegateCommand EscCommand { get; set; }
+
         #endregion 注释 - 右键菜单
 
         #endregion 事件

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

@@ -74,7 +74,8 @@ namespace PDF_Office.ViewModels.Tools
             AddBookMarkCommand = new DelegateCommand(AddBookMark_Click);
             PropertyRegionName = Guid.NewGuid().ToString();
             HandCommand = new DelegateCommand<object>(Hand_Click);
-
+            //ESC
+            EscCommand = new DelegateCommand(Esc_KeyDown);
             #region 注释 - 右键菜单
 
             //公共command
@@ -99,6 +100,12 @@ namespace PDF_Office.ViewModels.Tools
             #endregion 注释 - 右键菜单
         }
 
+        private void Esc_KeyDown()
+        {
+            PDFViewer.SetMouseMode(MouseModes.None);
+
+        }
+
         private void Hand_Click(object obj)
         {
             if (obj is WrapPanel wrapPanel)
@@ -163,6 +170,17 @@ namespace PDF_Office.ViewModels.Tools
                     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;
@@ -170,6 +188,10 @@ namespace PDF_Office.ViewModels.Tools
                     #endregion 设计重新调整,阅读页空白处,右键菜单,添加链接需要显示,其他和pro mac一样的效果,不显示属性栏
                 }
             }
+            else
+            {
+                PDFViewer.ToolManager.EnableClickCreate = false;
+            }
 
             //当不是注释模板,且无创建注释时,属性面板显示为空内容
             if (isTemplateAnnot == false && annotArgs == null)

+ 46 - 1
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -26,6 +26,7 @@ using DryIoc;
 using PDF_Office.Model.Dialog.ConverterDialogs;
 using static PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs.DeleteSafetySettintgsModel;
 using PDF_Office.Views.PropertyPanel.AnnotPanel;
+using System.Linq;
 
 namespace PDF_Office.ViewModels
 {
@@ -139,7 +140,7 @@ namespace PDF_Office.ViewModels
             get { return _isInPageEdit; }
             set
             {
-                _isInPageEdit = value;
+                SetProperty(ref _isInPageEdit, value);
                 if (!value)
                 {
                     CanRedo = PDFViewer.UndoManager.CanRedo;
@@ -526,6 +527,8 @@ namespace PDF_Office.ViewModels
 
         public DelegateCommand CloseWindowCommand { get; set; }
 
+        public DelegateCommand OpenFileCommand { get; set; }
+
         #endregion 命令
 
         public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
@@ -551,6 +554,7 @@ namespace PDF_Office.ViewModels
             DecryptCommand = new DelegateCommand(decrypt);
             ConvertCommand = new DelegateCommand<string>(convert);
             CloseWindowCommand = new DelegateCommand(closeWindow);
+            OpenFileCommand = new DelegateCommand(openfile);
 
             ViwerRegionName = RegionNames.ViwerRegionName;
             SplitViewerRegionName = RegionNames.Viewer_SplitRegionName;
@@ -595,6 +599,47 @@ namespace PDF_Office.ViewModels
             EnterSelectedBar("TabItemAnnotation");
         }
 
+        private void openfile()
+        {
+            OpenFileDialog openFileDialog = new OpenFileDialog();
+            openFileDialog.Filter = Properties.Resources.OpenDialogFilter;
+            openFileDialog.Multiselect = true;
+            if ((bool)openFileDialog.ShowDialog())
+            {
+                if (openFileDialog.FileNames.Count() == 1)
+                {
+                    if (App.OpenedFileList.Contains(openFileDialog.FileName))
+                    {
+                        App.mainWindowViewModel.SelectItem(openFileDialog.FileName);
+                    }
+                    else
+                    {
+                        App.mainWindowViewModel.AddTabItem(openFileDialog.FileName);
+                    }
+                    ToolMethod.SetFileThumbImg(openFileDialog.FileName);
+                }
+                else
+                {
+                    var fileList = openFileDialog.FileNames.ToList().Where(x => !App.OpenedFileList.Exists(y => y == x)).ToList();
+                    if (fileList.Count <= 0)
+                    {
+                        App.mainWindowViewModel.SelectItem(openFileDialog.FileName);
+                        return;
+                    }
+
+                    mainViewModel.OpenFile(fileList[0]);
+                    for (int i = 1; i < fileList.Count(); i++)
+                    {
+                        if (!App.OpenedFileList.Contains(fileList[i]))
+                        {
+                            App.mainWindowViewModel.AddTabItem(fileList[i]);
+                        }
+                        ToolMethod.SetFileThumbImg(fileList[i]);
+                    }
+                }
+            }
+        }
+
         /// <summary>
         /// 关闭当前窗体
         /// </summary>

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

@@ -41,6 +41,10 @@ namespace PDF_Office.Views.BOTA
                 {
                     return;
                 }
+                if (string.IsNullOrEmpty(text.Text))
+                {
+                    return;
+                }
                 (DataContext as SearchContentViewModel).SearchText(text.Text);
                  HistorySearchText.Remove(text.Text);
                 if (HistorySearchText.Count >= MaxHistoryCount)

+ 4 - 5
PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml

@@ -33,18 +33,17 @@
                         <TextBlock
                                 Height="20"
                                 Style="{StaticResource PropertyHeaderLv2}"
-                            
                                 HorizontalAlignment="Left"
-                                Text="CSV Workbook Settings" />
+                                Text="CSV Settings" />
                         <StackPanel Margin="0,10,0,0">
                             <RadioButton
                                 IsChecked="True"
                                 Name="ForEachPageRadioBtn"
-                               
+                                Padding="8,0,0,0"
                                 Style="{StaticResource RadioButtonStyleText}"
                                 Command="{Binding RadioButtonCommand}"
                                 CommandParameter="{Binding ElementName=ForEachPageRadioBtn, Path=Name}">
-                                <TextBlock Text="Retain Flowing Text" />
+                                <TextBlock Text="Create worksheets for each &#13; form" />
                             </RadioButton>
                             <RadioButton
                                 
@@ -53,7 +52,7 @@
                                 Style="{StaticResource RadioButtonStyleText}"
                                 Command="{Binding RadioButtonCommand}"
                                 CommandParameter="{Binding ElementName=OnlyTableRadioBtn, Path=Name}">
-                                <TextBlock Text="Retain Page Layout" />
+                                <TextBlock Text="Create a single worksheet for &#13; a document" />
                             </RadioButton>
                         </StackPanel>
                         <StackPanel Margin="0,18,0,0" Orientation="Vertical">

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

@@ -29,11 +29,11 @@
                 <Grid Grid.Column="1">
                     <StackPanel Orientation="Vertical"  Margin="16,2,0,0">
                         <StackPanel Orientation="Vertical">
-                            <TextBlock Text="Text Recognition Settings" HorizontalAlignment="Left"  Height="20"  Style="{StaticResource PropertyHeaderLv2}"/>
+                            <TextBlock Text="HTML Recognition Settings" HorizontalAlignment="Left"  Height="20"  Style="{StaticResource PropertyHeaderLv2}"/>
                             <CheckBox Name="OCRCheckBox"  Margin="0,8,0,0" Padding="8,0,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}">
                                 <TextBlock Text="Recognize text if needed"/>
                             </CheckBox>
-                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,8,0,0" Width="228"  Height="32" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
+                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,8,0,0" Width="228"  Height="32" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}" >
                                 <ComboBoxItem Content="Chinese Simplified"/>
                                 <ComboBoxItem Content="Chinese Traditional"/>
                                 <ComboBoxItem Content="English"/>

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

@@ -29,11 +29,11 @@
                 <Grid Grid.Column="1">
                     <StackPanel Orientation="Vertical"  Margin="16,2,0,0">
                         <StackPanel Orientation="Vertical">
-                            <TextBlock Text="Text Recognition Settings" HorizontalAlignment="Left"  Style="{StaticResource PropertyHeaderLv2}" Height="20"/>
+                            <TextBlock Text="PPT Recognition Settings" HorizontalAlignment="Left"  Style="{StaticResource PropertyHeaderLv2}" Height="20"/>
                             <CheckBox Name="OCRCheckBox"  Margin="0,10,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}" Padding="8,0,0,0">
                                 <TextBlock Text="Recognize text if needed"/>
                             </CheckBox>
-                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,8,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
+                            <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,8,0,0" Width="228" Height="32" HorizontalAlignment="Left" SelectedIndex="{Binding LanguageSelectedIndex}">
                                 <ComboBoxItem Content="Chinese Simplified"/>
                                 <ComboBoxItem Content="Chinese Traditional"/>
                                 <ComboBoxItem Content="English"/>

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

@@ -29,7 +29,7 @@
                 <Grid Grid.Column="1">
                     <StackPanel Orientation="Vertical"  Margin="16,2,0,0">
                         <StackPanel Orientation="Vertical">
-                            <TextBlock Text="Text Recognition Settings" HorizontalAlignment="Left"  Style="{StaticResource PropertyHeaderLv2}" Height="20"/>
+                            <TextBlock Text="RTF Recognition Settings" HorizontalAlignment="Left"  Style="{StaticResource PropertyHeaderLv2}" Height="20"/>
                             <CheckBox Name="OCRCheckBox"  Margin="0,10,0,0" IsChecked="{Binding OCRCheckBoxIsCheckBox}" Padding="8,0,0,0">
                                 <TextBlock Text="Recognize text if needed"/>
                             </CheckBox>

+ 89 - 6
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialog.xaml

@@ -1,4 +1,4 @@
-<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePictureToPDFDialog"
+<UserControl x:Name="userControl" x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePictureToPDFDialog"
              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"
@@ -8,12 +8,77 @@
              xmlns:homepagetoolsdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.HomePageToolsDialogs" 
              d:DataContext="{d:DesignInstance Type=homepagetoolsdialogs:HomePagePictureToPDFDialogViewModel}"
              prism:ViewModelLocator.AutoWireViewModel="True"
+             prism:Dialog.WindowStyle="{StaticResource stlWindowEx}"
              xmlns:convert="clr-namespace:PDF_Office.DataConvert"
              d:DesignHeight="554"
              d:DesignWidth="892"
              mc:Ignorable="d">
+    
     <UserControl.Resources>
         <ResourceDictionary>
+
+            <Style x:Key="ImageFilesListViewStyle" TargetType="{x:Type ListView}">
+                <Setter Property="Template">
+                    <Setter.Value>
+                        <ControlTemplate TargetType="{x:Type ListView}">
+                            <Border
+                        x:Name="Bd"
+                        Padding="1"
+                        Background="{TemplateBinding Background}"
+                        BorderBrush="{TemplateBinding BorderBrush}"
+                        BorderThickness="{TemplateBinding BorderThickness}"
+                        SnapsToDevicePixels="true">
+                                <ScrollViewer Padding="{TemplateBinding Padding}" Focusable="false">
+                                    <Grid>
+                                        <Grid.RowDefinitions>
+                                            <RowDefinition Height="Auto" />
+                                            <RowDefinition />
+                                        </Grid.RowDefinitions>
+                                        <Grid>
+                                            <Grid.ColumnDefinitions>
+                                                <ColumnDefinition Width="4.5*" MinWidth="0" />
+                                                <ColumnDefinition Width="3*" />
+                                                <ColumnDefinition Width="2*" />
+                                                <ColumnDefinition Width="100" />
+                                            </Grid.ColumnDefinitions>
+                                            <!--  以下是列表模式的列标题  -->
+                                            <TextBlock
+                                        Margin="12,0,0,6"
+                                        HorizontalAlignment="Left"
+                                        VerticalAlignment="Center"
+                                        FontSize="14" />
+
+                                            <TextBlock
+                                        Grid.Column="1"
+                                        Margin="0,0,0,6"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        FontSize="14"
+                                        TextAlignment="Center"
+                                        TextWrapping="Wrap" />
+                                            <TextBlock
+                                        Grid.Column="2"
+                                        Margin="0,0,0,6"
+                                        HorizontalAlignment="Center"
+                                        VerticalAlignment="Center"
+                                        FontSize="14" />
+                                            <!--  列表模式的列标题的分隔线  -->
+                                            <Rectangle
+                                        Grid.ColumnSpan="4"
+                                        Height="0"
+                                        Margin="12,0,0,0"
+                                        HorizontalAlignment="Stretch"
+                                        VerticalAlignment="Bottom"
+                                        Fill="#26000000" />
+                                        </Grid>
+                                        <ItemsPresenter Grid.Row="1" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
+                                    </Grid>
+                                </ScrollViewer>
+                            </Border>
+                        </ControlTemplate>
+                    </Setter.Value>
+                </Setter>
+            </Style>
             <Style x:Key="HeadStyle" TargetType="{x:Type GridViewColumnHeader}">
                 <Setter Property="OverridesDefaultStyle" Value="False" />
                 <Setter Property="TextBlock.HorizontalAlignment" Value="Left"/>
@@ -48,7 +113,9 @@
             <!--  ListViewItem的样式  -->
             <Style x:Key="listitem1" TargetType="{x:Type ListViewItem}">
                 <Style.Setters>
-                    <Setter Property="SnapsToDevicePixels" Value="True" />
+                    
+
+                    <!--<Setter Property="SnapsToDevicePixels" Value="True" />
                     <Setter Property="Template">
                         <Setter.Value>
                             <ControlTemplate TargetType="{x:Type ListViewItem}">
@@ -77,7 +144,7 @@
                                 </ControlTemplate.Triggers>
                             </ControlTemplate>
                         </Setter.Value>
-                    </Setter>
+                    </Setter>-->
                 </Style.Setters>
             </Style>
             <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
@@ -101,7 +168,7 @@
                   DragLeave="MainPage_DragLeave"
                   >
                 <!--<Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>-->
-                <Grid Visibility="{Binding AddFileVisibility}"  Height="480" Width="632">
+                <Grid x:Name="grid" Visibility="{Binding AddFileVisibility}"  Height="480" Width="632">
                     <Button Name="BtnBlank" Background="White" Height="180" Width="418" Visibility="{Binding AddFileVisibility}" Command="{Binding ADDPictureCommand}" BorderBrush="#FFFFFF">
                         <StackPanel>
                             <Grid Width="128" Height="128">
@@ -113,7 +180,8 @@
                         </StackPanel>
                     </Button>
                 </Grid>
-                <ListView x:Name="listView"  DataContext="{Binding ImagesDataTable}"   Background="White"   ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" BorderThickness="1,0,1,1" Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}">
+                <ListView x:Name="listView"  DataContext="{Binding ImagesDataTable}"   Background="White"   ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" BorderThickness="0,0,0,0"
+                    Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}" Width="{Binding ActualWidth, ElementName=grid, Mode=OneWay}" Height="{Binding ActualHeight, ElementName=grid, Mode=OneWay}">
 
                     <ListView.ContextMenu>
                         <ContextMenu  StaysOpen="True"  >
@@ -153,9 +221,24 @@
                     <ListView.ItemContainerStyle>
                         <Style TargetType="ListViewItem">
                             <Setter Property="Height" Value="42"/>
+                            <Setter Property="BorderThickness" Value="0,2,0,0"/>
+                            <Setter Property="TextBlock.Foreground" Value="{StaticResource color.sys.text.neutral.lv1}"/>
+                            <Setter Property="TextBlock.FontFamily" Value="Segoe UI"/>
+                            <Setter  Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}"/>
+                            <Setter  Property="Padding" Value="16,2,16,2"/>
                             <Style.Triggers>
+                                <Trigger Property="IsMouseOver" Value="True">
+                                    <Setter  Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}"/>
+                                    <Setter  Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}"/>
+                                    <Setter Property="BorderThickness" Value="2,2,2,2"/>
+                                </Trigger>
+                                <Trigger Property="IsSelected" Value="True">
+                                    <Setter  Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}"/>
+                                    <Setter  Property="BorderBrush" Value="{StaticResource color.item-state.sel.border.lv3}"/>
+                                    <Setter Property="BorderThickness" Value="2,2,2,2"/>
+                                </Trigger>
                                 <Trigger Property="ListView.AlternationIndex" Value="1">
-                                    <Setter Property="Background" Value="LightGray"/>
+                                    <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}"/>
                                 </Trigger>
                             </Style.Triggers>
                         </Style>

+ 8 - 2
PDF Office/Views/Dialog/ServiceDialog/CodeRegion.xaml

@@ -45,6 +45,7 @@
             FontFamily="Segoe UI"
             FontSize="12"
             FontStyle="Normal"
+            KeyUp="text_Code1_KeyUp"
             Text="{Binding Code1, Mode=TwoWay}"
             TextChanged="Code_TextChanged" />
         <TextBox
@@ -56,6 +57,7 @@
             HorizontalAlignment="Left"
             VerticalAlignment="Top"
             FontFamily="Segoe UI"
+             KeyUp="text_Code2_KeyUp"
             FontSize="12"
             FontStyle="Normal"
             Text="{Binding Code2, Mode=TwoWay}"
@@ -64,6 +66,7 @@
             x:Name="text_Code3"
             Width="36"
             Height="42"
+             KeyUp="text_Code3_KeyUp"
             Margin="120,138,0,0"
             Padding="10"
             HorizontalAlignment="Left"
@@ -79,6 +82,7 @@
             Height="42"
             Margin="164,138,0,0"
             Padding="10"
+             KeyUp="text_Code4_KeyUp"
             HorizontalAlignment="Left"
             VerticalAlignment="Top"
             FontFamily="Segoe UI"
@@ -91,6 +95,7 @@
             x:Name="text_Code5"
             Width="36"
             Height="42"
+             KeyUp="text_Code5_KeyUp"
             Margin="208,138,0,0"
             Padding="10"
             HorizontalAlignment="Left"
@@ -106,15 +111,16 @@
             Height="42"
             Margin="252,138,0,0"
             Padding="10"
+             KeyUp="text_Code6_KeyUp"
             HorizontalAlignment="Left"
             VerticalAlignment="Top"
             FontFamily="Segoe UI"
             FontSize="12"
             FontStyle="Normal"
-            Text="{Binding Code6, Mode=TwoWay}"
+            Text="{Binding Code6, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
             TextChanged="text_Code6_TextChanged">
             <i:Interaction.Triggers>
-                <i:EventTrigger EventName="Code6Changed">
+                <i:EventTrigger EventName="TextChanged">
                     <i:InvokeCommandAction Command="{Binding Code6ChangedCommand}" />
                 </i:EventTrigger>
             </i:Interaction.Triggers>

+ 117 - 40
PDF Office/Views/Dialog/ServiceDialog/CodeRegion.xaml.cs

@@ -36,69 +36,88 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         }
         private void Code_TextChanged(object sender, TextChangedEventArgs e)
         {
-            if (text_Code1.Text.Length >= 1)
+            if (text_Code1.Text.Length == 1)
             {
                 text_Code2.Focus();
             }
-            else if(text_Code1.Text.Length == 0)
-            {
-                text_Code1.Focus();
-            }
+
             else if (text_Code1.Text.Length > 1)
             {
-                text_Code1.Text = text_Code1.Text.Substring(0, 1);
-                text_Code1.Focus();
+                string str = text_Code1.Text;
+               
+                 text_Code1.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if(str.Length>0)
+                {
+                    text_Code2.Text = str;
+                   
+                }
+               
+                
+                
             }
         }
 
         private void text_Code2_TextChanged(object sender, TextChangedEventArgs e)
         {
-            if (text_Code2.Text.Length >= 1)
+            if (text_Code2.Text.Length == 1)
             {
                 text_Code3.Focus();
             }
-            else if (text_Code2.Text.Length == 0)
-            {
-                text_Code1.Focus();
-            }
+
             else if (text_Code2.Text.Length > 1)
             {
-                text_Code2.Text = text_Code2.Text.Substring(0, 1);
-                text_Code2.Focus();
+                string str = text_Code2.Text;
+
+                text_Code2.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if (str.Length > 0)
+                {
+                    text_Code3.Text = str;
+                }
+                
             }
         }
 
         private void text_Code3_TextChanged(object sender, TextChangedEventArgs e)
         {
-            if (text_Code3.Text.Length >= 1)
+            if (text_Code3.Text.Length == 1)
             {
                 text_Code4.Focus();
             }
-            else if (text_Code3.Text.Length == 0)
-            {
-                text_Code2.Focus();
-            }
+
             else if (text_Code3.Text.Length > 1)
             {
-                text_Code3.Text = text_Code3.Text.Substring(0, 1);
-                text_Code3.Focus();
+                string str = text_Code3.Text;
+
+                text_Code3.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if (str.Length > 0)
+                {
+                    text_Code4.Text = str;
+                }
+                
             }
         }
 
         private void text_Code4_TextChanged(object sender, TextChangedEventArgs e)
         {
-            if (this.text_Code4.Text.Length >= 1)
+            if (this.text_Code4.Text.Length == 1)
             {
                 this.text_Code5.Focus();
             }
-            else if (text_Code4.Text.Length == 0)
-            {
-                text_Code3.Focus();
-            }
+
             else if (text_Code4.Text.Length > 1)
             {
-                text_Code4.Text = text_Code4.Text.Substring(0, 1);
-                text_Code4.Focus();
+                string str = text_Code4.Text;
+
+                text_Code4.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if (str.Length > 0)
+                {
+                    text_Code5.Text = str;
+                }
+               
             }
         }
 
@@ -108,14 +127,18 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 this.text_Code6.Focus();
             }
-            else if (text_Code5.Text.Length == 0)
-            {
-                text_Code4.Focus();
-            }
+
             else if (text_Code5.Text.Length > 1)
             {
-                text_Code5.Text = text_Code5.Text.Substring(0, 1);
-                text_Code5.Focus();
+                string str = text_Code5.Text;
+
+                text_Code5.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if (str.Length > 0)
+                {
+                    text_Code6.Text = str;
+                }
+                
             }
         }
 
@@ -125,18 +148,72 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 text_Code6.Focus();
             }
-            else if (text_Code6.Text.Length == 0)
+
+            else 
+            if(text_Code6.Text.Length >1)
             {
-                text_Code5.Focus();
+                string str = text_Code6.Text;
+                text_Code6.Focus();
+                text_Code6.Text = str.Substring(0, 1);
+                
+
+            }
+
+        }
+
+        private void text_Code1_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back)
+            {
+                text_Code1.Text = "";
+                text_Code1.Focus();
             }
-            else if(text_Code6.Text.Length >1)
+        }
+
+        private void text_Code2_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back)
             {
-                text_Code6.Text = text_Code6.Text.Substring(0,1);
-                text_Code6.Focus();
+                text_Code2.Text = "";
+                text_Code1.Focus();
+            }
+        }
+
+        private void text_Code3_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back )
+            {
+                text_Code3.Text = "";
+                text_Code2.Focus();
             }
 
         }
 
-      
+        private void text_Code4_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back )
+            {
+                text_Code4.Text = "";
+                text_Code3.Focus();
+            }
+        }
+
+        private void text_Code5_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back )
+            {
+                text_Code5.Text = "";
+                text_Code4.Focus();
+            }
+        }
+
+        private void text_Code6_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back )
+            {
+                text_Code6.Text = "";
+                text_Code5.Focus();
+            }
+        }
     }
 }

+ 1 - 0
PDF Office/Views/Dialog/ServiceDialog/LoginDialog.xaml

@@ -8,6 +8,7 @@
     xmlns:prism="http://prismlibrary.com/"
     prism:ViewModelLocator.AutoWireViewModel="True" 
     Width="586"
+     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     Height="420"
     mc:Ignorable="d">
     <Grid Background="White">

+ 10 - 2
PDF Office/Views/Dialog/ServiceDialog/LoginPasswordRegion.xaml

@@ -6,7 +6,7 @@
     xmlns:help="clr-namespace:PDF_Office.Helper"
     xmlns:local="clr-namespace:PDF_Office.Views.Dialog.ServiceDialog"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-    xmlns:prism="http://prismlibrary.com/"
+    xmlns:prism="http://prismlibrary.com/" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
     Width="326"
     Height="420"
     prism:ViewModelLocator.AutoWireViewModel="True"
@@ -344,16 +344,24 @@
                 Style="{StaticResource LoginPasswordBoxStyle}"
                 Visibility="{Binding LoginPasswordVisibility, Mode=TwoWay}" />
                 <TextBox
+                    x:Name="Text_Password"
                 Grid.ColumnSpan="2"
                 help:PasswordBoxHelper.DisplayText="{Binding LoginPasswordMsg, Mode=TwoWay}"
                 Style="{StaticResource LoginPasswordTextBoxStyle}"
                 Text="{Binding LoginPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                Visibility="{Binding LoginTextVisibility, Mode=TwoWay}" />
+                Visibility="{Binding LoginTextVisibility, Mode=TwoWay}" HorizontalAlignment="Left" Width="262" >
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="TextChanged">
+                            <i:InvokeCommandAction Command="{Binding LoginPasswordChangedCommand}" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </TextBox>
                 <CheckBox
                 x:Name="DisplayLoginPasswordChk"
                 Grid.Column="1"
                 Height="16"
                 HorizontalAlignment="Left"
+                Visibility="{Binding ChkVis}"
                 Panel.ZIndex="1"
                 Command="{Binding DisplayPasswordCommand}"
                 CommandParameter="{Binding RelativeSource={RelativeSource Self}}"

+ 8 - 0
PDF Office/Views/Dialog/ServiceDialog/LoginPasswordRegion.xaml.cs

@@ -23,6 +23,14 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         public LoginPasswordRegion()
         {
             InitializeComponent();
+            Loaded += Focus_Loaded;
+
+
+        }
+
+        private void Focus_Loaded(object sender, RoutedEventArgs e)
+        {
+            Text_Password.Focus();
         }
     }
 }

+ 2 - 1
PDF Office/Views/Dialog/ServiceDialog/LoginRegion.xaml

@@ -304,11 +304,12 @@
                 VerticalAlignment="Top">
 
                 <TextBox
+                    x:Name="Text_Email"
                     Grid.ColumnSpan="2"
                     help:PasswordBoxHelper.DisplayText="{Binding LoginEmailMsg, Mode=TwoWay}"
                     Style="{StaticResource LoginEmailTextBoxStyle}"
                     Text="{Binding LoginEmail, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                    Visibility="{Binding EmailTextVisibility, Mode=TwoWay}" />
+                     />
             </Grid>
             <TextBlock
                 Width="262"

+ 9 - 0
PDF Office/Views/Dialog/ServiceDialog/LoginRegion.xaml.cs

@@ -23,6 +23,15 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         public LoginRegion()
         {
             InitializeComponent();
+            Loaded += Focus_Loaded;
+
+
+        }
+
+        private void Focus_Loaded(object sender, RoutedEventArgs e)
+        {
+            Text_Email.Focus();
         }
+    
     }
 }

+ 28 - 3
PDF Office/Views/Dialog/ServiceDialog/PasswordUpdataRegion.xaml

@@ -6,7 +6,7 @@
     xmlns:help="clr-namespace:PDF_Office.Helper"
     xmlns:local="clr-namespace:PDF_Office.Views.Dialog.ServiceDialog"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-    xmlns:prism="http://prismlibrary.com/"
+    xmlns:prism="http://prismlibrary.com/" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
     Width="326"
     Height="420"
     prism:ViewModelLocator.AutoWireViewModel="True"
@@ -417,22 +417,40 @@
                 Style="{StaticResource LoginPasswordBoxStyle2}"
                 Visibility="{Binding LoginPasswordVisibility2, Mode=TwoWay}" />
                 <TextBox
+                 x:Name="Text_RePassword2"
                 Grid.ColumnSpan="2"
                 help:PasswordBoxHelper.DisplayText="{Binding LoginPasswordMsg2, Mode=TwoWay}"
                 Style="{StaticResource LoginPasswordTextBoxStyle2}"
                 Text="{Binding LoginPassword2, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                Visibility="{Binding LoginTextVisibility2, Mode=TwoWay}" />
+                Visibility="{Binding LoginTextVisibility2, Mode=TwoWay}" >
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="TextChanged">
+                            <i:InvokeCommandAction Command="{Binding LoginPasswordChanged2Command}" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </TextBox>
+
                 <CheckBox
                 x:Name="DisplayLoginPasswordChk2"
                 Grid.Column="1"
                 Height="16"
                 HorizontalAlignment="Left"
                 Panel.ZIndex="1"
+                     Visibility="{Binding ChkVis2}"
                 Command="{Binding DisplayPasswordCommand2}"
                 CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
                 IsChecked="{Binding IsLoginPasswordDisplayed2, Mode=TwoWay}"
                 Style="{StaticResource EyeCheckbox}" />
+               
             </Grid>
+            <TextBlock
+                Width="262"
+                Height="20"
+                Margin="32,142,0,0"
+                Foreground="#F3465B"
+                HorizontalAlignment="Left"
+                VerticalAlignment="Top"
+                Text="{Binding LoginPasswordlook2, Mode=TwoWay}" Grid.ColumnSpan="2" />
             <Grid
             Width="262"
             Height="32"
@@ -455,13 +473,20 @@
                 help:PasswordBoxHelper.DisplayText="{Binding LoginPasswordMsg, Mode=TwoWay}"
                 Style="{StaticResource LoginPasswordTextBoxStyle}"
                 Text="{Binding LoginPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                Visibility="{Binding LoginTextVisibility, Mode=TwoWay}" />
+                Visibility="{Binding LoginTextVisibility, Mode=TwoWay}" >
+                    <i:Interaction.Triggers>
+                        <i:EventTrigger EventName="TextChanged">
+                            <i:InvokeCommandAction Command="{Binding LoginPasswordChangedCommand}" />
+                        </i:EventTrigger>
+                    </i:Interaction.Triggers>
+                </TextBox>
                 <CheckBox
                 x:Name="DisplayLoginPasswordChk"
                 Grid.Column="1"
                 Height="16"
                 HorizontalAlignment="Left"
                 Panel.ZIndex="1"
+                     Visibility="{Binding ChkVis}"
                 Command="{Binding DisplayPasswordCommand}"
                 CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
                 IsChecked="{Binding IsLoginPasswordDisplayed, Mode=TwoWay}"

+ 9 - 0
PDF Office/Views/Dialog/ServiceDialog/PasswordUpdataRegion.xaml.cs

@@ -24,7 +24,16 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
     {
         public PasswordUpdataRegion()
         {
+
             InitializeComponent();
+            Loaded += Focus_Loaded;
+
+
+        }
+
+        private void Focus_Loaded(object sender, RoutedEventArgs e)
+        {
+            Text_RePassword2.Focus();
         }
     }
 }

+ 1 - 0
PDF Office/Views/Dialog/ServiceDialog/RegisterDialog.xaml

@@ -7,6 +7,7 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
     prism:ViewModelLocator.AutoWireViewModel="True" 
+    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     Width="586"
     Height="420"
     mc:Ignorable="d">

+ 49 - 22
PDF Office/Views/Dialog/ServiceDialog/RegisterRegion.xaml

@@ -6,11 +6,10 @@
     xmlns:help="clr-namespace:PDF_Office.Helper"
     xmlns:local="clr-namespace:PDF_Office.Views.Dialog.ServiceDialog"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-    xmlns:prism="http://prismlibrary.com/"
-    Height="420"
+    xmlns:prism="http://prismlibrary.com/" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
     Width="326"
+    Height="420"
     prism:ViewModelLocator.AutoWireViewModel="True"
-    
     mc:Ignorable="d">
     <UserControl.Resources>
         <Style x:Key="EyeCheckbox" TargetType="CheckBox">
@@ -276,6 +275,18 @@
     </UserControl.Resources>
 
     <Grid Background="White">
+        <Button
+            Width="16"
+            Height="16" 
+            WindowChrome.IsHitTestVisibleInChrome="True"
+            Margin="287,17,0,0"
+            HorizontalAlignment="Left"
+            Background="Transparent"  
+            BorderThickness="0"
+            VerticalAlignment="Top"
+            Command="{Binding CloseDialogCommand}">
+            <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="11.2919922 12 12 11.2919922 6.70800781 6 12 0.708007813 11.2919922 0 6 5.29199219 0.708007812 9.76996262e-15 -2.27456942e-13 0.708007813 5.29199219 6 0 11.2919922 0.708007812 12 6 6.70800781" />
+        </Button>
         <TextBlock
             Width="72"
             Height="28"
@@ -294,21 +305,20 @@
             HorizontalAlignment="Left"
             VerticalAlignment="Top">
             <TextBox
-                
+                Name="Text_Email"
                 Grid.ColumnSpan="2"
                 help:PasswordBoxHelper.DisplayText="{Binding RegisterEmailMsg, Mode=TwoWay}"
                 Style="{StaticResource RegisterEmailTextBoxStyle}"
-                Text="{Binding RegisterEmail, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                Visibility="{Binding EmailTextVisibility, Mode=TwoWay}"  />
+                Text="{Binding RegisterEmail, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
         </Grid>
         <TextBlock
             Width="262"
             Height="20"
             Margin="32,144,0,0"
-            Foreground="#F3465B"
             HorizontalAlignment="Left"
-            Text="{Binding RegisterEmaillook,Mode=TwoWay}"
-            VerticalAlignment="Top"/>
+            VerticalAlignment="Top"
+            Foreground="#F3465B"
+            Text="{Binding RegisterEmaillook, Mode=TwoWay}" />
 
         <Grid
             Width="262"
@@ -316,7 +326,7 @@
             Margin="32,170,0,0"
             HorizontalAlignment="Left"
             VerticalAlignment="Top"
-            IsEnabled="{Binding ElementName=PermissionsPasswordChk, Path=IsChecked}">
+            >
             <Grid.ColumnDefinitions>
                 <ColumnDefinition />
                 <ColumnDefinition Width="24" />
@@ -332,7 +342,14 @@
                 help:PasswordBoxHelper.DisplayText="{Binding RegisterPasswordMsg, Mode=TwoWay}"
                 Style="{StaticResource RegisterPasswordTextBoxStyle}"
                 Text="{Binding RegisterPassword, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
-                Visibility="{Binding RegisterTextVisibility, Mode=TwoWay}" />
+                Visibility="{Binding RegisterTextVisibility, Mode=TwoWay}" >
+                <i:Interaction.Triggers>
+                    <i:EventTrigger EventName="TextChanged">
+                        <i:InvokeCommandAction Command="{Binding RegisterPasswordChangedCommand}" />
+                    </i:EventTrigger>
+                </i:Interaction.Triggers>
+            </TextBox>
+            
             <CheckBox
                 x:Name="DisplayRegisterPasswordChk"
                 Grid.Column="1"
@@ -340,6 +357,7 @@
                 HorizontalAlignment="Left"
                 Panel.ZIndex="1"
                 Command="{Binding DisplayPasswordCommand}"
+                Visibility="{Binding ChkVis}"
                 CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
                 IsChecked="{Binding IsRegisterPasswordDisplayed, Mode=TwoWay}"
                 Style="{StaticResource EyeCheckbox}" />
@@ -349,9 +367,9 @@
             Height="20"
             Margin="32,204,0,0"
             HorizontalAlignment="Left"
+            VerticalAlignment="Top"
             Foreground="#F3465B"
-            Text="{Binding RegisterePasswordlook,Mode=TwoWay}"
-            VerticalAlignment="Top"/>
+            Text="{Binding RegisterePasswordlook, Mode=TwoWay}" />
         <Button
             Width="262"
             Height="32"
@@ -383,9 +401,8 @@
             FontSize="12"
             FontWeight="Normal"
             Foreground="#1770F4"
-            LineHeight="20"
-            Text="{Binding GoLogin}" >
-            <Hyperlink    Command="{Binding GoLoginCommand}">Sign in </Hyperlink>
+            LineHeight="20">
+            <Hyperlink Command="{Binding GoLoginCommand}">Sign in</Hyperlink>
         </TextBlock>
         <TextBlock
             Width="262"
@@ -397,12 +414,22 @@
             FontSize="11"
             FontWeight="Normal"
             Foreground="#616469"
-            TextWrapping = "Wrap"
-            LineHeight="18">
-            <Run Text="By registering, you agree to the" />   
-           <Hyperlink NavigateUri="{Binding UriPolivy}" TextDecorations="Underline"  Command="{Binding LinkPolicyCommand}">privary policy </Hyperlink>
-           <Run Text="and"/>
-           <Hyperlink NavigateUri="{Binding UriLicense}" TextDecorations="Underline" Command="{Binding LinkLicenseCommand}">License Agreement </Hyperlink>
+            LineHeight="18"
+            TextWrapping="Wrap">
+            <Run Text="By registering, you agree to the" />
+            <Hyperlink
+                Command="{Binding LinkPolicyCommand}"
+                NavigateUri="{Binding UriPolivy}"
+                TextDecorations="Underline">
+                privary policy
+            </Hyperlink>
+            <Run Text="and" />
+            <Hyperlink
+                Command="{Binding LinkLicenseCommand}"
+                NavigateUri="{Binding UriLicense}"
+                TextDecorations="Underline">
+                License Agreement
+            </Hyperlink>
         </TextBlock>
     </Grid>
 </UserControl>

+ 10 - 0
PDF Office/Views/Dialog/ServiceDialog/RegisterRegion.xaml.cs

@@ -25,6 +25,16 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
         public RegisterRegion()
         {
             InitializeComponent();
+            Loaded += Focus_Loaded;
+
+
+        }
+
+        private void Focus_Loaded(object sender, RoutedEventArgs e)
+        {
+            Text_Email.Focus();
         }
+    
+
     }
 }

+ 1 - 0
PDF Office/Views/Dialog/ServiceDialog/UserDialog.xaml

@@ -8,6 +8,7 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
     Width="310"
+   prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     Height="348"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">

+ 7 - 1
PDF Office/Views/Dialog/ServiceDialog/UserOutCodeRegion.xaml

@@ -39,6 +39,7 @@
             x:Name="text_Code1"
             Width="36"
             Height="42"
+            KeyUp="text_Code1_KeyUp"
             Margin="24,130,0,0"
             Padding="10"
             HorizontalAlignment="Left"
@@ -51,6 +52,7 @@
         <TextBox
             x:Name="text_Code2"
             Width="36"
+            KeyUp="text_Code2_KeyUp"
             Height="42"
             Margin="69,130,0,0"
             Padding="10"
@@ -67,6 +69,7 @@
             Height="42"
             Margin="114,130,0,0"
             Padding="10"
+            KeyUp="text_Code3_KeyUp"
             HorizontalAlignment="Left"
             VerticalAlignment="Top"
             FontFamily="Segoe UI"
@@ -78,6 +81,7 @@
             x:Name="text_Code4"
             Width="36"
             Height="42"
+            KeyUp="text_Code4_KeyUp"
             Margin="159,130,0,0"
             Padding="10"
             HorizontalAlignment="Left"
@@ -92,6 +96,7 @@
             x:Name="text_Code5"
             Width="36"
             Height="42"
+            KeyUp="text_Code5_KeyUp"
             Margin="204,130,0,0"
             Padding="10"
             HorizontalAlignment="Left"
@@ -104,6 +109,7 @@
         <TextBox
             x:Name="text_Code6"
             Width="36"
+            KeyUp="text_Code6_KeyUp"
             Height="42"
             Margin="249,130,0,0"
             Padding="10"
@@ -112,7 +118,7 @@
             FontFamily="Segoe UI"
             FontSize="12"
             FontStyle="Normal"
-            Text="{Binding Code6, Mode=TwoWay}"
+            Text="{Binding Code6, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
             TextChanged="text_Code6_TextChanged">
             <i:Interaction.Triggers>
                 <i:EventTrigger EventName="Code6Changed">

+ 116 - 39
PDF Office/Views/Dialog/ServiceDialog/UserOutCodeRegion.xaml.cs

@@ -38,69 +38,88 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
 
         private void Code_TextChanged(object sender, TextChangedEventArgs e)
         {
-            if (text_Code1.Text.Length >= 1)
+            if (text_Code1.Text.Length == 1)
             {
                 text_Code2.Focus();
             }
-            else if (text_Code1.Text.Length == 0)
-            {
-                text_Code1.Focus();
-            }
+
             else if (text_Code1.Text.Length > 1)
             {
-                text_Code1.Text = text_Code1.Text.Substring(0, 1);
-                text_Code1.Focus();
+                string str = text_Code1.Text;
+
+                text_Code1.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if (str.Length > 0)
+                {
+                    text_Code2.Text = str;
+
+                }
+
+
+
             }
         }
 
         private void text_Code2_TextChanged(object sender, TextChangedEventArgs e)
         {
-            if (text_Code2.Text.Length >= 1)
+            if (text_Code2.Text.Length == 1)
             {
                 text_Code3.Focus();
             }
-            else if (text_Code2.Text.Length == 0)
-            {
-                text_Code1.Focus();
-            }
+
             else if (text_Code2.Text.Length > 1)
             {
-                text_Code2.Text = text_Code2.Text.Substring(0, 1);
-                text_Code2.Focus();
+                string str = text_Code2.Text;
+
+                text_Code2.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if (str.Length > 0)
+                {
+                    text_Code3.Text = str;
+                }
+
             }
         }
 
         private void text_Code3_TextChanged(object sender, TextChangedEventArgs e)
         {
-            if (text_Code3.Text.Length >= 1)
+            if (text_Code3.Text.Length == 1)
             {
                 text_Code4.Focus();
             }
-            else if (text_Code3.Text.Length == 0)
-            {
-                text_Code2.Focus();
-            }
+
             else if (text_Code3.Text.Length > 1)
             {
-                text_Code3.Text = text_Code3.Text.Substring(0, 1);
-                text_Code3.Focus();
+                string str = text_Code3.Text;
+
+                text_Code3.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if (str.Length > 0)
+                {
+                    text_Code4.Text = str;
+                }
+
             }
         }
 
         private void text_Code4_TextChanged(object sender, TextChangedEventArgs e)
         {
-            if (this.text_Code4.Text.Length >= 1)
+            if (this.text_Code4.Text.Length == 1)
             {
                 this.text_Code5.Focus();
             }
-            else if (text_Code4.Text.Length == 0)
-            {
-                text_Code3.Focus();
-            }
+
             else if (text_Code4.Text.Length > 1)
             {
-                text_Code4.Text = text_Code4.Text.Substring(0, 1);
-                text_Code4.Focus();
+                string str = text_Code4.Text;
+
+                text_Code4.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if (str.Length > 0)
+                {
+                    text_Code5.Text = str;
+                }
+
             }
         }
 
@@ -110,14 +129,18 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 this.text_Code6.Focus();
             }
-            else if (text_Code5.Text.Length == 0)
-            {
-                text_Code4.Focus();
-            }
+
             else if (text_Code5.Text.Length > 1)
             {
-                text_Code5.Text = text_Code5.Text.Substring(0, 1);
-                text_Code5.Focus();
+                string str = text_Code5.Text;
+
+                text_Code5.Text = str.Substring(0, 1);
+                str = str.Remove(0, 1);
+                if (str.Length > 0)
+                {
+                    text_Code6.Text = str;
+                }
+
             }
         }
 
@@ -127,18 +150,72 @@ namespace PDF_Office.Views.Dialog.ServiceDialog
             {
                 text_Code6.Focus();
             }
-            else if (text_Code6.Text.Length == 0)
-            {
-                text_Code5.Focus();
-            }
+
             else if (text_Code6.Text.Length > 1)
             {
-                text_Code6.Text = text_Code6.Text.Substring(0, 1);
+                string str = text_Code6.Text;
                 text_Code6.Focus();
+                text_Code6.Text = str.Substring(0, 1);
+
+
+            }
+
+        }
+
+        private void text_Code1_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back)
+            {
+                text_Code1.Text = "";
+                text_Code1.Focus();
+            }
+        }
+
+        private void text_Code2_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back)
+            {
+                text_Code2.Text = "";
+                text_Code1.Focus();
+            }
+        }
+
+        private void text_Code3_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back)
+            {
+                text_Code3.Text = "";
+                text_Code2.Focus();
+            }
+
+        }
+
+        private void text_Code4_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back)
+            {
+                text_Code4.Text = "";
+                text_Code3.Focus();
             }
+        }
 
+        private void text_Code5_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back)
+            {
+                text_Code5.Text = "";
+                text_Code4.Focus();
+            }
         }
 
+        private void text_Code6_KeyUp(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Back)
+            {
+                text_Code6.Text = "";
+                text_Code5.Focus();
+            }
+        }
 
     }
 }

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

@@ -148,11 +148,11 @@
                                             <ColumnDefinition Width="*"/>
                                             <ColumnDefinition Width="17"/>
                                         </Grid.ColumnDefinitions>
-                                        <Line   Margin="0,0,0,0" Grid.ColumnSpan="6" Visibility="{Binding IsForward, Converter={StaticResource BoolToVisible}}" X1="0"  X2="{Binding ActualWidth, ElementName=ContentPanel}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" StrokeThickness="1" Stroke="{StaticResource color.sys.layout.accent}" />
+                                        <Line   Margin="0,0,0,0" Grid.ColumnSpan="10" Visibility="{Binding IsForward, Converter={StaticResource BoolToVisible}}" X1="0"  X2="{Binding ActualWidth, ElementName=ContentPanel}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" StrokeThickness="1" Stroke="{StaticResource color.sys.layout.accent}" />
 
-                                        <Line Margin="0,0,0,0" Grid.ColumnSpan="6" Visibility="{Binding IsBackwards, Converter={StaticResource BoolToVisible}}"  X1="0"  X2="{Binding ActualWidth, ElementName=ContentPanel}" HorizontalAlignment="Stretch" VerticalAlignment="Top" StrokeThickness="1" Stroke="{StaticResource color.sys.layout.accent}" />
+                                        <Line Margin="0,0,0,0" Grid.ColumnSpan="10" Visibility="{Binding IsBackwards, Converter={StaticResource BoolToVisible}}"  X1="0"  X2="{Binding ActualWidth, ElementName=ContentPanel}" HorizontalAlignment="Stretch" VerticalAlignment="Top" StrokeThickness="1" Stroke="{StaticResource color.sys.layout.accent}" />
 
-                                        <TextBlock Text="{Binding Converter={StaticResource IndexConverter}, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListViewItem}}}"
+                                        <TextBlock Text="{Binding ItemIndex}"
                                  VerticalAlignment="Center"  HorizontalAlignment="Center"/>
                                         <Image Margin="8" Grid.Column="1"  HorizontalAlignment="Stretch" VerticalAlignment="Center" Source="{Binding DocThumbnail}"  Stretch="Uniform"  />
                                         <StackPanel Grid.Column="3" HorizontalAlignment="Stretch" VerticalAlignment="Center">
@@ -212,7 +212,7 @@
                 </Grid.ColumnDefinitions>
                 <StackPanel Grid.Row="1" Grid.Column="1">
                     <TextBlock Text=" Page Size" VerticalAlignment="Center" FontSize="14" FontFamily="Segoe UI" FontWeight="Bold"/>
-                    <RadioButton Content="Original page size" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" Tag="0" Margin="0,14,0,0">
+                    <RadioButton IsChecked="True" Content="Original page size" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" Tag="0" Margin="0,14,0,0">
                         <i:Interaction.Triggers>
                             <i:EventTrigger EventName="Checked">
                                 <i:InvokeCommandAction Command="{Binding SetPageSizeTypeCommand}" CommandParameter="{Binding RelativeSource={RelativeSource AncestorType=RadioButton}}" PassEventArgsToCommand="True" />

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

@@ -108,7 +108,6 @@ namespace PDF_Office.Views.Dialog.ToolsDialogs
                 return;
             }
            (DataContext as MergeDialogViewModel).MoveMerge(targetNode, soureNode);
-
             HiddenaAllLine();
         }
 

+ 1 - 1
PDF Office/Views/HomeContent.xaml

@@ -81,7 +81,7 @@
                     Initialized="BtnCreatPDF_Initialized"
                     Style="{StaticResource btn.sec}">
                     <Button.ContextMenu>
-                        <ContextMenu Name="ContextCreatePDF">
+                        <ContextMenu Name="ContextCreatePDF" Closed="ContextCreatePDF_Closed">
                             <MenuItem Command="{Binding CreateBlackPDFCommand}" Header="New Blank Page" />
                             <MenuItem
                                 Command="{Binding CreateFromHtmlCommnd}"

+ 15 - 1
PDF Office/Views/HomeContent.xaml.cs

@@ -33,6 +33,8 @@ namespace PDF_Office.Views
     /// </summary>
     public partial class HomeContent : UserControl
     {
+
+        private bool IsContextMenuOpen = false;
        
         public HomeContent()
         {
@@ -68,7 +70,19 @@ namespace PDF_Office.Views
         {
             ContextCreatePDF.PlacementTarget = BtnCreatPDF;
             ContextCreatePDF.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
-            ContextCreatePDF.IsOpen = true;
+            IsContextMenuOpen = !IsContextMenuOpen;
+            ContextCreatePDF.IsOpen = IsContextMenuOpen;
+        }
+
+        private void ContextCreatePDF_Closed(object sender, RoutedEventArgs e)
+        {
+            var visual = VisualTreeHelper.HitTest(BtnExpand, Mouse.GetPosition(BtnExpand));
+            if (visual == null)
+            {
+                //点击其他地方引起的下拉框收取,猜需要更改按钮状态,
+                //如果是点击按钮造成的下拉框收起,则不需要更改按钮状态(如果改了,会出现每次缓慢点击按钮都展开下拉框的现象)
+                IsContextMenuOpen = false;
+            }
         }
     }
 }

+ 64 - 54
PDF Office/Views/HomePanel/PromotionContent.xaml

@@ -7,6 +7,7 @@
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     d:DesignHeight="450"
     d:DesignWidth="800"
+    Background="{StaticResource color.sys.layout.mg}"
     SizeChanged="UserControl_SizeChanged"
     mc:Ignorable="d">
     <UserControl.Resources>
@@ -17,8 +18,8 @@
             </ResourceDictionary.MergedDictionaries>
             <DataTemplate x:Key="PromotionDataTemplate">
                 <StackPanel
-                    Margin="0,10,0,10"
-                    Background="White"
+                    Height="32"
+                    Background="Transparent"
                     Cursor="Hand"
                     Orientation="Horizontal">
                     <Image
@@ -27,74 +28,83 @@
                         Margin="0,0,10,0"
                         Source="{Binding ImagePath}" />
                     <TextBlock
+                        VerticalAlignment="Center"
                         FontSize="14"
-                        Foreground="#6B6F7D"
+                        Foreground="{StaticResource color.sys.text.neutral.lv2}"
                         Text="{Binding Content}" />
                 </StackPanel>
             </DataTemplate>
         </ResourceDictionary>
     </UserControl.Resources>
     <ScrollViewer VerticalScrollBarVisibility="Auto">
-        <StackPanel Background="{StaticResource color.sys.layout.mg}">
-            <Expander
-                x:Name="PDFProSeriesExpander"
-                Margin="20,20,0,0"
-                Style="{StaticResource PromotionExpanderStyle}">
-                <Expander.Header>
-                    <Grid Name="GridHeader" HorizontalAlignment="Center">
-                        <TextBlock
-                            FontSize="12"
-                            Foreground="#8F96A7"
-                            Text="PDF Pro Series" />
-                    </Grid>
-                </Expander.Header>
-                <Border CornerRadius="4">
-                    <Grid Name="GroupPDFProSeries">
-                        <ListView
-                            x:Name="PDFProListview"
-                            MinWidth="0"
-                            HorizontalAlignment="Stretch"
-                            BorderThickness="0"
-                            ItemContainerStyle="{StaticResource EmptyListViewItem}"
-                            ItemTemplate="{StaticResource PromotionDataTemplate}" />
-                    </Grid>
-                </Border>
+        <Grid>
+            <StackPanel Margin="0,0,0,252">
+                <Expander
+                    x:Name="PDFProSeriesExpander"
+                    Margin="20,20,0,0"
+                    IsExpanded="True"
+                    Style="{StaticResource PromotionExpanderStyle}">
+                    <Expander.Header>
+                        <Grid
+                            Name="GridHeader"
+                            Height="32"
+                            HorizontalAlignment="Center">
+                            <TextBlock VerticalAlignment="Center" Text="PDF Pro Series" />
+                        </Grid>
+                    </Expander.Header>
+                    <Border CornerRadius="4">
+                        <Grid Name="GroupPDFProSeries">
+                            <ListView
+                                x:Name="PDFProListview"
+                                MinWidth="0"
+                                HorizontalAlignment="Stretch"
+                                Background="Transparent"
+                                BorderThickness="0"
+                                ItemContainerStyle="{StaticResource EmptyListViewItem}"
+                                ItemTemplate="{StaticResource PromotionDataTemplate}" />
+                        </Grid>
+                    </Border>
 
-            </Expander>
+                </Expander>
 
-            <Expander
-                x:Name="OthersExpander"
-                Margin="20,20,0,0"
-                Style="{StaticResource PromotionExpanderStyle}">
-                <Expander.Header>
-                    <Grid Name="GridHeaderOthers" HorizontalAlignment="Center">
-                        <TextBlock
-                            FontSize="12"
-                            Foreground="#8F96A7"
-                            Text="Others" />
-                    </Grid>
-                </Expander.Header>
-                <Border CornerRadius="4">
-                    <Grid Name="GridGroupOthers">
-                        <ListView
-                            x:Name="OthersListview"
-                            MinWidth="0"
-                            HorizontalAlignment="Stretch"
-                            BorderThickness="0"
-                            ItemContainerStyle="{StaticResource EmptyListViewItem}"
-                            ItemTemplate="{StaticResource PromotionDataTemplate}" />
-                    </Grid>
-                </Border>
+                <Expander
+                    x:Name="OthersExpander"
+                    Margin="20,8,0,0"
+                    IsExpanded="True"
+                    Style="{StaticResource PromotionExpanderStyle}">
+                    <Expander.Header>
+                        <Grid
+                            Name="GridHeaderOthers"
+                            Height="32"
+                            HorizontalAlignment="Center">
+                            <TextBlock VerticalAlignment="Center" Text="Others" />
+                        </Grid>
+                    </Expander.Header>
+                    <Border CornerRadius="4">
+                        <Grid Name="GridGroupOthers">
+                            <ListView
+                                x:Name="OthersListview"
+                                MinWidth="0"
+                                HorizontalAlignment="Stretch"
+                                Background="Transparent"
+                                BorderThickness="0"
+                                ItemContainerStyle="{StaticResource EmptyListViewItem}"
+                                ItemTemplate="{StaticResource PromotionDataTemplate}" />
+                        </Grid>
+                    </Border>
 
-            </Expander>
+                </Expander>
+
+            </StackPanel>
             <Rectangle
                 x:Name="promtionRect"
                 Width="216"
                 Height="216"
-                Margin="0,8,0,0"
+                Margin="0,23"
+                VerticalAlignment="Bottom"
                 Fill="#EBEBEB"
                 RadiusX="8"
                 RadiusY="8" />
-        </StackPanel>
+        </Grid>
     </ScrollViewer>
 </UserControl>

+ 14 - 12
PDF Office/Views/HomePanel/RecentFiles/DocItemControl.xaml

@@ -18,27 +18,29 @@
             <RowDefinition Height="auto" />
             <RowDefinition />
         </Grid.RowDefinitions>
-        <Border
-            Margin="51,16"
+        <Grid Height="165" Margin="51,16">
+            <Border
             BorderBrush="{StaticResource color.sys.layout.divider}"
             BorderThickness="1"
+                VerticalAlignment="Center"
+                HorizontalAlignment="Center"
             CornerRadius="{StaticResource border-radius.8}">
-            <Grid>
-                <Border
+                <Grid>
+                    <Border
                     Name="BorderImage"
-                    Height="164"
                     Background="White"
                     CornerRadius="{StaticResource border-radius.8}" />
-                <Image
+                    <Image
                     Name="CoverImage"
                     RenderOptions.BitmapScalingMode="HighQuality"
                     UseLayoutRounding="True">
-                    <Image.OpacityMask>
-                        <VisualBrush Visual="{Binding ElementName=BorderImage}" />
-                    </Image.OpacityMask>
-                </Image>
-            </Grid>
-        </Border>
+                        <Image.OpacityMask>
+                            <VisualBrush Visual="{Binding ElementName=BorderImage}" />
+                        </Image.OpacityMask>
+                    </Image>
+                </Grid>
+            </Border>
+        </Grid>
         <TextBlock
             Grid.Row="1"
             MaxWidth="226"

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

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

+ 10 - 5
PDF Office/Views/HomePanel/RecentFiles/DocItemListViewControl.xaml

@@ -50,12 +50,17 @@
                     <ColumnDefinition />
                 </Grid.ColumnDefinitions>
 
-                <Image
-                    x:Name="CoverImage"
+                <Border
                     Margin="10,0"
-                    HorizontalAlignment="Left"
-                    RenderOptions.BitmapScalingMode="HighQuality"
-                    UseLayoutRounding="True" />
+                    BorderBrush="{StaticResource color.item-state.sel.border.lv3}"
+                    BorderThickness="1">
+                    <Image
+                        x:Name="CoverImage"
+                        Width="40"
+                        Height="60"
+                        RenderOptions.BitmapScalingMode="HighQuality"
+                        UseLayoutRounding="True" />
+                </Border>
                 <StackPanel Grid.Column="1" Margin="8,8,0,8">
                     <TextBlock
                         x:Name="FileName"

+ 15 - 3
PDF Office/Views/HomePanel/RecentFiles/RecentFilesContent.xaml

@@ -9,6 +9,8 @@
     xmlns:local="clr-namespace:PDF_Office.Views.HomePanel.RecentFiles"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
+    xmlns:recentfiles="clr-namespace:PDF_Office.ViewModels.HomePanel.RecentFiles"
+    d:DataContext="{d:DesignInstance Type=recentfiles:RecentFilesContentViewModel}"
     d:DesignHeight="450"
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
@@ -201,15 +203,25 @@
                         Margin="16,0,0,0"
                         Padding="0,0,0,0"
                         Command="{Binding RemoveFilesFromContainerCommand}"
-                        CommandParameter="{Binding ElementName=RecentFilesList, Path=SelectedItems}"
                         Foreground="#6B6F7D"
-                        IsEnabled="{Binding IsEmpty, Converter={StaticResource InvertBoolConvert}, Mode=OneWay}"
-                        Style="{StaticResource btn.sec}">
+                        IsEnabled="{Binding IsEmpty, Converter={StaticResource InvertBoolConvert}, Mode=OneWay}">
                         <Path
                             Width="32"
                             Height="32"
                             Data="M14 9.75H18V8.25H14V9.75ZM9 12.25H10.25V23C10.25 23.4142 10.5858 23.75 11 23.75H21C21.4142 23.75 21.75 23.4142 21.75 23V12.25H23V10.75H9V12.25ZM11.75 22.25V12.25H20.25V22.25H11.75ZM15.25 14.5V19.5H16.75V14.5H15.25Z"
                             Fill="{Binding ElementName=BtnDelete, Path=Foreground}" />
+                        <Button.Style>
+                            <Style BasedOn="{StaticResource btn.sec}" TargetType="{x:Type Button}">
+                                <Style.Triggers>
+                                    <DataTrigger Binding="{Binding ElementName=RecentFilesList, Path=Visibility}" Value="Visible">
+                                        <Setter Property="CommandParameter" Value="{Binding ElementName=RecentFilesList, Path=SelectedItems}" />
+                                    </DataTrigger>
+                                    <DataTrigger Binding="{Binding ElementName=GridRecentFilesList, Path=Visibility}" Value="Visible">
+                                        <Setter Property="CommandParameter" Value="{Binding ElementName=GridRecentFilesList, Path=SelectedItems}" />
+                                    </DataTrigger>
+                                </Style.Triggers>
+                            </Style>
+                        </Button.Style>
                     </Button>
                 </StackPanel>
             </Grid>

+ 6 - 4
PDF Office/Views/MainContent.xaml

@@ -8,15 +8,17 @@
     xmlns:local="clr-namespace:PDF_Office.Views"
     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
     xmlns:prism="http://prismlibrary.com/"
+    xmlns:viewmodels="clr-namespace:PDF_Office.ViewModels"
+    d:DataContext="{d:DesignInstance Type=viewmodels:MainContentViewModel}"
     d:DesignHeight="450"
     d:DesignWidth="800"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
-    <!--<i:Interaction.Triggers>
-        <i:EventTrigger EventName="Loaded">
-            <prism:InvokeCommandAction Command="{Binding Loaded}" CommandParameter="{Binding}" />
+    <i:Interaction.Triggers>
+        <i:EventTrigger EventName="Unloaded">
+            <prism:InvokeCommandAction Command="{Binding UnLoaded}" />
         </i:EventTrigger>
-    </i:Interaction.Triggers>-->
+    </i:Interaction.Triggers>
     <Grid>
         <ContentControl Name="ContentMain" prism:RegionManager.RegionName="{Binding MainContentRegionName}" />
     </Grid>

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

@@ -169,6 +169,7 @@
                     </CompositeControl:SlidContent>
 
                     <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor" Margin="0,8,0,0"
+                                                   ItemSource="{Binding BasicVm.ColorItems}"
                                                    UIColor="{Binding BasicVm.CurrentFontColor,Mode=OneWay}"
                                                    >
                         <i:Interaction.Triggers>

+ 1 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/FreetextAnnotProperty.xaml

@@ -409,6 +409,7 @@
                     </i:Interaction.Triggers>
                 </CompositeControl:SlidContent>
                 <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor" Margin="0,8,0,0"
+                                               ItemSource="{Binding BasicVm.FillColorItems}"
                                                UIColor="{Binding BasicVm.CurrentFillColor,Mode=OneWay}">
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">

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

@@ -1,15 +0,0 @@
-<UserControl x:Class="PDF_Office.Views.PropertyPanel.AnnotPanel.MultiSelectAnnotProperty"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:prism="http://prismlibrary.com/"
-             xmlns:CompositeControl="clr-namespace:PDF_Office.CustomControl.CompositeControl"
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             xmlns:local="clr-namespace:PDF_Office.Views.PropertyPanel.AnnotPanel"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid>
-        <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"/>
-    </Grid>
-</UserControl>

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

@@ -1,28 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using System.Windows.Data;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Imaging;
-using System.Windows.Navigation;
-using System.Windows.Shapes;
-
-namespace PDF_Office.Views.PropertyPanel.AnnotPanel
-{
-    /// <summary>
-    /// MultiSelectAnnotProperty.xaml 的交互逻辑
-    /// </summary>
-    public partial class MultiSelectAnnotProperty : UserControl
-    {
-        public MultiSelectAnnotProperty()
-        {
-            InitializeComponent();
-        }
-    }
-}

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

@@ -218,6 +218,7 @@
                     </i:Interaction.Triggers>
                 </CompositeControl:SlidContent>
                 <CompositeControl:ColorContent x:Name="cusFillColor" Grid.Row="1" Margin="0,8,0,0"
+                                               ItemSource="{Binding BasicVm.FillColorItems}"
                                                UIColor="{Binding BasicVm.CurrentFillColor,Mode=OneWay}" >
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">
@@ -239,6 +240,7 @@
                                               />
 
                 <CompositeControl:ColorContent x:Name="cusColor" Grid.Row="1" Margin="0,8,0,0"
+                                               ItemSource="{Binding BasicVm.ColorItems}"
                                                UIColor="{Binding BasicVm.CurrentBorderColor,Mode=OneWay}" >
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">

+ 5 - 6
PDF Office/Views/PropertyPanel/AnnotPanel/SignatureAnnotProperty.xaml

@@ -4,7 +4,7 @@
              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"
              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" />
@@ -15,9 +15,8 @@
     </UserControl.Resources>
     <Grid  Background="Transparent">
         <Grid.RowDefinitions>
-            <RowDefinition Height="50"/>
+            <RowDefinition Height="50"/> 
             <RowDefinition Height="*"/>
-            <RowDefinition/>
         </Grid.RowDefinitions>
         <Grid.ColumnDefinitions>
             <ColumnDefinition Width="16"/>
@@ -49,14 +48,14 @@
         </Grid>
         <Grid Grid.Row="1" Grid.Column="1">
             <StackPanel VerticalAlignment="Center" x:Name="NoSignatureStackPanel" Visibility="{Binding SignatureList.Count, Converter={StaticResource ListCountToVisible}}">
-                <Image Source="pack://application:,,,/PDF Office;component/Resources/PropertyPanel/nosign.png" />
+                <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"/>
             </StackPanel>
             <ListBox ItemsSource="{Binding SignatureList}"  
                      SelectedIndex="{Binding CurrentListboxIndex,Mode=TwoWay}"
                      Visibility="{Binding ElementName=NoSignatureStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"
-                     SelectionMode="Single" Height="auto" VerticalAlignment="Top"  BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
+                     SelectionMode="Single" Height="auto" VerticalAlignment="Stretch"  BorderThickness="0" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
                 <ListBox.ItemTemplate>
                     <DataTemplate >
                         <Grid>
@@ -116,7 +115,7 @@
                                 </ControlTemplate>
                             </Setter.Value>
                         </Setter>
-                        <EventSetter Event="PreviewMouseLeftButtonDown" Handler="ListBoxItem_PreviewMouseLeftButtonDown"/>
+                        <EventSetter Event="PreviewMouseDown" Handler="ListBoxItem_PreviewMouseDown"/>
                     </Style>
                 </ListBox.ItemContainerStyle>
             </ListBox>

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

@@ -28,7 +28,7 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             InitializeComponent();
         }
 
-        private void ListBoxItem_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        private void ListBoxItem_PreviewMouseDown(object sender, MouseButtonEventArgs e)
         {
             (DataContext as SignatureAnnotPropertyViewModel).SetSignature((sender as ListBoxItem).DataContext as Signature);
         }
@@ -54,5 +54,14 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
                 (DataContext as SignatureAnnotPropertyViewModel).DeleteAll();
             }
         }
+
+        private void UserControl_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Escape)
+            {
+                (DataContext as SignatureAnnotPropertyViewModel).Close();
+                e.Handled = true;
+            }
+        }
     }
 }

+ 25 - 6
PDF Office/Views/PropertyPanel/AnnotPanel/SignatureCreateDialog.xaml

@@ -19,9 +19,11 @@
         </Style>
         <dataconvert:UnVisivleConvert x:Key="UnVisivleConvert"/>
         <dataconvert:IntAndTagToBoolMultiBinding x:Key="IntAndTagToBoolMultiBinding"/>
+        <dataconvert:ListCountAndBoolToVisible x:Key="ListCountAndBoolToVisible"/>
         <dataconvert:IntToColorBrush x:Key="IntToColorBrush"/>
         <dataconvert:ListCountToVisible x:Key="ListCountToVisible"/>
         <dataconvert:CenterToolTipConverter x:Key="CenterToolTipConverter"/>
+        <dataconvert:SignatureButtonConvert x:Key="SignatureButtonConvert"/>
 
         <Style x:Key="TriangleToolTipStyle" TargetType="ToolTip">
             <Setter Property="Template">
@@ -58,10 +60,12 @@
                         <cus:TextBoxEx 
                             FontFamily="{Binding ElementName=TextComBox,Path=SelectedValue, TargetNullValue=Segoe UI}" 
                             Background="{StaticResource color.sys.layout.mg}" Grid.Column="1" 
+                            TextChanged="TextBoxEx_TextChanged"
                             PlaceholderText="Input"  Height="182" FontSize="20"
                             HorizontalContentAlignment="Center" VerticalContentAlignment="Center"  
-                            ShowClose="False" Text="{Binding InputText,Mode=TwoWay}"
+                            ShowClose="False" Text="{Binding InputText,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
                             Foreground ="{Binding RadioButtonIndex,Converter={StaticResource IntToColorBrush}}"  />
+                        <Button Margin="0,0,8,24" Visibility="{Binding ShowTextButton}" Content="Clear"  Style="{StaticResource btn.sec}" Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="24" Width="43" Command="{Binding ClearTextCommnad}" />
                         <ComboBox Grid.Row="1" Grid.Column="1" x:Name="TextComBox"
                         Width="200"
                         HorizontalAlignment="Left"
@@ -166,9 +170,15 @@
                         </Grid.ColumnDefinitions>
                         <Border Grid.Column="1"  Height="182" BorderThickness="1" CornerRadius="4" BorderBrush="{StaticResource color.field.border.norm}">
                             <Grid>
-                                <InkCanvas x:Name="inkCanvas"   DefaultDrawingAttributes="{Binding DrawingAttributeObject}" Strokes="{Binding StrokesObject}"/>
+                                <InkCanvas x:Name="inkCanvas" PreviewMouseLeftButtonDown="inkCanvas_MouseLeftButtonDown"  PreviewMouseLeftButtonUp="inkCanvas_MouseLeftButtonUp"  DefaultDrawingAttributes="{Binding DrawingAttributeObject}" Strokes="{Binding StrokesObject}"/>
 
-                                <Grid Opacity="0.7" x:Name="PlanGrid"   IsHitTestVisible="False" Background="#F3F3F3" Visibility="{Binding StrokesObject.Count,Converter={StaticResource ListCountToVisible}}">
+                                <Grid Opacity="0.7" x:Name="PlanGrid"   IsHitTestVisible="False" Background="#F3F3F3">
+                                    <Grid.Visibility>
+                                        <MultiBinding Converter="{StaticResource ListCountAndBoolToVisible }" Mode="OneWay">
+                                            <Binding Path="StrokesObject.Count"/>
+                                            <Binding Path="IsMouseDown"/>
+                                        </MultiBinding>
+                                    </Grid.Visibility>
                                     <TextBlock Text="此处绘制签名" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                                 </Grid>
                                 <Button Style="{StaticResource btn.sec}" Margin="0,0,8,8" Width="43" Height="24" HorizontalAlignment="Right" VerticalAlignment="Bottom" Content="Clear" Command="{Binding ClearInkCanvasCommnad}" Visibility="{Binding ElementName=PlanGrid,Path=Visibility,Converter={StaticResource UnVisivleConvert}}"/>
@@ -277,7 +287,7 @@
                             <ColumnDefinition Width="16"/>
                         </Grid.ColumnDefinitions>
                         <Border Grid.Column="1"  Height="182" BorderThickness="1" CornerRadius="4" BorderBrush="{StaticResource color.field.border.norm}">
-                            <Grid>
+                            <Grid Background="{StaticResource color.sys.layout.mg}">
                                 <StackPanel  x:Name="AddStackPanel"  HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="{Binding ShowImageButton}">
                                     <cus:ImageButton
                                 Height="128" Width="128" IconHeight="128" IconWidth="128"  
@@ -285,7 +295,7 @@
                                 IconPress="pack://application:,,,/PDF Office;component/Resources/Dialog/AddImageSuspend.png"  
                                 IconMouseOver="pack://application:,,,/PDF Office;component/Resources/Dialog/AddImageSuspend.png"   
                                 Command="{Binding OpenImageCommnad}"/>
-                                    <TextBlock Text="Select image file" FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center"/>
+                                    <TextBlock Text="Select image file" FontWeight="Regular" FontSize="14" FontFamily="Segoe UI" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{StaticResource color.sys.text.neutral.lv3}"/>
                                 </StackPanel>
                                 <Grid Visibility="{Binding ElementName=AddStackPanel,Path=Visibility,Converter={StaticResource UnVisivleConvert}}">
                                     <Grid.RowDefinitions>
@@ -331,7 +341,16 @@
                     Height="32"
                     HorizontalAlignment="Right"
                     Command="{Binding CreateCommnad}"
-                    Content="确定" />
+                    Content="确定" >
+                    <Button.IsEnabled>
+                        <MultiBinding Converter="{StaticResource SignatureButtonConvert }" Mode="OneWay">
+                            <Binding Path="TabItemIndex"/>
+                            <Binding Path="InputText"/>
+                            <Binding Path="StrokesObject.Count"/>
+                            <Binding Path="ImagePreviewSource"/>
+                        </MultiBinding>
+                    </Button.IsEnabled>
+                </Button>
                 <Button
                     Style="{StaticResource btn.sec}"
                     Grid.Column="2"

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

@@ -1,4 +1,5 @@
-using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
+using PDF_Office.CustomControl;
+using PDF_Office.ViewModels.PropertyPanel.AnnotPanel;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -35,5 +36,30 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
         {
             (DataContext as SignatureCreateDialogViewModel).UpDataImageRadioButtonIndex(Convert.ToInt32((sender as RadioButton).Tag));
         }
+
+        private void TextBoxEx_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            if (sender is TextBoxEx)
+            {
+                if (string.IsNullOrEmpty((sender as TextBoxEx).Text))
+                {
+                    (DataContext as SignatureCreateDialogViewModel).ShowTextButton = Visibility.Collapsed;
+                }
+                else
+                {
+                    (DataContext as SignatureCreateDialogViewModel).ShowTextButton = Visibility.Visible;
+                }
+            }
+        }
+
+        private void inkCanvas_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
+        {
+            (DataContext as SignatureCreateDialogViewModel).IsMouseDown = true;
+        }
+
+        private void inkCanvas_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
+        {
+            (DataContext as SignatureCreateDialogViewModel).IsMouseDown = false;
+        }
     }
 }

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

@@ -89,8 +89,8 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             if (e.Key == Key.Escape)
             {
                 (DataContext as StampAnnotPropertyViewModel).Close();
+                e.Handled = true;
             }
-            e.Handled = true;
         }
     }
 }

+ 36 - 8
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml

@@ -9,15 +9,43 @@
              d:DesignHeight="450" d:DesignWidth="800">
     <annotview:StickyPopupExt.Resources>
         <DataTemplate x:Key="listboxData">
-            <Ellipse
+            <Ellipse Stroke="{StaticResource color.sys.layout.divider}"
+                     StrokeThickness="1"
                     Width="20"
                     Height="20"
                     Fill="{Binding Color}" />
         </DataTemplate>
+
         <Style x:Key="listboxItemStyle" TargetType="{x:Type ListBoxItem}">
             <Setter Property="HorizontalContentAlignment" Value="Center" />
-            <Setter Property="Height" Value="32" />
+            <Setter Property="Height" Value="32"/>
+            <Setter Property="Width" Value="32"/>
             <Setter Property="Margin" Value="2,0,2,0" />
+            <Setter Property="Template">
+                <Setter.Value>
+                    <ControlTemplate TargetType="{x:Type ContentControl}">
+                        <Border CornerRadius="4"
+                                x:Name="border"
+                                Padding="0,0"
+                                Background="{TemplateBinding Background}">
+                            <ContentPresenter />
+                        </Border>
+                    </ControlTemplate>
+                </Setter.Value>
+            </Setter>
+
+            <Style.Triggers>
+                <Trigger Property="IsMouseOver" Value="True">
+                    <Setter Property="Background" Value="#e2e3e5" />
+                </Trigger>
+                <Trigger Property="IsMouseOver" Value="False">
+                    <Setter Property="Background" Value="Transparent" />
+                </Trigger>
+                <Trigger Property="IsSelected" Value="True">
+                    <Setter Property="Background" Value="#e2e3e5" />
+                </Trigger>
+            </Style.Triggers>
+
         </Style>
     </annotview:StickyPopupExt.Resources>
     <Grid MouseLeftButtonDown="Grid_MouseLeftButtonDown">
@@ -25,14 +53,14 @@
             <Border.Effect>
                 <DropShadowEffect BlurRadius="8" Direction="0" Opacity="0.16" ShadowDepth="0" Color="#000000" />
             </Border.Effect>
-            <Grid MinWidth="240" MinHeight="200" Background="White" Name="GridUi" Width="240" Height="200">
+            <Grid MinWidth="240" MinHeight="200" Background="Transparent" Name="GridUi" Width="240" Height="200">
                 <Grid.RowDefinitions>
-                    <RowDefinition Height="auto"></RowDefinition>
+                    <RowDefinition Height="32"></RowDefinition>
                     <RowDefinition Height="auto"></RowDefinition>
                     <RowDefinition Height="*"></RowDefinition>
                     <RowDefinition Height="auto"></RowDefinition>
                 </Grid.RowDefinitions>
-                <Grid>
+                <Grid Margin="8,0,8,0">
                     <Grid.ColumnDefinitions>
                         <ColumnDefinition Width="auto"></ColumnDefinition>
                         <ColumnDefinition Width="auto"></ColumnDefinition>
@@ -42,7 +70,7 @@
                     </Grid.ColumnDefinitions>
                     <TextBlock x:Name="AuthorText" Grid.Column="1" FontFamily="SegoeUI" FontSize="12" VerticalAlignment="Center" LineHeight="16" Margin="2,2,0,0"/>
                     <TextBlock Name="DateText" Grid.Column="3" Foreground="{StaticResource color.sys.text.neutral.lv2}" VerticalAlignment="Center"  Margin="0,-2,0,0" FontFamily="SegoeUI" FontSize="12" LineHeight="16"></TextBlock>
-                    <Border Grid.Column="4"  MouseUp="CloseText_MouseUp" Background="#01000000" Margin="0,-8,-3,0">
+                    <Border Grid.Column="4" Visibility="Collapsed" MouseUp="CloseText_MouseUp" Background="#01000000" Margin="0,-8,-3,0">
                         <Path Fill="#000000" Width="16" Height="16" >
                             <Path.Data>
                                 M9.48528137,2.98528137 L9.48428137,8.48428137 L14.9852814,8.48528137 L14.9852814,9.48528137 L9.48428137,9.48428137 L9.48528137,14.9852814 L8.48528137,14.9852814 L8.48428137,9.48428137 L2.98528137,9.48528137 L2.98528137,8.48528137 L8.48428137,8.48428137 L8.48528137,2.98528137 L9.48528137,2.98528137 Z
@@ -53,8 +81,8 @@
                         </Path>
                     </Border>
                 </Grid>
-              
-                <TextBox  Name="ContentText" Grid.Row="2" Margin="4,0,4,0" Background="#CCFFFFFF" BorderThickness="0" 
+                <Rectangle Margin="8,0,8,0" VerticalAlignment="Bottom" Height="1" Fill="{StaticResource color.sys.layout.divider}"/>
+                <TextBox  x:Name="ContentText" Grid.Row="2" Padding="2,4,0,0"  Margin="4,0,4,0" Background="#CCFFFFFF" BorderThickness="0" 
                      AcceptsReturn="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"></TextBox>
 
                 <Grid Grid.Row="3">

+ 78 - 9
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNotePopup.xaml.cs

@@ -1,4 +1,6 @@
 using ComPDFKitViewer;
+using ComPDFKitViewer.AnnotEvent;
+using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl.CompositeControl;
 using System;
 using System.Collections.Generic;
@@ -73,6 +75,22 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             Color bkColor = (border.BorderBrush as SolidColorBrush).Color;
             bkColor.A = saveOpacity;
             border.BorderBrush = new SolidColorBrush(bkColor);
+            this.Background = new SolidColorBrush(Colors.Transparent);
+            this.BorderBrush = new SolidColorBrush(Colors.Transparent);
+
+            //为了点击某控件之后就直接关闭窗口
+            var ui = Mouse.DirectlyOver as FrameworkElement;
+            if (ui != null)
+            {
+
+                var colorItem = ui.DataContext as ColorItem;
+                if (colorItem != null)
+                {
+                    e.Handled = false;
+                    return;
+                }
+            }
+
             CloseText_MouseUp(this, null);
         }
 
@@ -82,13 +100,43 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             saveOpacity = bkColor.A;
             bkColor.A = 255;
             border.BorderBrush = new SolidColorBrush(bkColor);
-            this.Background = new SolidColorBrush(this.StickyColor);
+            this.Background = new SolidColorBrush(Colors.Transparent);
+            this.BorderBrush = new SolidColorBrush(Colors.Transparent);
         }
 
         private void StickyPopupControl_Loaded(object sender, RoutedEventArgs e)
         {
             ContentText.Focus();
             ContentText.CaretIndex = ContentText.Text.Length;
+            LoadedColor();
+        }
+
+        public void LoadedColor()
+        {
+            if (colors != null && colors.Count > 0)
+            {
+                BtnDelete.DataContext = colors[0];//为了避免点击删除按钮之后,先执行取消焦点函数后,就没法执行点击事件
+
+                if (GetCurrentAnnot != null)
+                {
+                    foreach (var item in colors)
+                    {
+                        var colorItem = (item.Color as SolidColorBrush).Color;
+                        if (colorItem.A == GetCurrentAnnot.Color.A &&
+                            colorItem.R == GetCurrentAnnot.Color.R &&
+                            colorItem.G == GetCurrentAnnot.Color.G &&
+                            colorItem.B == GetCurrentAnnot.Color.B
+                            )
+                        {
+                            ListColor.SelectedItem = item;
+                            return;
+                        }
+                    }
+
+                }
+
+                ListColor.SelectedItem = null;
+            }
         }
 
         private void StickyPopupControl_MouseDown(object sender, MouseButtonEventArgs e)
@@ -139,6 +187,8 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             }
         }
 
+        public StickyAnnotArgs GetCurrentAnnot { get; set; }
+        public CPDFViewer GetPDFViewer { get; set; }
         public bool CanMove { get; set; } = true;
         private void ResizeGrip_MouseMove(object sender, MouseEventArgs e)
         {
@@ -272,6 +322,8 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
         {
             base.SetStickyColor(newColor);
             border.BorderBrush = new SolidColorBrush(newColor);
+            this.Background = new SolidColorBrush(Colors.Transparent);
+            this.BorderBrush = new SolidColorBrush(Colors.Transparent);
         }
 
         public override void SetStickyNote(string note)
@@ -291,22 +343,39 @@ namespace PDF_Office.Views.PropertyPanel.AnnotPanel
             return StickyText;
         }
 
+
         private void ListColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
         {
-            var color = ListColor.SelectedItem as ColorItem;
-            if (color != null)
+            var colorItem = ListColor.SelectedItem as ColorItem;
+            if (colorItem != null)
             {
-                this.SetStickyColor((color.Color as SolidColorBrush).Color);
-                border.BorderBrush = new SolidColorBrush((color.Color as SolidColorBrush).Color);
-                this.Background = new SolidColorBrush((color.Color as SolidColorBrush).Color);
+                var color = (colorItem.Color as SolidColorBrush).Color;
+                this.SetStickyColor(color);
+                var annot = GetCurrentAnnot as StickyAnnotArgs;
+                if (annot != null)
+                {
+                    annot.Color = color;
+                    var AnnotEvent = AnnotAttribEvent.GetAnnotAttribEvent(annot, annot.GetAnnotAttrib());
+                    AnnotEvent?.UpdateAttrib(AnnotAttrib.Color, color);
+                    AnnotEvent?.UpdateAnnot();
+                }
+                border.BorderBrush = new SolidColorBrush(color);
+                this.Background = new SolidColorBrush(Colors.Transparent);
+                this.BorderBrush = new SolidColorBrush(Colors.Transparent);
             }
         }
 
         private void BtnDelete_Click(object sender, RoutedEventArgs e)
         {
-            ContentText.Text = "";
-            this.SetStickyNote("");
-            Closed.Invoke(sender, EventArgs.Empty);
+            if (GetPDFViewer != null)
+            {
+                if (GetCurrentAnnot != null)
+                    GetPDFViewer.RemovePageAnnot(GetCurrentAnnot.PageIndex, GetCurrentAnnot.AnnotIndex);
+
+                // Closed.Invoke(sender, EventArgs.Empty);
+                CloseText_MouseUp(this, null);
+            }
+
         }
 
         private void Grid_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)

+ 3 - 1
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNoteProperty.xaml

@@ -53,7 +53,9 @@
                         </i:EventTrigger>
                     </i:Interaction.Triggers>
                 </CompositeControl:SlidContent>
-                <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor"  UIColor="{Binding SharpCurrentColor,Mode=OneWay}" >
+                <CompositeControl:ColorContent Grid.Row="1" x:Name="cusColor" 
+                                               ItemSource="{Binding ColorItems}"
+                                               UIColor="{Binding SharpCurrentColor,Mode=OneWay}" >
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">
                             <i:InvokeCommandAction Command="{Binding SelectedColorChangedCommand}" CommandParameter="{Binding ElementName=cusColor,Path=SelectedColor}"/>

+ 1 - 0
PDF Office/Views/PropertyPanel/AnnotPanel/TextAnnotProperty.xaml

@@ -76,6 +76,7 @@
                 <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}"
                                                UIColor="{Binding BasicVm.CurrentFontColor,Mode=OneWay}" >
                     <i:Interaction.Triggers>
                         <i:EventTrigger EventName="SelectedColorInvoke">

Fichier diff supprimé car celui-ci est trop grand
+ 108 - 13
PDF Office/Views/Tools/AnnotToolContent.xaml


+ 19 - 6
PDF Office/Views/ViewContent.xaml

@@ -27,7 +27,7 @@
             <ResourceDictionary.MergedDictionaries>
                 <ResourceDictionary Source="pack://application:,,,/Styles/ButtonStyle.xaml" />
             </ResourceDictionary.MergedDictionaries>
-
+            <convert:InvertBoolConvert x:Key="UnBoolConvert" />
             <Style x:Key="MenuButtonStyle" TargetType="{x:Type Button}">
                 <Setter Property="Width" Value="20" />
                 <Setter Property="Height" Value="20" />
@@ -61,7 +61,7 @@
                     <Button.ContextMenu>
                         <ContextMenu Name="FileMenu">
                             <MenuItem
-                                Command="{Binding mainViewModel.homeContentViewModel.OpenFileCommand}"
+                                Command="{Binding OpenFileCommand}"
                                 Header="Open Files"
                                 InputGestureText="Ctrl+O" />
                             <MenuItem
@@ -69,12 +69,15 @@
                                 Header="Open Recent"
                                 Loaded="MenuRecent_Loaded">
                                 <Separator Name="Menu_Separator" Style="{StaticResource HorizontalSeparatorStyle}" />
-                                <MenuItem Name="MenuDeleteAll" Header="Delete All" Click="MenuDeleteAll_Click" />
+                                <MenuItem
+                                    Name="MenuDeleteAll"
+                                    Click="MenuDeleteAll_Click"
+                                    Header="Delete All" />
                             </MenuItem>
                             <Separator Margin="8,0" Style="{StaticResource HorizontalSeparatorStyle}" />
                             <MenuItem Header="Create Files">
                                 <MenuItem Command="{Binding mainViewModel.homeContentViewModel.CreateBlackPDFCommand}" Header="Create Blank" />
-                                <MenuItem Command="{Binding mainViewModel.homeContentViewModel.CreateFromHtmlCommnd}" Header="Create Form Html" />
+                                <MenuItem Command="{Binding mainViewModel.homeContentViewModel.CreateFromScanner}" Header="Create Form Scanner" />
                             </MenuItem>
                             <MenuItem
                                 Command="{Binding mainViewModel.mainWindowViewModel.AddTab}"
@@ -152,7 +155,16 @@
                                 Command="{Binding SettingsCommand}"
                                 Header="Settings"
                                 InputGestureText="Ctrl+P" />
-                            <MenuItem Header="Help" />
+                            <MenuItem Header="Help">
+                                <MenuItem Header="快速教学" />
+                                <MenuItem Header="在线帮助" />
+                                <MenuItem Header="更多产品" />
+                                <MenuItem Header="免费PDF模板" />
+                                <MenuItem Header="订阅电子报" />
+                                <MenuItem Header="Powered by ComPDFKit" />
+                                <Separator Style="{StaticResource HorizontalSeparatorStyle}"/>
+                                <MenuItem Header="意见反馈" />
+                            </MenuItem>
                         </ContextMenu>
                     </Button.ContextMenu>
                 </Button>
@@ -230,13 +242,14 @@
                     Height="28"
                     BorderThickness="0"
                     IsChecked="{Binding IsPropertyOpen}"
+                    IsEnabled="{Binding isInPageEdit, Converter={StaticResource UnBoolConvert}}"
                     Style="{StaticResource SubToolbarTgb}"
                     ToolTip="Property">
                     <Path
                         Width="20"
                         Height="20"
                         Data="M2 4V7H18V4H2ZM2 16V9H13V16H2ZM15 16H18V9H15V16ZM1.72101 2C0.770524 2 0 2.77052 0 3.72101V16.279C0 17.2295 0.770524 18 1.72101 18H18.279C19.2295 18 20 17.2295 20 16.279V3.72101C20 2.77052 19.2295 2 18.279 2H1.72101Z"
-                        Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
+                        Fill="{Binding ElementName=TbtnProperty, Path=Foreground}" />
                 </ToggleButton>
             </StackPanel>
             <TabControl