liuaoran 2 years ago
parent
commit
a9a6763a92
100 changed files with 4038 additions and 1396 deletions
  1. 188 176
      PDF Office/App.xaml.cs
  2. 32 0
      PDF Office/CustomControl/CommonWritableComboBox.xaml
  3. 148 0
      PDF Office/CustomControl/CommonWritableComboBox.xaml.cs
  4. 67 26
      PDF Office/CustomControl/NumericUpDown.xaml
  5. 124 33
      PDF Office/CustomControl/NumericUpDown.xaml.cs
  6. 16 11
      PDF Office/CustomControl/PageTurningPreview.xaml.cs
  7. 1 1
      PDF Office/CustomControl/WritableComboBox.xaml
  8. 53 33
      PDF Office/CustomControl/WritableComboBox.xaml.cs
  9. 4 0
      PDF Office/EventAggregators/EditToolsEvent.cs
  10. 1 0
      PDF Office/Model/Dialog/ConverterDialogs/ConverterDialogsModel.cs
  11. 2 2
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogModel.cs
  12. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVModel.cs
  13. 45 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogModel.cs
  14. 22 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelModel.cs
  15. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterHTMLModel.cs
  16. 15 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgModel.cs
  17. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterPPTModel.cs
  18. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterRTFModel.cs
  19. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterTextModel.cs
  20. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordModel.cs
  21. 112 8
      PDF Office/PDF Office.csproj
  22. 94 8
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs
  23. 92 10
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs
  24. 87 3
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs
  25. 176 4
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs
  26. 88 3
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs
  27. 14 6
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs
  28. 88 4
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs
  29. 91 5
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs
  30. 91 7
      PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs
  31. 11 3
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs
  32. 12 6
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogViewModel.cs
  33. 63 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVViewModel.cs
  34. 467 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs
  35. 73 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelViewModel.cs
  36. 67 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgViewModel.cs
  37. 56 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordViewModel.cs
  38. 83 77
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogViewModel.cs
  39. 67 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageExtractDialogViewModel.cs
  40. 5 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs
  41. 99 30
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageSplitDialogViewModel.cs
  42. 0 16
      PDF Office/ViewModels/EditTools/Background/BackgroundBarContentViewModel.cs
  43. 2 2
      PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs
  44. 0 16
      PDF Office/ViewModels/EditTools/Background/BackgroundTemplateContentViewModel.cs
  45. 28 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkContentViewModel.cs
  46. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateBaseContentViewModel.cs
  47. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs
  48. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs
  49. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListBaseContentViewModel.cs
  50. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListFileContentViewModel.cs
  51. 16 0
      PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListTextContentViewModel.cs
  52. 10 1
      PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs
  53. 11 4
      PDF Office/ViewModels/Tools/ToolsBarContentViewModel.cs
  54. 47 11
      PDF Office/ViewModels/ViewContentViewModel.cs
  55. 62 31
      PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml
  56. 0 64
      PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml.cs
  57. 10 1
      PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml
  58. 0 67
      PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml.cs
  59. 9 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml
  60. 0 67
      PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml.cs
  61. 74 30
      PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml
  62. 0 125
      PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml.cs
  63. 9 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml
  64. 0 67
      PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml.cs
  65. 9 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml
  66. 0 65
      PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml.cs
  67. 9 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterTextDialog.xaml
  68. 0 67
      PDF Office/Views/Dialog/ConverterDialogs/ConverterTextDialog.xaml.cs
  69. 9 0
      PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml
  70. 0 67
      PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml.cs
  71. 16 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSV.xaml
  72. 15 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSV.xaml.cs
  73. 136 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml
  74. 66 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml.cs
  75. 27 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcel.xaml
  76. 36 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcel.xaml.cs
  77. 13 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImg.xaml
  78. 79 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImg.xaml.cs
  79. 19 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWord.xaml
  80. 15 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWord.xaml.cs
  81. 11 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageExtractDialog.xaml
  82. 0 60
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageExtractDialog.xaml.cs
  83. 1 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageInsertDialog.xaml
  84. 11 1
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageSplitDialog.xaml
  85. 0 60
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageSplitDialog.xaml.cs
  86. 0 56
      PDF Office/Views/EditTools/Background/BackgroundBarContent.xaml
  87. 0 15
      PDF Office/Views/EditTools/Background/BackgroundBarContent.xaml.cs
  88. 4 0
      PDF Office/Views/EditTools/Background/BackgroundContent.xaml
  89. 0 31
      PDF Office/Views/EditTools/Background/BackgroundTemplateContent.xaml
  90. 0 15
      PDF Office/Views/EditTools/Background/BackgroundTemplateContent.xaml.cs
  91. 95 0
      PDF Office/Views/EditTools/Watermark/WatermarkContent.xaml
  92. 15 0
      PDF Office/Views/EditTools/Watermark/WatermarkContent.xaml.cs
  93. 53 0
      PDF Office/Views/EditTools/Watermark/WatermarkCreateBaseContent.xaml
  94. 15 0
      PDF Office/Views/EditTools/Watermark/WatermarkCreateBaseContent.xaml.cs
  95. 108 0
      PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml
  96. 15 0
      PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml.cs
  97. 117 0
      PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml
  98. 15 0
      PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml.cs
  99. 45 0
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListBaseContent.xaml
  100. 0 0
      PDF Office/Views/EditTools/Watermark/WatermarkTemplateListBaseContent.xaml.cs

+ 188 - 176
PDF Office/App.xaml.cs

@@ -1,108 +1,111 @@
-using System;
-using System.Collections.Generic;
-using System.Configuration;
-using System.Data;
-using System.IO;
-using System.Linq;
-using System.Threading.Tasks;
-using System.Windows;
-using System.Windows.Controls;
-using ComPDFKit.NativeMethod;
-using ComPDFKit_Conversion.Converter;
-using PDF_Office.CustomControl;
-using PDF_Office.CustomControl.SystemControl;
-using PDF_Office.ViewModels;
-using PDF_Office.Views;
-using PDF_Office.Views.BOTA;
-using PDF_Office.Views.Dialog;
-using PDF_Office.Views.HomePanel;
-using Prism.DryIoc;
-using Prism.Ioc;
-using Prism.Regions;
-using PDF_Office.Model;
-using PDF_Office.Views.PageEdit;
-using PDF_Office.Properties;
-using PDFSettings.Settings;
-using PDF_Office.Views.Tools; 
-using PDF_Office.Views.Dialog.ToolsDialogs.SaftyDialogs;
-using PDF_Office.Views.Dialog.ToolsDialogs.CompressDialogs;
-using PDF_Office.Views.Dialog.PageEditDialogs;
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.IO;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using ComPDFKit.NativeMethod;
+using ComPDFKit_Conversion.Converter;
+using PDF_Office.CustomControl;
+using PDF_Office.CustomControl.SystemControl;
+using PDF_Office.ViewModels;
+using PDF_Office.Views;
+using PDF_Office.Views.BOTA;
+using PDF_Office.Views.Dialog;
+using PDF_Office.Views.HomePanel;
+using Prism.DryIoc;
+using Prism.Ioc;
+using Prism.Regions;
+using PDF_Office.Model;
+using PDF_Office.Views.PageEdit;
+using PDF_Office.Properties;
+using PDFSettings.Settings;
+using PDF_Office.Views.Tools; 
+using PDF_Office.Views.Dialog.ToolsDialogs.SaftyDialogs;
+using PDF_Office.Views.Dialog.ToolsDialogs.CompressDialogs;
+using PDF_Office.Views.Dialog.PageEditDialogs;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs ;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 using PDF_Office.Views.Dialog.ConverterDialogs;
 using PDF_Office.Helper;
+using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
+using PDF_Office.Views.EditTools.Watermark;
+using PDF_Office.Views.EditTools.Background;
 
-namespace PDF_Office
-{
-    /// <summary>
-    /// App.xaml 的交互逻辑
-    /// </summary>
-    public partial class App : PrismApplication
-    {
-        public static string CurrentPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "PDF Office");
-
-        public static MainWindowViewModel mainWindowViewModel;
-
-        public static List<string> OpenedFileList = new List<string>();
-
-        public static bool IsFirstOpen = true;
-
-        public App()
-        {
-
-#if !DEBUG
-            //接入Appcenter后台数据检测
-            string appkey = "b099dccc-1ca5-4ea1-a2fa-afd4a6e1f8bb"
-            AppCenter.Start(appkey, typeof(Analytics), typeof(Crashes));
-            var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
-            AppCenter.SetCountryCode(countryCode);
-#endif
-            LicenseVerify();
-
-
-            if (Settings.Default.RecentOpenFiles == null)
-                Settings.Default.RecentOpenFiles = new RecentOpenFiles();
-
-            try
-            {
-                DirectoryInfo info = new DirectoryInfo(CurrentPath);
-                if (File.Exists(CurrentPath))
-                    File.Delete(CurrentPath);
-                if (!info.Exists)
-                {
-                    info.Create();
-                }
-            }
-            catch (Exception ex)
-            {
-
-            }
-        }
-
-        /// <summary>
-        /// 创建启动窗口
-        /// </summary>
-        /// <returns></returns>
-        protected override Window CreateShell()
-        {
- 
-            return Container.Resolve<MainWindow>();
-        }
-
-
-        protected override void RegisterTypes(IContainerRegistry containerRegistry)
-        {
-            //注册内容组件
-            containerRegistry.RegisterForNavigation<HomeContent>();
-            containerRegistry.RegisterForNavigation<ViewContent>();
-            containerRegistry.RegisterForNavigation<MainContent>();
-            containerRegistry.RegisterForNavigation<HomeCloudContent>("Cloud");
-            containerRegistry.RegisterForNavigation<HomeToolsContent>("Tools");
-            containerRegistry.RegisterForNavigation<HomeGuidContent>("Guid");
-            containerRegistry.RegisterForNavigation<BOTAContent>();
-            containerRegistry.RegisterForNavigation<PageEditContent>();
-            containerRegistry.RegisterForNavigation<ToolsBarContent>();
+namespace PDF_Office
+{
+    /// <summary>
+    /// App.xaml 的交互逻辑
+    /// </summary>
+    public partial class App : PrismApplication
+    {
+        public static string CurrentPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), "PDF Office");
+
+        public static MainWindowViewModel mainWindowViewModel;
+
+        public static List<string> OpenedFileList = new List<string>();
+
+        public static bool IsFirstOpen = true;
+
+        public App()
+        {
+
+#if !DEBUG
+            //接入Appcenter后台数据检测
+            string appkey = "b099dccc-1ca5-4ea1-a2fa-afd4a6e1f8bb"
+            AppCenter.Start(appkey, typeof(Analytics), typeof(Crashes));
+            var countryCode = RegionInfo.CurrentRegion.TwoLetterISORegionName;//上传国家信息
+            AppCenter.SetCountryCode(countryCode);
+#endif
+            LicenseVerify();
+
+
+            if (Settings.Default.RecentOpenFiles == null)
+                Settings.Default.RecentOpenFiles = new RecentOpenFiles();
+
+            try
+            {
+                DirectoryInfo info = new DirectoryInfo(CurrentPath);
+                if (File.Exists(CurrentPath))
+                    File.Delete(CurrentPath);
+                if (!info.Exists)
+                {
+                    info.Create();
+                }
+            }
+            catch (Exception ex)
+            {
+
+            }
+        }
+
+        /// <summary>
+        /// 创建启动窗口
+        /// </summary>
+        /// <returns></returns>
+        protected override Window CreateShell()
+        {
+ 
+            return Container.Resolve<MainWindow>();
+        }
+
+
+        protected override void RegisterTypes(IContainerRegistry containerRegistry)
+        {
+            //注册内容组件
+            containerRegistry.RegisterForNavigation<HomeContent>();
+            containerRegistry.RegisterForNavigation<ViewContent>();
+            containerRegistry.RegisterForNavigation<MainContent>();
+            containerRegistry.RegisterForNavigation<HomeCloudContent>("Cloud");
+            containerRegistry.RegisterForNavigation<HomeToolsContent>("Tools");
+            containerRegistry.RegisterForNavigation<HomeGuidContent>("Guid");
+            containerRegistry.RegisterForNavigation<BOTAContent>();
+            containerRegistry.RegisterForNavigation<PageEditContent>();
+            containerRegistry.RegisterForNavigation<ToolsBarContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModMultipleContent>();
@@ -110,18 +113,25 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<HomePageCompressDialog>();
             containerRegistry.RegisterForNavigation<HomePageSetPasswordDialog>();
             containerRegistry.RegisterForNavigation<ConverterBarContent>();
+            containerRegistry.RegisterForNavigation<HomePageConverterDialog>();
+            containerRegistry.RegisterForNavigation<HomePageConverterCSV>();
+            containerRegistry.RegisterForNavigation<HomePageConverterImg>();
+            containerRegistry.RegisterForNavigation<HomePageConverterWord>();
+            containerRegistry.RegisterForNavigation<HomePageConverterExcel>();
+            containerRegistry.RegisterForNavigation<WatermarkContent>();
+            containerRegistry.RegisterForNavigation<BackgroundContent>();
 
-            //注册弹窗
-            containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);
-            containerRegistry.RegisterDialog<FullScreenWindow>(DialogNames.FullScreenDialog);
-            containerRegistry.RegisterDialog<CompressDialog>(DialogNames.CompressDialog);
-            containerRegistry.RegisterDialog<SetPasswordDialog>(DialogNames.SetPasswordDialog);
-            containerRegistry.RegisterDialog<CheckPasswordDialog>(DialogNames.CheckPasswordDialog);
-            containerRegistry.RegisterDialog<DeleteSafetySettingsDialog>(DialogNames.DeleteSafetySettingsDialog);
-            containerRegistry.RegisterDialog<CompressProgressBarDialog, PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs.CompresProgressBarDialogViewModel>(DialogNames.CompressProgressBarDialog);
-            containerRegistry.RegisterDialog<InsertDialog>(DialogNames.InsertDialog);
-            containerRegistry.RegisterDialog<SplitDialog>(DialogNames.SplitDialog);
-            containerRegistry.RegisterDialog<ExtractDialog>(DialogNames.ExtractDialog);
+            //注册弹窗
+            containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);
+            containerRegistry.RegisterDialog<FullScreenWindow>(DialogNames.FullScreenDialog);
+            containerRegistry.RegisterDialog<CompressDialog>(DialogNames.CompressDialog);
+            containerRegistry.RegisterDialog<SetPasswordDialog>(DialogNames.SetPasswordDialog);
+            containerRegistry.RegisterDialog<CheckPasswordDialog>(DialogNames.CheckPasswordDialog);
+            containerRegistry.RegisterDialog<DeleteSafetySettingsDialog>(DialogNames.DeleteSafetySettingsDialog);
+            containerRegistry.RegisterDialog<CompressProgressBarDialog, PDF_Office.ViewModels.Dialog.ToolsDialogs.CompressDialogs.CompresProgressBarDialogViewModel>(DialogNames.CompressProgressBarDialog);
+            containerRegistry.RegisterDialog<InsertDialog>(DialogNames.InsertDialog);
+            containerRegistry.RegisterDialog<SplitDialog>(DialogNames.SplitDialog);
+            containerRegistry.RegisterDialog<ExtractDialog>(DialogNames.ExtractDialog);
             containerRegistry.RegisterDialog<HomePageExtractDialog>(DialogNames.HomePageExtractDialog);
             containerRegistry.RegisterDialog<HomePageInsertDialog>(DialogNames.HomePageInsertDialog);
             containerRegistry.RegisterDialog<HomePageSplitDialog>(DialogNames.HomePageSplitDialog);
@@ -138,84 +148,86 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<ConverterRTFDialog>(DialogNames.ConverterRTFDialog);
             containerRegistry.RegisterDialog<ConverterExcelDialog>(DialogNames.ConverterExcelDialog);
             containerRegistry.RegisterDialog<ConverterProgressBarDialog>(DialogNames.ConverterProgressBarDialog);
-
-
-        }
-
-        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)
-        {
-            var region = new SingleActiveRegion() { Name = RegionNames.MainRegion };
-
-            region.Behaviors.Add(DragablzWindowBehavior.BehaviorKey, new DragablzWindowBehavior());
-
-            Container.Resolve<IRegionManager>().Regions.Add(region);
-
-            base.ConfigureRegionAdapterMappings(regionAdapterMappings);
-        }
-
+
+
+        }
+
+        protected override void ConfigureRegionAdapterMappings(RegionAdapterMappings regionAdapterMappings)
+        {
+            var region = new SingleActiveRegion() { Name = RegionNames.MainRegion };
+
+            region.Behaviors.Add(DragablzWindowBehavior.BehaviorKey, new DragablzWindowBehavior());
+
+            Container.Resolve<IRegionManager>().Regions.Add(region);
+
+            base.ConfigureRegionAdapterMappings(regionAdapterMappings);
+        }
+
         /// <summary>
         /// 验证SDK和转档库密钥
         /// </summary>
         /// <returns></returns>
-        private static bool LicenseVerify()
-        {
-            bool result = false;
-            try
-            {
-                result = CPDFSDKVerifier.LoadNativeLibrary();
-                if (!result)
-                    return false;
-            }
-            catch{ }
+        private static bool LicenseVerify()
+        {
+            bool result = false;
+            try
+            {
+                result = CPDFSDKVerifier.LoadNativeLibrary();
+                if (!result)
+                    return false;
+            }
+            catch{ }
             SDKLisenceHelper sdkhelper = new SDKLisenceHelper();
-            string devKey = "";
-            string devSecret = "";
-#if DEBUG
+            string devKey = "";
+            string devSecret = "";
+#if DEBUG
             devKey = "ehrnKqkWc1XSEAWyPUt6+95GzCoLEyoKrCbsUuJkCqGmxmP5ozX4bS0R6crHItQVNTFvC5mBZ1M7QjJ6Ekdu4Daj7PM+EDLTBKbFJinK4Ri9E5E2X+a9vF5zSj0TkIscQPVnwj9ikxAFOWGIyybMwQQzwc8a4j1cGOqGXQRDMMY=";
             devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6ccHhEu996bvBgqf8Sw8OekQKQq13VBewK5AckaDux4W7SGRhCUNWC4MItkr36JnXMD2tiFQYzMG8C66HYmRGSLh";
-#endif
+            devKey = sdkhelper.DevKey;
+            devSecret = sdkhelper.DevSecret;
+#endif
             string userKey = sdkhelper.UserKey; 
             string userSecret = sdkhelper.UserSecret; 
-
-            try
-            {
+
+            try
+            {
                 CPDFSDKVerifier.LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(devKey, devSecret);
-                if (verifyResult != CPDFSDKVerifier.LicenseErrorCode.LICENSE_ERR_SUCCESS)
-                    return false;
-            }
-            catch{ }
-
+                if (verifyResult != CPDFSDKVerifier.LicenseErrorCode.LICENSE_ERR_SUCCESS)
+                    return false;
+            }
+            catch{ }
+
             string ConverterDevKey = sdkhelper.ConverterDevKey;
             string ConverterDevSecret = sdkhelper.ConverterDevSecret; 
             string ConverterUserkey = sdkhelper.ConverterUserkey; 
             string ConverterUserSecret = sdkhelper.ConverterUserSecret;
-
-            try
-            {
-                /*LicenseError licenseerror = CPDFConverter.SDKLicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
-            string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
-            if (licenseerror != LicenseError.ERR_SUCCESS)
-            {
-                return false;
-            }
-                CPDFConverter.Init(resPath);*/
-                string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
+
+            try
+            {
+                /*LicenseError licenseerror = CPDFConverter.SDKLicenseVerify(ConverterDevKey, ConverterDevSecret, ConverterUserkey, ConverterUserSecret);
+            string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
+            if (licenseerror != LicenseError.ERR_SUCCESS)
+            {
+                return false;
+            }
+                CPDFConverter.Init(resPath);*/
+                string resPath = Path.GetDirectoryName(typeof(MainWindow).Assembly.Location) + "\\";
                 LicenseError licenseerror = CPDFConverter.LicenseVerify(ConverterDevKey, ConverterDevSecret);
-                if (licenseerror != LicenseError.ERR_SUCCESS)
-                {
-                    //MessageBox.Show("ComPDFKit Conversion SDK Load Failed!");
-                    return false;
-                }
-                CPDFConverter.Init(resPath);
-            }
-            catch{ }
-            return result;
-        }
-
-        protected override void OnExit(ExitEventArgs e)
-        {
-            Environment.Exit(1);
-            base.OnExit(e);
-        }
-    }
-}
+                if (licenseerror != LicenseError.ERR_SUCCESS)
+                {
+                    //MessageBox.Show("ComPDFKit Conversion SDK Load Failed!");
+                    return false;
+                }
+                CPDFConverter.Init(resPath);
+            }
+            catch{ }
+            return result;
+        }
+
+        protected override void OnExit(ExitEventArgs e)
+        {
+            Environment.Exit(1);
+            base.OnExit(e);
+        }
+    }
+}

+ 32 - 0
PDF Office/CustomControl/CommonWritableComboBox.xaml

@@ -0,0 +1,32 @@
+<UserControl x:Class="PDF_Office.CustomControl.CommonWritableComboBox"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+             xmlns:local="clr-namespace:PDF_Office.CustomControl"
+             mc:Ignorable="d" 
+              d:DesignHeight="32" d:DesignWidth="66">
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="*"></ColumnDefinition>
+            <ColumnDefinition Width="16"></ColumnDefinition>
+        </Grid.ColumnDefinitions>
+        <TextBox Name="TextBox_Num"
+                MinHeight="32"
+                Grid.Column="0"
+                Padding="16,0,0,0"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                BorderThickness="0"
+                FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontFamily}"
+                FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontSize}"
+                Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
+                InputMethod.IsInputMethodEnabled="False"
+                PreviewTextInput="CountTextBox_PreviewTextInput"
+                Text="1"
+                TextAlignment="Left"
+                KeyDown="CurrentPage_KeyDown"
+                TextChanged="TextBox_Num_TextChanged" />
+        <ComboBox Name="ComboBox_Type" MinHeight="32" Width="16" HorizontalAlignment="Right" BorderBrush="Transparent" BorderThickness="00" Grid.Column="1" SelectionChanged="ComboBox_SelectionChanged"></ComboBox>
+    </Grid>
+</UserControl>

+ 148 - 0
PDF Office/CustomControl/CommonWritableComboBox.xaml.cs

@@ -0,0 +1,148 @@
+using ImTools;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Text.RegularExpressions;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PDF_Office.CustomControl
+{
+    /// <summary>
+    /// CommonWritableComboBox.xaml 的交互逻辑
+    /// </summary>
+    public partial class CommonWritableComboBox : UserControl
+    {
+        public CommonWritableComboBox()
+        {
+            InitializeComponent();
+        }
+        public string Text
+        {
+            get { return (string)GetValue(TextProperty); }
+            set { SetValue(TextProperty, value); }
+        }
+
+        public static readonly DependencyProperty TextProperty =
+            DependencyProperty.Register("Text", typeof(string), typeof(CommonWritableComboBox), new PropertyMetadata(""));
+
+
+        /// <summary>
+        /// 当前值
+        /// </summary>
+        public double Value
+        {
+            get { return (double)GetValue(ValueProperty); }
+            set
+            {
+                if (value > Maximum)
+                {
+                    SetValue(ValueProperty, Maximum);
+                }
+                else if (value < Minimum)
+                {
+                    SetValue(ValueProperty, Minimum);
+                }
+                else
+                {
+                    SetValue(ValueProperty, value);
+                    //TextBox_Num.Text = Value.ToString();
+                }
+            }
+        }
+
+        public static readonly DependencyProperty ValueProperty =
+            DependencyProperty.Register("Value", typeof(double), typeof(CommonWritableComboBox), new PropertyMetadata(0.0));
+
+        public List<string> TypeSouce
+        {
+            get { return (List<string>)GetValue(TypeSouceProperty); }
+            set { SetValue(TypeSouceProperty, value); }
+        }
+
+        public static readonly DependencyProperty TypeSouceProperty =
+            DependencyProperty.Register("TypeSouce", typeof(List<string>), typeof(CommonWritableComboBox), new PropertyMetadata(new List<string>()));
+
+        /// <summary>
+        /// 最大值
+        /// </summary>
+        public double Maximum
+        {
+            get { return (double)GetValue(MaximumProperty); }
+            set { SetValue(MaximumProperty, value); }
+        }
+
+        public static readonly DependencyProperty MaximumProperty =
+            DependencyProperty.Register("Maximum", typeof(double), typeof(CommonWritableComboBox), new PropertyMetadata(9999.0));
+
+        
+        /// <summary>
+        /// 最小值
+        /// </summary>
+        public double Minimum
+        {
+            get { return (double)GetValue(MinimumProperty); }
+            set { SetValue(MinimumProperty, value); }
+        }
+
+        public static readonly DependencyProperty MinimumProperty =
+            DependencyProperty.Register("Minimum", typeof(double), typeof(CommonWritableComboBox), new PropertyMetadata(0.0));
+
+        /// <summary>
+        /// 单位符号
+        /// </summary>
+        public string Unit
+        {
+            get { return (string)GetValue(UnitProperty); }
+            set { SetValue(UnitProperty, value); }
+        }
+
+        public static readonly DependencyProperty UnitProperty =
+            DependencyProperty.Register("Unit", typeof(string), typeof(CommonWritableComboBox), new PropertyMetadata("%"));
+
+        private void TextBox_Num_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            
+            if (this.TextBox_Num.Text == "" )
+            {
+                this.TextBox_Num.Text ="0";
+            }
+
+            if (!int.TryParse(this.TextBox_Num.Text, out _)&&!int.TryParse(this.TextBox_Num.Text.Replace(Unit, ""), out _)) { this.TextBox_Num.Text = "0"; }
+            else{ 
+            Text = this.TextBox_Num.Text;
+            Value = int.Parse(this.TextBox_Num.Text.Replace(" ", "").Replace(Unit, ""));
+            }
+        }
+
+        private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+
+            this.TextBox_Num.Text = TypeSouce[ComboBox_Type.SelectedIndex];
+            Text = this.TextBox_Num.Text;
+            Value = int.Parse(this.TextBox_Num.Text.Replace(" ", "").Replace(Unit, ""));
+        }
+        private void CountTextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)
+        {
+            //e.Handled = new Regex("[^0-9]+").IsMatch(e.Text);
+        }
+
+        private void CurrentPage_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.Key == Key.Enter)
+            {
+                this.TextBox_Num.Text = this.TextBox_Num.Text.Replace(" " , "").Replace(Unit,"")+" "+Unit;
+                
+            }
+        }
+    }
+}

+ 67 - 26
PDF Office/CustomControl/NumericUpDown.xaml

@@ -1,28 +1,69 @@
-<UserControl x:Class="PDF_Office.CustomControl.NumericUpDown"
-            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
-             xmlns:local="clr-namespace:PDF_Office.CustomControl"
-             mc:Ignorable="d" 
-             d:DesignHeight="40" d:DesignWidth="80">
-    <Grid>
-        <Grid.ColumnDefinitions>
-            <ColumnDefinition Width="4*"/>
-            <ColumnDefinition Width="1*"/>
-        </Grid.ColumnDefinitions>
-        <TextBox Name="TextBox_Num" Grid.Column="0" Text="1" FontSize="20" TextAlignment="Center" MinWidth="80" MinHeight="20" VerticalContentAlignment="Center" TextChanged="TextBox_Num_TextChanged" InputMethod.IsInputMethodEnabled="False"  PreviewTextInput="CountTextBox_PreviewTextInput" />
-        <Grid Grid.Column="1">
-            <Grid.RowDefinitions>
-                <RowDefinition/>
-                <RowDefinition/>
-            </Grid.RowDefinitions>
-            <Button Name="Button_Add" Grid.Row="0" Click="Button_Add_Click" Background="White">
-                <Path  VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="Black"  Data="M0 8L4 1 L8 8" Height="10" Stretch="Fill" Visibility="{Binding CompressLargeStyle}"/>
-            </Button>
-            <Button Name="Button_Sub" Grid.Row="1"   Click="Button_Sub_Click" Background="White">
-                <Path  VerticalAlignment="Center" HorizontalAlignment="Center" Stroke="Black"  Data="M0 8L4 16 L8 8" Height="10" Stretch="Fill" Visibility="{Binding CompressLargeStyle}"/>
-            </Button>
+<UserControl
+    x:Class="PDF_Office.CustomControl.NumericUpDown"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:local="clr-namespace:PDF_Office.CustomControl"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    d:DesignHeight="40"
+    d:DesignWidth="80"
+    Background="#EEEEEE"
+    FontSize="20"
+    mc:Ignorable="d">
+    <Border>
+        <Grid>
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition Width="*" />
+                <ColumnDefinition Width="auto" />
+            </Grid.ColumnDefinitions>
+            <TextBox
+                Name="TextBox_Num"
+                MinWidth="80"
+                MinHeight="20"
+                Padding="16,0,0,0"
+                VerticalContentAlignment="Center"
+                Background="Transparent"
+                BorderThickness="0"
+                FontFamily="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontFamily}"
+                FontSize="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=FontSize}"
+                Foreground="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=Foreground}"
+                InputMethod.IsInputMethodEnabled="False"
+                PreviewTextInput="CountTextBox_PreviewTextInput"
+                Text="1"
+                TextAlignment="Left"
+                TextChanged="TextBox_Num_TextChanged" />
+            <Grid Grid.Column="1" Width="20">
+                <Grid.RowDefinitions>
+                    <RowDefinition />
+                    <RowDefinition />
+                </Grid.RowDefinitions>
+                <Button
+                    Name="Button_Add"
+                    Grid.Row="0"
+                    Background="Transparent"
+                    BorderBrush="Transparent"
+                    BorderThickness="0"
+                    Click="Button_Add_Click">
+                    <Path
+                        HorizontalAlignment="Center"
+                        Data="M8 4.29102L2.14648 10.1445L2.85547 10.8535L8 5.70898L13.1445 10.8535L13.8535 10.1445L8 4.29102Z"
+                        Fill="Black"
+                        Stretch="Uniform"
+                        Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
+                </Button>
+                <Button
+                    Name="Button_Sub"
+                    Grid.Row="1"
+                    Background="Transparent"
+                    BorderThickness="00"
+                    Click="Button_Sub_Click">
+                    <Path
+                        Data="M13.8535 5.85547L13.1445 5.14648L8 10.291L2.85547 5.14648L2.14648 5.85547L8 11.709L13.8535 5.85547Z"
+                        Fill="Black"
+                        Stretch="Uniform"
+                        Visibility="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:NumericUpDown}, Path=ShowBtn}" />
+                </Button>
+            </Grid>
         </Grid>
-    </Grid>
+    </Border>
 </UserControl>

+ 124 - 33
PDF Office/CustomControl/NumericUpDown.xaml.cs

@@ -21,24 +21,100 @@ namespace PDF_Office.CustomControl
     /// </summary>
     public partial class NumericUpDown : UserControl
     {
-        public int Num
+        
+
+        public string Text
         {
-            get
-            {
-                int value = 0;
-                this.Dispatcher.Invoke(new Action(() =>
-                    value = Convert.ToInt32(this.TextBox_Num.Text.Trim())
-                ));
-                return value;
-            }
+            get { return (string)GetValue(TextProperty); }
+            set { SetValue(TextProperty, value); }
+        }
+
+        public static readonly DependencyProperty TextProperty =
+            DependencyProperty.Register("Text", typeof(string), typeof(NumericUpDown), new PropertyMetadata(""));
+
+
+        /// <summary>
+        /// 当前值
+        /// </summary>
+        public double Value
+        {
+            get { return (double)GetValue(ValueProperty); }
             set
             {
-                this.Dispatcher.Invoke(new Action(() =>
+                if (value > Maximum)
+                {
+                    SetValue(ValueProperty, Maximum);
+                }
+                else if (value < Minimum)
+                {
+                    SetValue(ValueProperty, Minimum);
+                }
+                else
                 {
-                    this.TextBox_Num.Text = value.ToString();
-                }));
+                    SetValue(ValueProperty, value);
+                    TextBox_Num.Text = Value.ToString();
+                }
             }
         }
+
+        public static readonly DependencyProperty ValueProperty =
+            DependencyProperty.Register("Value", typeof(double), typeof(NumericUpDown), new PropertyMetadata(0.0));
+
+
+        /// <summary>
+        /// 最大值
+        /// </summary>
+        public double Maximum
+        {
+            get { return (double)GetValue(MaximumProperty); }
+            set { SetValue(MaximumProperty, value); }
+        }
+
+        public static readonly DependencyProperty MaximumProperty =
+            DependencyProperty.Register("Maximum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(9999.0));
+
+
+
+        /// <summary>
+        /// 最小值
+        /// </summary>
+        public double Minimum
+        {
+            get { return (double)GetValue(MinimumProperty); }
+            set { SetValue(MinimumProperty, value); }
+        }
+
+        public static readonly DependencyProperty MinimumProperty =
+            DependencyProperty.Register("Minimum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(0.0));
+
+
+        /// <summary>
+        /// 增长步长
+        /// </summary>
+
+        public double TickFrequency
+        {
+            get { return (double)GetValue(TickFrequencyProperty); }
+            set { SetValue(TickFrequencyProperty, value); }
+        }
+
+        public static readonly DependencyProperty TickFrequencyProperty =
+            DependencyProperty.Register("TickFrequency", typeof(double), typeof(NumericUpDown), new PropertyMetadata(1.0));
+
+
+
+        public Visibility ShowBtn
+        {
+            get { return (Visibility)GetValue(ShowBtnProperty); }
+            set { SetValue(ShowBtnProperty, value); }
+        }
+
+        public static readonly DependencyProperty ShowBtnProperty =
+            DependencyProperty.Register("ShowBtn", typeof(Visibility), typeof(NumericUpDown), new PropertyMetadata(Visibility.Visible));
+
+
+
+
         public NumericUpDown()
         {
             InitializeComponent();
@@ -46,43 +122,58 @@ namespace PDF_Office.CustomControl
 
         private void Button_Add_Click(object sender, RoutedEventArgs e)
         {
-            int num = int.Parse(this.TextBox_Num.Text.Trim());
-            if (num > 0)
+            int num = 0;
+            double targetvalue = 0;
+            bool result = int.TryParse(this.TextBox_Num.Text.Trim(), out num);
+            if (result)
+            {
+                targetvalue = num + TickFrequency;
+            }
+            else
             {
-                this.TextBox_Num.Text = (num + 1).ToString();
-                Text = this.TextBox_Num.Text;
+                targetvalue = Maximum;
             }
+            if (targetvalue > Maximum)
+            {
+                targetvalue = Maximum;
+            }
+            this.TextBox_Num.Text = targetvalue.ToString();
+            Text = this.TextBox_Num.Text;
+            Value = targetvalue;
         }
 
         private void Button_Sub_Click(object sender, RoutedEventArgs e)
         {
-            int num = int.Parse(this.TextBox_Num.Text.Trim());
-            if (num > 0)
+            int num = 0;
+            double targetvalue = 0;
+            bool result = int.TryParse(this.TextBox_Num.Text.Trim(), out num);
+            if (result)
+            {
+                targetvalue = num - TickFrequency;
+            }
+            else
             {
-                if ((num - 1) == 0)
-                    return;
-                this.TextBox_Num.Text = (num - 1).ToString();
-                Text = this.TextBox_Num.Text;
+                targetvalue = Minimum;
             }
-        } 
 
-        public string Text
-        {
-            get { return (string)GetValue(TextProperty); }
-            set { SetValue(TextProperty, value); }
+            if (targetvalue < Minimum)
+            {
+                targetvalue = Minimum;
+            }
+            this.TextBox_Num.Text = targetvalue.ToString();
+            Text = this.TextBox_Num.Text;
+            Value = targetvalue;
         }
 
-        // Using a DependencyProperty as the backing store for MyProperty.  This enables animation, styling, binding, etc...
-        public static readonly DependencyProperty TextProperty =
-            DependencyProperty.Register("Text", typeof(string), typeof(NumericUpDown), new PropertyMetadata(""));
-
         private void TextBox_Num_TextChanged(object sender, TextChangedEventArgs e)
         {
-            if (this.TextBox_Num.Text == "" || int.Parse(this.TextBox_Num.Text) < 1)
+            int num = 0;
+            if (this.TextBox_Num.Text == "" || !int.TryParse(this.TextBox_Num.Text, out num))
             {
-                this.TextBox_Num.Text = "1";
+                this.TextBox_Num.Text = Minimum.ToString();
             }
             Text = this.TextBox_Num.Text;
+            Value = int.Parse(this.TextBox_Num.Text);
         }
 
         private void CountTextBox_PreviewTextInput(object sender, TextCompositionEventArgs e)

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

@@ -28,7 +28,22 @@ namespace PDF_Office.CustomControl
     {
         public CPDFDocument document;
         public List<int> PageIndexLists = new List<int>();
-        public int CurrentIndex=0;
+
+        private int currentIndex = 0;
+        public int CurrentIndex
+        {
+            get { return currentIndex; }
+            set
+            {
+                currentIndex = value;
+                //合理的使用set方法来进行一些操作,可以帮助理清很多思路,且极大减少代码量
+                this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
+                if (document != null)
+                {
+                    AwaitRenderBitmap(document);
+                }
+            }
+        }
         public PageTurningPreview()
         {   
             InitializeComponent();
@@ -58,11 +73,6 @@ namespace PDF_Office.CustomControl
             if (CurrentIndex > 0)
             {
                 CurrentIndex--;
-                this.CurrentPage.Text = (PageIndexLists[CurrentIndex] + 1).ToString();
-                if (document != null)
-                {
-                    AwaitRenderBitmap(document);
-                }
             }
         }
 
@@ -71,11 +81,6 @@ namespace PDF_Office.CustomControl
             if (CurrentIndex < PageIndexLists.Count()-1 && PageIndexLists.Count() > 0)
             {
                 CurrentIndex++;
-                this.CurrentPage.Text = (PageIndexLists[CurrentIndex]+1).ToString();
-                    if (document != null)
-                {
-                    AwaitRenderBitmap(document);
-                }
             }
            
             

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

@@ -1,5 +1,5 @@
 <UserControl x:Class="PDF_Office.CustomControl.WritableComboBox"
-                   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             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" 

+ 53 - 33
PDF Office/CustomControl/WritableComboBox.xaml.cs

@@ -23,39 +23,6 @@ namespace PDF_Office.CustomControl
     /// </summary>
     public partial class WritableComboBox : UserControl
     {
-        public WritableComboBox()
-        {
-            InitializeComponent();
-        }
-        private void writableComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-            if (this.writableComboBox.SelectedIndex == this.writableComboBox.Items.Count - 1)
-            {
-                this.writableTextBox.Width = this.writableComboBox.ActualWidth - 18;
-                Trace.WriteLine(this.writableComboBox.ActualWidth);
-                this.writableTextBox.Visibility = Visibility.Visible;
-
-            }
-            else
-            {
-                if (this.writableTextBox != null)
-                {
-                    this.writableTextBox.Visibility = Visibility.Hidden;
-                }
-            }
-
-            if (this.writableComboBox.Items.Count == 5)
-            {
-                if (this.writableComboBox.SelectedIndex == 1)
-                { IsCurrentPage = true; }
-                else
-                {
-                    IsCurrentPage = false;
-                }
-            }
-            this.SelectedIndex = this.writableComboBox.SelectedIndex.ToString();
-        }
-
         public bool IsCurrentPage
         {
             get { return (bool)GetValue(IsCurrentPageProperty); }
@@ -97,6 +64,56 @@ namespace PDF_Office.CustomControl
 
             DependencyProperty.Register("Text", typeof(string), typeof(WritableComboBox), new PropertyMetadata(""));
 
+        /// <summary>
+        /// 把子控件的事件传递出去,方便绑定
+        /// </summary>
+        public event RoutedEventHandler SelectionChanged;
+
+
+        /// <summary>
+        /// 把子控件的事件传递出去,方便绑定
+        /// </summary>
+        public event RoutedEventHandler TextChanged;
+
+
+
+        public WritableComboBox()
+        {
+            InitializeComponent();
+        }
+
+
+        private void writableComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if (this.writableComboBox.SelectedIndex == this.writableComboBox.Items.Count - 1)
+            {
+                this.writableTextBox.Width = this.writableComboBox.ActualWidth - 18;
+                Trace.WriteLine(this.writableComboBox.ActualWidth);
+                this.writableTextBox.Visibility = Visibility.Visible;
+
+            }
+            else
+            {
+                if (this.writableTextBox != null)
+                {
+                    this.writableTextBox.Visibility = Visibility.Hidden;
+                }
+            }
+
+            if (this.writableComboBox.Items.Count == 5)
+            {
+                if (this.writableComboBox.SelectedIndex == 1)
+                { IsCurrentPage = true; }
+                else
+                {
+                    IsCurrentPage = false;
+                }
+            }
+            this.SelectedIndex = this.writableComboBox.SelectedIndex.ToString();
+
+            SelectionChanged?.Invoke(sender,e);
+        }
+
         private void writableTextBox_TextChange(object sender, TextChangedEventArgs e)
         {
             if (this.writableComboBox.SelectedIndex == this.writableComboBox.Items.Count - 1)
@@ -104,6 +121,9 @@ namespace PDF_Office.CustomControl
                 Text = this.writableTextBox.Text;
             }
             else { Text = ""; }
+
+
+            TextChanged?.Invoke(sender,e);
         }
     }
 }

+ 4 - 0
PDF Office/EventAggregators/EditToolsEvent.cs

@@ -10,4 +10,8 @@ namespace PDF_Office.EventAggregators
     public class EditToolsEvent:PubSubEvent<string>
     {
     }
+
+    public class CloseEditToolEvent : PubSubEvent
+    {
+    }
 }

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

@@ -10,6 +10,7 @@ namespace PDF_Office.Model.Dialog.ConverterDialogs
     public class ConverterDialogsModel
     {
 
+
         /// <summary>
         /// 文档地址;
         /// </summary>

+ 2 - 2
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogModel.cs

@@ -11,8 +11,8 @@ namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
         public static int BatchProcessingIndex = 0;
 
         public static List<string> FilePaths=new List<string>();
-        // "HomePageShiftingDialog","HomePageCompressDialog" , "HomePageSetPasswordDialog", "HomePageWatermarkDialog", "HomePageBackgroundDialog", "HomePageHeaderFooterDialog", "HomePageBatesDialog", "HomePageDeleteSafetySettintgsDialog"
-        public static List<string> GetBatchProcessing = new List<string> { "HomePageShiftingDialog", "HomePageCompressDialog", "HomePageSetPasswordDialog", "HomePageWatermarkDialog", "HomePageBackgroundDialog", "HomePageHeaderFooterDialog", "HomePageBatesDialog", "HomePageDeleteSafetySettintgsDialog" };
+
+        public static List<string> GetBatchProcessing = new List<string> { "HomePageConverterDialog", "HomePageCompressDialog", "HomePageSetPasswordDialog", "HomePageWatermarkDialog", "HomePageBackgroundDialog", "HomePageHeaderFooterDialog", "HomePageBatesDialog", "HomePageDeleteSafetySettintgsDialog" };
 
     }
 }

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterCSVModel: HomePageConverterDialogModel
+    {
+    }
+}

+ 45 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogModel.cs

@@ -0,0 +1,45 @@
+using ComPDFKit_Conversion.Converter;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterDialogModel
+    {
+        public static List<string> GetConverter = new List<string> { "HomePageConverterWord","HomePageConverterExcel","HomePageConverterPPT","HomePageConverterRTF","HomePageConverterHTML"
+            ,"HomePageConverterText","HomePageConverterCSV","HomePageConverterImg" };
+
+        /// <summary>
+        /// 文档地址;
+        /// </summary>
+        public string InputPath = "";
+
+        /// <summary>
+        /// 输出地址;
+        /// </summary>
+        public string OutputPath = "";
+
+        /// <summary>
+        /// 进度;
+        /// </summary>
+        public OnProgress GetProgress = null;
+
+        /// <summary>
+        /// 页码 页码范围;
+        /// </summary>
+        public List<int> PageIndexLists = new List<int> { };
+
+        /// <summary>
+        /// 页面信息
+        /// </summary>
+        public string PageRange = "1,3-4,10";
+
+        /// <summary>
+        /// 文档密码;
+        /// </summary>
+        public string Pawssword = "";
+    }
+}

+ 22 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelModel.cs

@@ -0,0 +1,22 @@
+using ComPDFKit_Conversion.Options;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterExcelModel: HomePageConverterDialogModel
+    {
+        public CPDFConvertExcelOptions excelOption = new CPDFConvertExcelOptions();
+
+        public CPDFConvertExcelOptions ExcelOptions(WorksheetOptions worksheetOptions = WorksheetOptions.ForEachPage, ContentOptions contentOptions = ContentOptions.AllContent)
+        {
+
+            excelOption.ContentOpts = contentOptions;
+            excelOption.WorksheetOpts = worksheetOptions;
+            return excelOption;
+        }
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterHTMLModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterHTMLModel : HomePageConverterDialogModel
+    {
+    }
+}

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

@@ -0,0 +1,15 @@
+using ComPDFKit_Conversion.Converter;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterImgModel : HomePageConverterDialogModel
+    {
+        public ImgType Type = ImgType.JPEG;
+        public string DPI = "50";
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterPPTModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterPPTModel : HomePageConverterDialogModel
+    {
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterRTFModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterRTFModel : HomePageConverterDialogModel
+    {
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterTextModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterTextModel : HomePageConverterDialogModel
+    {
+    }
+}

+ 12 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterWordModel : HomePageConverterDialogModel
+    {
+    }
+}

+ 112 - 8
PDF Office/PDF Office.csproj

@@ -189,6 +189,9 @@
     <Compile Include="CustomControl\AlertsMessage.xaml.cs">
       <DependentUpon>AlertsMessage.xaml</DependentUpon>
     </Compile>
+    <Compile Include="CustomControl\CommonWritableComboBox.xaml.cs">
+      <DependentUpon>CommonWritableComboBox.xaml</DependentUpon>
+    </Compile>
     <Compile Include="CustomControl\CustomIconToggleBtn.cs" />
     <Compile Include="CustomControl\DialogContent.cs" />
     <Compile Include="CustomControl\IconAndTextTabItem.cs" />
@@ -238,6 +241,15 @@
     <Compile Include="Model\Dialog\ConverterDialogs\ConverterWordDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialogModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSVModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterDialogModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterExcelModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterHTMLModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterImgModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterPPTModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterRTFModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterTextModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWordModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePagePictureToPDFDialogModel.cs" />
     <Compile Include="Model\Dialog\ToolsDialogs\CompressDialogModel\CompressDialogModel.cs" />
@@ -265,8 +277,7 @@
       <DesignTime>True</DesignTime>
       <AutoGen>True</AutoGen>
     </Compile>
-    <Compile Include="ViewModels\EditTools\Background\BackgroundBarContentViewModel.cs" />
-    <Compile Include="ViewModels\EditTools\Background\BackgroundTemplateContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Background\BackgroundContentViewModel.cs" />
     <Compile Include="ViewModels\BOTA\BOTAContentViewModel.cs" />
     <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterProgressBarDialogViewModel.cs" />
@@ -278,6 +289,11 @@
     <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterRTFDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterTextDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ConverterDialogs\ConverterWordDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSVViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterExcelViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterImgViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWordViewModel.cs" />
     <Compile Include="ViewModels\Tools\ConverterBarContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />
@@ -317,6 +333,13 @@
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageInsertDialogViewModel.cs" />
     <Compile Include="ViewModels\PageEdit\PageEditContentViewModel.cs" />
     <Compile Include="ViewModels\Tools\ToolsBarContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkCreateBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkCreateFileContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkCreateTextContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListBaseContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListFileContentViewModel.cs" />
+    <Compile Include="ViewModels\EditTools\Watermark\WatermarkTemplateListTextContentViewModel.cs" />
     <Compile Include="Views\BOTA\BOTAContent.xaml.cs">
       <DependentUpon>BOTAContent.xaml</DependentUpon>
     </Compile>
@@ -359,6 +382,21 @@
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialog.xaml.cs">
       <DependentUpon>HomePageCompressDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSV.xaml.cs">
+      <DependentUpon>HomePageConverterCSV.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterDialog.xaml.cs">
+      <DependentUpon>HomePageConverterDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterExcel.xaml.cs">
+      <DependentUpon>HomePageConverterExcel.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterImg.xaml.cs">
+      <DependentUpon>HomePageConverterImg.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWord.xaml.cs">
+      <DependentUpon>HomePageConverterWord.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialog.xaml.cs">
       <DependentUpon>HomePageSetPasswordDialog.xaml</DependentUpon>
     </Compile>
@@ -419,11 +457,29 @@
     <Compile Include="Views\Dialog\VerifyPassWordDialog.xaml.cs">
       <DependentUpon>VerifyPassWordDialog.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\EditTools\Background\BackgroundBarContent.xaml.cs">
-      <DependentUpon>BackgroundBarContent.xaml</DependentUpon>
+    <Compile Include="Views\EditTools\Background\BackgroundContent.xaml.cs">
+      <DependentUpon>BackgroundContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkContent.xaml.cs">
+      <DependentUpon>WatermarkContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkCreateBaseContent.xaml.cs">
+      <DependentUpon>WatermarkCreateBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkCreateFileContent.xaml.cs">
+      <DependentUpon>WatermarkCreateFileContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkCreateTextContent.xaml.cs">
+      <DependentUpon>WatermarkCreateTextContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkTemplateListBaseContent.xaml.cs">
+      <DependentUpon>WatermarkTemplateListBaseContent.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\EditTools\Watermark\WatermarkTemplateListFileContent.xaml.cs">
+      <DependentUpon>WatermarkTemplateListFileContent.xaml</DependentUpon>
     </Compile>
-    <Compile Include="Views\EditTools\Background\BackgroundTemplateContent.xaml.cs">
-      <DependentUpon>BackgroundTemplateContent.xaml</DependentUpon>
+    <Compile Include="Views\EditTools\Watermark\WatermarkTemplateListTextContent.xaml.cs">
+      <DependentUpon>WatermarkTemplateListTextContent.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\HomePanel\CloudDrive\CloudDriveContent.xaml.cs">
       <DependentUpon>CloudDriveContent.xaml</DependentUpon>
@@ -484,6 +540,10 @@
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="CustomControl\CommonWritableComboBox.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="CustomControl\LoadingControl.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -600,6 +660,26 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterCSV.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterExcel.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterImg.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWord.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -680,11 +760,35 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\EditTools\Background\BackgroundBarContent.xaml">
+    <Page Include="Views\EditTools\Background\BackgroundContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkCreateBaseContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkCreateFileContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkCreateTextContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkTemplateListBaseContent.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\EditTools\Watermark\WatermarkTemplateListFileContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
-    <Page Include="Views\EditTools\Background\BackgroundTemplateContent.xaml">
+    <Page Include="Views\EditTools\Watermark\WatermarkTemplateListTextContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>

+ 94 - 8
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterCSVDialogViewModel.cs

@@ -15,6 +15,7 @@ using System.Collections.Generic;
 using System.Diagnostics;
 using System.IO;
 using System.Linq;
+using System.Windows.Controls;
 using System.Windows.Forms;
 using static Dropbox.Api.Files.FileCategory;
 using static System.Windows.Forms.VisualStyles.VisualStyleElement;
@@ -24,6 +25,11 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 {
     public class ConverterCSVDialogViewModel : BindableBase,IDialogAware
     {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
         public ConverterCSVDialogModel ConverterCSVModel = new ConverterCSVDialogModel();
 
         public CPDFViewer currentViewer;
@@ -35,19 +41,104 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
 
+        #region 委托声明
         public DelegateCommand<string> RadioButtonCommand { get; set; }
 
         public DelegateCommand CancelCommand { get; set; }
 
         public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
         public ConverterCSVDialogViewModel(IDialogService dialogService)
         {
             CancelCommand = new DelegateCommand(cancel);
             ConverterCommnad = new DelegateCommand(converter);
             RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
             dialogs = dialogService;
         }
+
+        #region 逻辑函数
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                   this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+
         private void cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
@@ -97,15 +188,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
 
         }
+        #endregion
 
-        private void SetProgress(int pageIndex)
-        {
-
-        }
-        public string Title=>"";
-
-        public event Action<IDialogResult> RequestClose;
-
+        #region 构架行为
         public bool CanCloseDialog()
         {
             return true;
@@ -127,5 +212,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 ConverterCSVModel.OutputPath = fileinfo.DirectoryName;
             }
         }
+        #endregion
     }
 }

+ 92 - 10
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterExcelDialogViewModel.cs

@@ -19,32 +19,47 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 {
     public class ConverterExcelDialogViewModel : BindableBase, IDialogAware
     {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
         public ConverterExcelDialogModel ConverterExcelModel = new ConverterExcelDialogModel();
 
         public CPDFViewer currentViewer;
 
         public string CurrentPageIndex = "1";
 
-
         public IDialogService dialogs;
 
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
 
-
+        #region 委托声明
         public DelegateCommand<string> RadioButtonCommand { get; set; }
 
         public DelegateCommand CancelCommand { get; set; }
 
         public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
         public ConverterExcelDialogViewModel(IDialogService dialogService)
         {
             CancelCommand = new DelegateCommand(cancel);
             ConverterCommnad = new DelegateCommand(converter);
             RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
             dialogs = dialogService;
         }
+        #region 逻辑函数
         private void cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
@@ -81,6 +96,78 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             
         }
 
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+
         private void radiobutton(string e) {
             string radioButton=e;
             if (radioButton != null) {
@@ -101,15 +188,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
         
         }
+        #endregion
 
-
-        private void SetProgress(int pageIndex)
-        {
-
-        }
-        public string Title => "";
-
-        public event Action<IDialogResult> RequestClose;
+        #region 构架行为
 
         public bool CanCloseDialog()
         {
@@ -132,5 +213,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 ConverterExcelModel.OutputPath = fileinfo.DirectoryName;
             }
         }
+        #endregion
     }
 }

+ 87 - 3
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterHTMLDialogViewModel.cs

@@ -19,6 +19,11 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
     public class ConverterHTMLDialogViewModel : BindableBase, IDialogAware
     {
 
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
         public ConverterHTMLDialogModel ConverterHTMLModel = new ConverterHTMLDialogModel();
 
         public CPDFViewer currentViewer;
@@ -30,17 +35,28 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
 
+        #region 委托声明
         public DelegateCommand CancelCommand { get; set; }
 
         public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
         public ConverterHTMLDialogViewModel(IDialogService dialogService)
         {
             CancelCommand = new DelegateCommand(cancel);
             ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
             dialogs = dialogService;
 
         }
+        #region 逻辑函数
         private void cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
@@ -75,13 +91,80 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             });
         }
 
-        private void SetProgress(int pageIndex)
+        private void CmbPageSelectionChangedEvent(object e)
         {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
 
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
         }
-        public string Title => "";
+        #endregion
 
-        public event Action<IDialogResult> RequestClose;
+        #region 构架行为
 
         public bool CanCloseDialog()
         {
@@ -104,5 +187,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 ConverterHTMLModel.OutputPath = fileinfo.DirectoryName;
             }
         }
+        #endregion
     }
 }

+ 176 - 4
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterImgDialogViewModel.cs

@@ -1,4 +1,5 @@
-using ComPDFKitViewer.PdfViewer;
+using ComPDFKit_Conversion.Converter;
+using ComPDFKitViewer.PdfViewer;
 using PDF_Office.CustomControl;
 using PDF_Office.Helper;
 using PDF_Office.Model;
@@ -18,6 +19,12 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 {
     public class ConverterImgDialogViewModel : BindableBase, IDialogAware
     {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
         public ConverterImgDialogModel ConverterImgModel = new ConverterImgDialogModel();
 
         public CPDFViewer currentViewer;
@@ -32,6 +39,38 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public List<string> ImageTypeFamily { set; get; } =new List<string>();
 
+        private int imageTypeSelectedIndex;
+        /// <summary>
+        /// 图像类型的下拉框索引值
+        /// 如果只需要根据选中项的索引判断,则可以不用再采取command绑定命令的形式,而是可以通过一个int类型属性绑定的形式,然后在set方法里进行处理
+        /// </summary>
+        public int ImageTypeSelectedIndex
+        {
+            get { return imageTypeSelectedIndex; }
+            set
+            {
+                SetProperty(ref imageTypeSelectedIndex, value);
+                
+                UpdateImageType(ImageTypeSelectedIndex);
+            }
+        }
+
+        private int imageDPISelectedIndex;
+        /// <summary>
+        /// 图像类型的下拉框索引值
+        /// 如果只需要根据选中项的索引判断,则可以不用再采取command绑定命令的形式,而是可以通过一个int类型属性绑定的形式,然后在set方法里进行处理
+        /// </summary>
+        public int ImageDPISelectedIndex
+        {
+            get { return imageDPISelectedIndex; }
+            set
+            {
+                SetProperty(ref imageDPISelectedIndex, value);
+                
+                UpdateImageDPI(ImageDPISelectedIndex);
+            }
+        }
+
         private void SetImageTypeOrigin()
         {
             this.ImageTypeFamily.Add("JPEG");
@@ -54,16 +93,81 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             this.ImageDPIFamily.Add("300 dpi");
             this.ImageDPIFamily.Add("600 dpi");
         }
+        #endregion
 
+        #region 委托声明
         public DelegateCommand CancelCommand { get; set; }
 
         public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
         public ConverterImgDialogViewModel(IDialogService dialogService)
         {
             CancelCommand = new DelegateCommand(cancel);
             ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
             dialogs = dialogService;
         }
+
+        #region 逻辑函数
+        /// <summary>
+        /// 根据下拉框选项,选择不同的图片类型
+        /// </summary>
+        /// <param name="index"></param>
+        private void UpdateImageType(int index)
+        {
+            switch (index)
+            {
+                //case结果是同样的情况下,case可堆叠在一起,表示处理方式一样
+                case 0:
+                case 1:
+                case 3:
+                case 4:
+                case 5:
+                case 6:
+                case 7:
+                    this.ConverterImgModel.Type = ImgType.JPEG;
+                    break;
+                case 2:
+                    this.ConverterImgModel.Type = ImgType.PNG;
+                    break;
+                default:
+                    break;
+            }
+        }
+
+        private void UpdateImageDPI(int index)
+        {
+            switch (index)
+            {
+                case 0:
+                    Trace.WriteLine("50");
+                    break;
+                case 1:
+                    Trace.WriteLine("72");
+                    break;
+                case 2:
+                    Trace.WriteLine("96");
+                    break;
+                case 3:
+                    Trace.WriteLine("150");
+                    break;
+                case 4:
+                    Trace.WriteLine("300");
+                    break;
+                case 5:
+                    Trace.WriteLine("600");
+                    break;
+                default:
+                    break;
+            }
+        }
+
         private void cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
@@ -96,13 +200,80 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             });
         }
 
-        private void SetProgress(int pageIndex)
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
         {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
 
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
         }
-        public string Title => "";
+        #endregion
 
-        public event Action<IDialogResult> RequestClose;
+        #region 构架行为
 
         public bool CanCloseDialog()
         {
@@ -127,5 +298,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 SetImageDPIOrigin();
             }
         }
+        #endregion
     }
 }

+ 88 - 3
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterPPTDialogViewModel.cs

@@ -19,6 +19,11 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
     public class ConverterPPTDialogViewModel : BindableBase, IDialogAware
     {
 
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
         public ConverterPPTDialogModel ConverterPPTModel = new ConverterPPTDialogModel();
 
         public CPDFViewer currentViewer;
@@ -30,16 +35,28 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
+
+        #region 委托声明
 
         public DelegateCommand CancelCommand { get; set; }
 
         public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
         public ConverterPPTDialogViewModel(IDialogService dialogService)
         {
             CancelCommand = new DelegateCommand(cancel);
             ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
             dialogs = dialogService;
         }
+        #region 逻辑函数
         private void cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
@@ -72,13 +89,80 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             });
         }
 
-        private void SetProgress(int pageIndex)
+        private void CmbPageSelectionChangedEvent(object e)
         {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
 
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
         }
-        public string Title => "";
+        #endregion
 
-        public event Action<IDialogResult> RequestClose;
+        #region 构架行为
 
         public bool CanCloseDialog()
         {
@@ -101,5 +185,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 ConverterPPTModel.OutputPath = fileinfo.DirectoryName;
             }
         }
+        #endregion
     }
 }

+ 14 - 6
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterProgressBarDialogViewModel.cs

@@ -17,6 +17,11 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 {
     public class ConverterProgressBarDialogViewModel : BindableBase,IDialogAware
     {
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
         private string _pageIndex = "0";
 
         /// <value>
@@ -43,20 +48,20 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 SetProperty(ref _pageNumber, value);
             }
         }
+        #endregion
 
         public ConverterProgressBarDialogViewModel()
         {
 
         }
-
+        #region 逻辑函数
         private void SetProgress(int pageIndex)
         {
             PageIndex=pageIndex.ToString();
         }
-
-        public string Title =>"";
-
-        public event Action<IDialogResult> RequestClose;
+        #endregion
+        
+        #region 构架行为
 
         public bool CanCloseDialog()
         {
@@ -65,6 +70,8 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public void OnDialogClosed()
         {
+            ConverterHelper.Clear();
+
         }
 
         public async void OnDialogOpened(IDialogParameters parameters)
@@ -83,7 +90,7 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                     {
                         PageNumber = ConverterCSVModel.PageIndexLists.Count().ToString();
                         result = await ConverterHelper.CSVConvert(ConverterCSVModel.InputPath, ConverterCSVModel.OutputPath, GetProgress, ConverterCSVModel.PageIndexLists, ConverterCSVModel.Pawssword);
-                        RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
+                       
                     }
                     break;
                 case "Excel":
@@ -151,5 +158,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
             RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
         }
+        #endregion
     }
 }

+ 88 - 4
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterRTFDialogViewModel.cs

@@ -19,6 +19,11 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
     public class ConverterRTFDialogViewModel : BindableBase, IDialogAware
     {
 
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
         public ConverterRTFDialogModel ConverterRTFModel = new ConverterRTFDialogModel();
 
         public CPDFViewer currentViewer;
@@ -30,16 +35,27 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
-
+        #endregion
+        #region 委托声明
         public DelegateCommand CancelCommand { get; set; }
 
         public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
         public ConverterRTFDialogViewModel(IDialogService dialogService)
         {
             CancelCommand = new DelegateCommand(cancel);
             ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
             dialogs = dialogService;
         }
+
+        #region 逻辑函数
         private void cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
@@ -72,13 +88,80 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             });
         }
 
-        private void SetProgress(int pageIndex)
+        private void CmbPageSelectionChangedEvent(object e)
         {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
 
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
         }
-        public string Title => "";
+        #endregion
 
-        public event Action<IDialogResult> RequestClose;
+        #region 构架行为
 
         public bool CanCloseDialog()
         {
@@ -101,5 +184,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 ConverterRTFModel.OutputPath = fileinfo.DirectoryName;
             }
         }
+        #endregion
     }
 }

+ 91 - 5
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterTextDialogViewModel.cs

@@ -19,6 +19,12 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 {
     public class ConverterTextDialogViewModel : BindableBase, IDialogAware
     {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
         public ConverterTextDialogModel ConverterTextModel = new ConverterTextDialogModel();
 
         public CPDFViewer currentViewer;
@@ -31,15 +37,27 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 
         public string PageRangeSelectIndex { set; get; } = "0";
 
+        #endregion
+
+        #region 委托声明
         public DelegateCommand CancelCommand { get; set; }
 
         public DelegateCommand ConverterCommnad { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
         public ConverterTextDialogViewModel(IDialogService dialogService)
         {
             CancelCommand = new DelegateCommand(cancel);
             ConverterCommnad = new DelegateCommand(converter);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
             dialogs = dialogService;
         }
+        #region 逻辑函数
         private void cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
@@ -71,13 +89,80 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             });
         }
 
-        private void SetProgress(int pageIndex)
-        { 
-        
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
         }
-        public string Title => "";
+        #endregion
 
-        public event Action<IDialogResult> RequestClose;
+        #region 构架行为
 
         public bool CanCloseDialog()
         {
@@ -100,5 +185,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 ConverterTextModel.OutputPath=fileinfo.DirectoryName;
             }
         }
+        #endregion
     }
 }

+ 91 - 7
PDF Office/ViewModels/Dialog/ConverterDialogs/ConverterWordDialogViewModel.cs

@@ -18,6 +18,12 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
 {
     public class ConverterWordDialogViewModel : BindableBase, IDialogAware
     {
+
+        public string Title => "";
+
+        public event Action<IDialogResult> RequestClose;
+
+        #region 参数和属性
         public ConverterWordDialogModel ConverterWordModel = new ConverterWordDialogModel();
 
         public CPDFViewer currentViewer;
@@ -29,20 +35,30 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
         public string PageRangeText { set; get; } = "0";
 
         public string PageRangeSelectIndex { set; get; } = "0";
+        #endregion
 
+        #region 委托声明
         public DelegateCommand<string> RadioButtonCommand { get; set; }
 
         public DelegateCommand CancelCommand { get; set; }
 
         public DelegateCommand ConverterCommnad { get; set; }
 
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
+        #endregion
+
         public ConverterWordDialogViewModel(IDialogService dialogService)
         {
             CancelCommand = new DelegateCommand(cancel);
             ConverterCommnad = new DelegateCommand(converter);
             RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
             dialogs = dialogService;
         }
+        #region 逻辑函数
         private void cancel()
         {
             RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
@@ -74,6 +90,78 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             });
         }
 
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                if (PageRangeSelectIndex == "1")
+                {
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+                    this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                }
+                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ConverterPreview.CurrentIndex = 0;
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ConverterPreview = e as PageTurningPreview;
+            if (ConverterPreview != null)
+            {
+                if (ConverterPreview != null)
+                {
+                    string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                    var currentViewer = this.currentViewer;
+                    string PageRange = "";
+                    var PageRangeText = this.PageRangeText;
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+
+                    if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        ConverterPreview.PageIndexLists.Add(0);
+
+                        return;
+                    }
+                    else
+                    {
+                        ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
+                        ConverterPreview.CurrentIndex = 0;
+                    }
+                }
+            }
+        }
+
         private void radiobutton(string e)
         {
             string radioButton = e;
@@ -91,14 +179,9 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
             }
 
         }
+        #endregion
 
-        private void SetProgress(int pageIndex)
-        {
-
-        }
-        public string Title => "";
-
-        public event Action<IDialogResult> RequestClose;
+        #region 构架行为
 
         public bool CanCloseDialog()
         {
@@ -121,5 +204,6 @@ namespace PDF_Office.ViewModels.Dialog.ConverterDialogs
                 ConverterWordModel.OutputPath = fileinfo.DirectoryName;
             }
         }
+        #endregion
     }
 }

+ 11 - 3
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs

@@ -17,6 +17,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 {
     public class HomePageBatchProcessingDialogViewModel : BindableBase, IDialogAware, INavigationAware
     {
+        #region 参数和属性
         private List<string> fileNames;
 
         public IRegionManager BatchProcessingRegion;
@@ -40,17 +41,20 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             get { return batchProcessingVisible; }
             set { SetProperty(ref batchProcessingVisible, value); }
         }
-        public DelegateCommand<string> DelegateChangeBatchProcessingCommand { get; set; }
+        #endregion
 
+        #region 委托声明
+        public DelegateCommand<string> DelegateChangeBatchProcessingCommand { get; set; }
+        #endregion
         public HomePageBatchProcessingDialogViewModel(IRegionManager regionManager)
         {
             BatchProcessingRegion = regionManager;
             BatchProcessingRegionName = Guid.NewGuid().ToString();
             DelegateChangeBatchProcessingCommand= new DelegateCommand<string>(ChangeBatchProcessing);
         }
-
+        #region 逻辑函数
         public void ChangeBatchProcessing(string index) {
-            if (index =="1"||index=="2") { 
+            if (index=="0"||index =="1"||index=="2") { 
             NavigationParameters param = new NavigationParameters();
             param.Add(ParameterNames.FilePath, HomePageBatchProcessingDialogModel.FilePaths);
             BatchProcessingVisible = Visibility.Collapsed;
@@ -58,11 +62,14 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             BatchProcessingVisible = Visibility.Visible;
             }
         }
+        #endregion
 
         public string Title => "PDF批量工具";
 
         public event Action<IDialogResult> RequestClose;
 
+        #region 构架行为
+
         public bool CanCloseDialog()
         {
             return true;
@@ -98,5 +105,6 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         public void OnNavigatedFrom(NavigationContext navigationContext)
         {
         }
+        #endregion
     }
 }

+ 12 - 6
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogViewModel.cs

@@ -21,6 +21,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 {
     public class HomePageCompressDialogViewModel : BindableBase, INavigationAware
     {
+        #region 参数和属性
         private List<string> fileNames;
 
         private CPDFDocument tempDocument;
@@ -102,6 +103,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
             }
         }
+        #endregion
+
+        #region 委托声明
         public DelegateCommand ADDPDFCommand { get; set; }
 
         public DelegateCommand RemovePDFFileCommand { get; set; }
@@ -111,6 +115,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         public DelegateCommand CompressCommand { get; set; }
 
         public DelegateCommand<string> RadioButtonCommand{ get; set; }
+        #endregion
 
         public HomePageCompressDialogViewModel()
         {
@@ -123,7 +128,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             CompressCommand = new DelegateCommand(compress);
             RadioButtonCommand = new DelegateCommand<string>(RadioButton);
         }
-
+        #region 逻辑函数
         private void RadioButton(string sender) {
             if (sender != "") {
 
@@ -146,7 +151,6 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
                 }
             }
-
         }
 
         private int GetIndex(int pageindex)
@@ -178,12 +182,11 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             }
             CompressGridIsEnabled = "True";
             MessageBoxEx.Show("已完成");
-            SetCompressGridIsEnabled = "False";
-            AddFileVisibility = Visibility.Visible;
-            fileNames.Clear();
-            HomePageBatchProcessingDialogModel.FilePaths.Clear();
+            
         }
+        #endregion
 
+        #region 批量处理逻辑函数
         /// <summary>
         /// 添加PDF文件
         /// </summary>
@@ -321,7 +324,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 AddFileVisibility = Visibility.Collapsed;
             }
         }
+        #endregion
 
+        #region 构架行为
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             List<string> filepath = new List<string>();
@@ -345,5 +350,6 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             if(tempDocument!=null)
             tempDocument.CompressFile_Cancel(compressingIntpr);
         }
+        #endregion
     }
 }

+ 63 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSVViewModel.cs

@@ -0,0 +1,63 @@
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterCSVViewModel : BindableBase, INavigationAware
+    {
+        #region 委托声明
+        public DelegateCommand<string> RadioButtonCommand { get; set; }
+
+        public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }
+        #endregion
+
+        public HomePageConverterCSVViewModel()
+        {
+            RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+        }
+        #region 逻辑函数
+        private void radiobutton(string e)
+        {
+            string radioButton = e;
+            if (radioButton != null)
+            {
+                switch (radioButton)
+                {
+                    case "ForEachPageRadioBtn":
+                        break;
+                    case "OnlyTableRadioBtn":
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+        }
+        #endregion
+
+        #region 构架行为
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel;
+            if (homePageConverterVM != null)
+            {
+                homePageConverterDialogViewModel = homePageConverterVM;
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}

+ 467 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs

@@ -0,0 +1,467 @@
+using ComPDFKit.PDFDocument;
+using ComPDFKit_Conversion.Converter;
+using Microsoft.Office.Interop.Word;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Reflection;
+using System.Windows;
+using System.Windows.Forms;
+using DataTable = System.Data.DataTable;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterDialogViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        private List<string> fileNames;
+
+        public HomePageConverterCSVModel ConverterCSVModel = new HomePageConverterCSVModel();
+        public HomePageConverterExcelModel ConverterExcelModel = new HomePageConverterExcelModel();
+        public HomePageConverterHTMLModel ConverterHTMLModel = new HomePageConverterHTMLModel();
+        public HomePageConverterImgModel ConverterImgModel = new HomePageConverterImgModel();
+        public HomePageConverterPPTModel ConverterPPTModel = new HomePageConverterPPTModel();
+        public HomePageConverterRTFModel ConverterRTFModel = new HomePageConverterRTFModel();
+        public HomePageConverterTextModel ConverterTextModel = new HomePageConverterTextModel();
+        public HomePageConverterWordModel ConverterWordModel = new HomePageConverterWordModel();
+
+        private CPDFDocument tempDocument;
+
+        public string PageNumber = "";
+
+        public IRegionManager ConverterRegion;
+
+        public int ConverterTypeIndex=0;
+
+        public List<int> fileNamesView = new List<int>();
+
+        private int fileNamesIndex = 0;
+
+        public List<string> ConverterTypeFamily { set; get; } = new List<string>();
+
+        private void SetImageTypeOrigin()
+        {
+            this.ConverterTypeFamily.Add("Word");
+            this.ConverterTypeFamily.Add("Excel");
+            this.ConverterTypeFamily.Add("PPT");
+            this.ConverterTypeFamily.Add("RTF");
+            this.ConverterTypeFamily.Add("HTML");
+            this.ConverterTypeFamily.Add("Text");
+            this.ConverterTypeFamily.Add("CSV");
+            this.ConverterTypeFamily.Add("Img");
+        }
+
+        private string converterGridIsEnabled = "True";
+        public string ConverterGridIsEnabled
+        {
+            get
+            {
+                return converterGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref converterGridIsEnabled, value);
+            }
+        }
+
+        private string setConverterGridIsEnabled = "True";
+        public string SetConverterGridIsEnabled
+        {
+            get
+            {
+                return setConverterGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref setConverterGridIsEnabled, value);
+            }
+        }
+
+        private DataTable pdfDataTable = new DataTable();
+        public DataTable PDFDataTable
+        {
+            get { return pdfDataTable; }
+            set
+            {
+                SetProperty(ref pdfDataTable, value);
+            }
+        }
+
+        private string removeIsEnable = "False";
+        public string RemoveIsEnable
+        {
+            get { return removeIsEnable; }
+            set
+            {
+                SetProperty(ref removeIsEnable, value);
+            }
+        }
+
+        private string selectFileName = "False";
+        public string SelectFileName
+        {
+            get { return selectFileName; }
+            set
+            {
+                SetProperty(ref selectFileName, value);
+            }
+        }
+
+        private string converterRegionName;
+        public string ConverterRegionName
+        {
+            get
+            {
+                return converterRegionName;
+            }
+            set
+            {
+                SetProperty(ref converterRegionName, value);
+            }
+        }
+
+        private Visibility converterVisible = Visibility.Collapsed;
+        public Visibility ConverterVisible
+        {
+            get { return converterVisible; }
+            set { SetProperty(ref converterVisible, value); }
+        }
+
+        private Visibility addFileVisibility = Visibility.Hidden;
+        public Visibility AddFileVisibility
+        {
+            get { return addFileVisibility; }
+            set
+            {
+                SetProperty(ref addFileVisibility, value);
+                RaisePropertyChanged();
+
+            }
+        }
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand ADDPDFCommand { get; set; }
+
+        public DelegateCommand RemovePDFFileCommand { get; set; }
+
+        public DelegateCommand ConvertCommand { get; set; }
+
+        public DelegateCommand ADDPDFFilesCommand { get; set; }
+        #endregion
+
+        public HomePageConverterDialogViewModel(IRegionManager converterRegion)
+        {
+
+            SetImageTypeOrigin();
+            PDFDataTable.Columns.Add("FileName");
+            PDFDataTable.Columns.Add("FileSize");
+            PDFDataTable.Columns.Add("FileState");
+            ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
+            RemovePDFFileCommand = new DelegateCommand(removepdffile);
+            ConvertCommand = new DelegateCommand(convert);
+            ConverterRegion = converterRegion;
+            ConverterRegionName=Guid.NewGuid().ToString();
+        }
+        #region 逻辑函数
+        private void SetProgress(int pageIndex)
+        {
+            PDFDataTable.Rows[fileNamesIndex]["FileState"] = "已经转换" + pageIndex.ToString() + "页";
+            pageIndex.ToString();
+        }
+
+        private async void convert()
+        {
+
+            bool result = false;
+            OnProgress GetProgress = null;
+            GetProgress += SetProgress;
+            fileNamesIndex = 0;
+            ConverterGridIsEnabled = "False";
+            foreach (var filename in fileNames)
+            {
+                FileInfo fileinfo = new FileInfo(filename);
+                string OutputPath = fileinfo.DirectoryName;
+                char[] enumerationSeparator = new char[] { ',' };
+                char[] rangeSeparator = new char[] { '-' };
+                List<int> PageIndexLists=new List<int>();
+                CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
+                if (document == null)
+                {
+                    PDFDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
+                    continue;
+                }
+                if (!CommonHelper.GetPagesInRange(ref PageIndexLists, "1-" + document.PageCount.ToString(),document.PageCount, enumerationSeparator, rangeSeparator))
+                { //TODO
+                    Trace.WriteLine("输入不对");
+                    MessageBoxEx.Show("输入不对");
+                    return;
+                }
+                switch (ConverterTypeIndex)
+                {
+                    case 0:
+                        if (ConverterWordModel != null)
+                        {
+                            PageNumber = ConverterWordModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.WordConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterWordModel.Pawssword);
+                        }
+                        break;
+
+                    case 1:
+                        if (ConverterExcelModel != null)
+                        {
+                            PageNumber = ConverterExcelModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.ExcelConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterExcelModel.Pawssword, ConverterExcelModel.excelOption);
+                        }
+                        break;
+                    case 2:
+
+                        if (ConverterPPTModel != null)
+                        {
+                            PageNumber = ConverterPPTModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.PPTConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterPPTModel.Pawssword);
+                        }
+                        break;
+                    case 3:
+
+                        if (ConverterRTFModel != null)
+                        {
+                            PageNumber = ConverterRTFModel.PageIndexLists.Count().ToString();
+                        }
+                        break;
+                    case 4:
+
+                        if (ConverterHTMLModel != null)
+                        {
+                            PageNumber = ConverterHTMLModel.PageIndexLists.Count().ToString();
+                        }
+                        break;
+                    case 5:
+
+                        if (ConverterTextModel != null)
+                        {
+                            PageNumber = ConverterTextModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.TxtConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterTextModel.Pawssword);
+                        }
+                        break;
+                    case 6:
+                        if (ConverterCSVModel != null)
+                        {
+                            PageNumber = ConverterCSVModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.CSVConvert(filename, OutputPath, GetProgress, ConverterCSVModel.PageIndexLists, ConverterCSVModel.Pawssword);
+                        }
+                        break;
+                    case 7:
+
+                        if (ConverterImgModel != null)
+                        {
+                            PageNumber = ConverterImgModel.PageIndexLists.Count().ToString();
+                            result = await ConverterHelper.ImgConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterImgModel.Pawssword, ConverterImgModel.Type);
+                        }
+                        break;
+                    default:
+                        break;
+                }
+                document.Release();
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                fileNamesIndex++;
+            }
+            ConverterGridIsEnabled = "True";
+        }
+        #endregion
+
+        #region 批量处理逻辑函数
+        /// <summary>
+        /// 添加PDF文件
+        /// </summary>
+        private void addpicture()
+        {
+            System.Windows.Forms.OpenFileDialog dlg = new System.Windows.Forms.OpenFileDialog();
+            dlg.Multiselect = true;
+            dlg.Filter = "PDF|*.pdf;*.PDF;";
+            if (dlg.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+                fileNames.AddRange(dlg.FileNames.ToList());
+                RemoveExcess(ref fileNames);
+                SetConverterGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+                updateListview("待确定");
+            }
+        }
+
+        /// <summary>
+        /// 删除重复的文件
+        /// </summary>
+        public void RemoveExcess(ref List<string> Filenames)
+        {
+            List<string> filenames = new List<string>();
+            foreach (var fileName in Filenames)
+            {
+                if (!filenames.Contains(fileName))
+                {
+                    filenames.Add(fileName);
+                }
+            }
+            Filenames.Clear();
+            Filenames = filenames;
+        }
+
+        /// <summary>
+        /// 添加PDF文件夹
+        /// </summary>
+        private void addpicturefiles()
+        {
+            FolderBrowserDialog dialog = new FolderBrowserDialog();
+            dialog.Description = "请选择文件路径";
+            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
+            {
+
+                string foldPath = dialog.SelectedPath;
+                var apps = System.IO.Directory.GetFiles(foldPath);
+                foreach (string app in apps)
+                {
+                    var fi = new FileInfo(app);
+                    if (fi.Extension == ".pdf" || fi.Extension == ".PDF")
+                    {
+                        fileNames.Add(app);
+                    }
+                }
+                RemoveExcess(ref fileNames);
+                updateListview("待确定");
+                SetConverterGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+            }
+
+        }
+        /// <summary>
+        /// 更新listview显示
+        /// state 状态显示字符串
+        /// </summary>
+        public void updateListview(string state)
+        {
+            DataTable pdfdatatable = new DataTable();
+            pdfdatatable.Columns.Add("FileName");
+            pdfdatatable.Columns.Add("FileSize");
+            pdfdatatable.Columns.Add("FileState");
+            foreach (var fileName in fileNames)
+            {
+                string file_all = fileName;
+                FileInfo f = new FileInfo(file_all);
+                string file_size = (((float)f.Length) / 1024).ToString() + " K";
+                pdfdatatable.Rows.Add(f.Name, file_size, state);
+            }
+            PDFDataTable = pdfdatatable;
+            HomePageBatchProcessingDialogModel.FilePaths = fileNames;
+
+        }
+        /// <summary>
+        /// 逆序int类型集合
+        /// </summary>
+        public void Reverseorder(ref List<int> Numbers)
+        {
+            Numbers = Numbers.OrderBy(a => a).ToList();
+            Numbers.Reverse();
+        }
+
+        /// <summary>
+        /// 打开文件PDF
+        /// </summary>
+        public void openfiledialog()
+        {
+
+            foreach (int filenamesview in fileNamesView)
+            {
+                System.Diagnostics.Process.Start(fileNames[filenamesview]);
+            }
+        }
+
+        /// <summary>
+        /// 删除文件PDF
+        /// </summary>
+        public void removepdffile()
+        {
+            Reverseorder(ref fileNamesView);
+            foreach (int filenamesview in fileNamesView)
+            {
+                //Trace.WriteLine(filenamesview);
+                fileNames.Remove(fileNames[filenamesview]);
+            }
+            if (fileNames.Count < 1)
+            {
+                SetConverterGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            updateListview("待确定");
+        }
+
+
+        public void PDFFileCount()
+        {
+            if (fileNames.Count == 0)
+            {
+                SetConverterGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            else
+            {
+                SetConverterGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+            }
+        }
+        public void ChangeConverter(int index)
+        {
+            ConverterTypeIndex=index;
+            NavigationParameters param = new NavigationParameters();
+            param.Add(ParameterNames.ViewContentViewModel, this);
+            if (index == 0 || index == 1 || index == 6 || index == 7)
+            {
+                ConverterVisible = Visibility.Collapsed;
+                ConverterRegion.RequestNavigate(ConverterRegionName, HomePageConverterDialogModel.GetConverter[index], param);
+                ConverterVisible = Visibility.Visible;
+            }
+            else { ConverterVisible = Visibility.Collapsed; }
+
+        }
+        #endregion
+
+        #region 构架行为
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            List<string> filepath = new List<string>();
+            navigationContext.Parameters.TryGetValue<List<string>>(ParameterNames.FilePath, out filepath);
+            if (filepath != null)
+            {
+                fileNames = filepath;
+                PDFFileCount();
+                updateListview("待确定");
+                ChangeConverter(0);
+            }
+        }
+       
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+            ConverterHelper.Clear();
+        }
+        #endregion
+    }
+}

+ 73 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcelViewModel.cs

@@ -0,0 +1,73 @@
+using ComPDFKit_Conversion.Options;
+using PDF_Office.Model;
+using PDF_Office.Model.Dialog.ConverterDialogs;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterExcelViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        public ConverterExcelDialogModel ConverterExcelModel = new ConverterExcelDialogModel();
+
+        public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }
+        #endregion
+
+        #region 委托声明
+        public DelegateCommand<string> RadioButtonCommand { get; set; }
+        #endregion
+
+        public HomePageConverterExcelViewModel()
+        {
+            RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+        }
+        #region 逻辑函数
+        private void radiobutton(string e)
+        {
+            string radioButton = e;
+            if (radioButton != null)
+            {
+                switch (radioButton)
+                {
+                    case "ForEachPageRadioBtn":
+                        homePageConverterDialogViewModel. ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions();
+                        break;
+                    case "ForTheDocRadioBtn":
+                        homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument);
+                        break;
+                    case "OnlyTableRadioBtn":
+                        homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachTable, ContentOptions.OnlyTable);
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+        }
+        #endregion
+        #region 构架行为
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel;
+            if (homePageConverterVM != null)
+            {
+                homePageConverterDialogViewModel = homePageConverterVM;
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}

+ 67 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImgViewModel.cs

@@ -0,0 +1,67 @@
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterImgViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        public List<string> ImageTypeFamily { set; get; } = new List<string>();
+
+        public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }
+
+        private void SetImageTypeOrigin()
+        {
+            this.ImageTypeFamily.Add("JPEG");
+            this.ImageTypeFamily.Add("JPG");
+            this.ImageTypeFamily.Add("PNG");
+            this.ImageTypeFamily.Add("GIF");
+            this.ImageTypeFamily.Add("TIFF");
+            this.ImageTypeFamily.Add("TGA");
+            this.ImageTypeFamily.Add("BMP");
+            this.ImageTypeFamily.Add("JPEG-2000");
+        }
+
+        public List<string> ImageDPIFamily { set; get; } = new List<string>();
+        private void SetImageDPIOrigin()
+        {
+            this.ImageDPIFamily.Add("50 dpi");
+            this.ImageDPIFamily.Add("72 dpi");
+            this.ImageDPIFamily.Add("96 dpi");
+            this.ImageDPIFamily.Add("150 dpi");
+            this.ImageDPIFamily.Add("300 dpi");
+            this.ImageDPIFamily.Add("600 dpi");
+        }
+        #endregion
+
+        public HomePageConverterImgViewModel()
+        {
+            SetImageTypeOrigin();
+            SetImageDPIOrigin();
+        }
+        #region 构架行为
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel;
+            if (homePageConverterVM != null)
+            {
+                homePageConverterDialogViewModel = homePageConverterVM;
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}

+ 56 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWordViewModel.cs

@@ -0,0 +1,56 @@
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    public class HomePageConverterWordViewModel : BindableBase, INavigationAware
+    {
+        public DelegateCommand<string> RadioButtonCommand { get; set; }
+
+        public HomePageConverterDialogViewModel homePageConverterDialogViewModel { get; set; }
+
+        public HomePageConverterWordViewModel()
+        {
+            RadioButtonCommand = new DelegateCommand<string>(radiobutton);
+        }
+        private void radiobutton(string e)
+        {
+            string radioButton = e;
+            if (radioButton != null)
+            {
+                switch (radioButton)
+                {
+                    case "FlowingTextRadioBtn":
+                        break;
+                    case "PageLayoutRadioBtn":
+                        break;
+                    default:
+                        break;
+                }
+            }
+
+        }
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            var homePageConverterVM = navigationContext.Parameters[ParameterNames.ViewContentViewModel] as HomePageConverterDialogViewModel;
+            if (homePageConverterVM != null)
+            {
+                homePageConverterDialogViewModel = homePageConverterVM;
+            }
+        }
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 83 - 77
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogViewModel.cs

@@ -18,6 +18,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 {
     public class HomePageSetPasswordDialogViewModel : BindableBase, INavigationAware
     {
+        #region 参数和属性
         private List<string> fileNames;
 
         private int fileNamesIndex = 0;
@@ -157,6 +158,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
             }
         }
+        #endregion
+
+        #region 委托声明
 
         public DelegateCommand DelegateSetOpenCommand { get; set; }
 
@@ -175,6 +179,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         public DelegateCommand RemovePDFFileCommand { get; set; }
 
         public DelegateCommand ADDPDFFilesCommand { get; set; }
+        #endregion
 
         public HomePageSetPasswordDialogViewModel()
         {
@@ -228,6 +233,82 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
             GetChangeMod.Add("4", HomePageSetPasswordDialogModel.ChangeMod.ExceptAbstrat);
         }
         #endregion
+        #region 逻辑函数
+        public void SetCanOpen()
+        {
+            setPasswordDialogModel.CanOpen = CanOpen;
+            CheckCanConfirmEncrypt();
+        }
+
+        public void SetCanEdit()
+        {
+            setPasswordDialogModel.CanEdit = CanEdit;
+            CheckCanConfirmEncrypt();
+        }
+
+        public void CanOpenTextChanged()
+        {
+            CheckCanConfirmEncrypt();
+        }
+
+        public void CanEditTextChanged()
+        {
+            CheckCanConfirmEncrypt();
+        }
+
+        public void ConfirmEncrypt()
+        {
+            SafetyGridIsEnabled = "False";
+            string openPassword = "";
+            string editPassword = "";
+            CPDFPermissionsInfo permissionsInfo = new CPDFPermissionsInfo();
+            if (setPasswordDialogModel.CanOpen)
+            {
+                if (!string.IsNullOrEmpty(HomePageSetPasswordDialogModel.PasswordForOpen))
+                {
+                    openPassword = HomePageSetPasswordDialogModel.PasswordForOpen;
+                }
+            }
+            if (setPasswordDialogModel.CanEdit)
+            {
+                if (!string.IsNullOrEmpty(HomePageSetPasswordDialogModel.PasswordForEdit))
+                {
+                    editPassword = HomePageSetPasswordDialogModel.PasswordForEdit;
+                    Dictionary<string, HomePageSetPasswordDialogModel.PrintMod> GetPrintMod = new Dictionary<string, HomePageSetPasswordDialogModel.PrintMod>();
+                    Dictionary<string, HomePageSetPasswordDialogModel.ChangeMod> GetChangeMod = new Dictionary<string, HomePageSetPasswordDialogModel.ChangeMod>(); ;
+                    InitPermissionsDictionary(ref GetPrintMod, ref GetChangeMod);
+                    permissionsInfo = setPasswordDialogModel.CreatePermissionsInfo(GetPrintMod[PrintMod], GetChangeMod[ChangeMod]);
+                }
+            }
+            fileNamesIndex = 0;
+            foreach (var filename in fileNames)
+            {
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "待完成";
+                CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
+                if (document == null)
+                {
+                    PDFDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
+                    continue;
+                }
+                FileInfo fileinfo = new FileInfo(filename);
+                string file_size = (((float)fileinfo.Length) / 1024).ToString() + " K";
+                if (document == null)
+                {
+                    return;
+                }
+                document.Encrypt(openPassword, editPassword, permissionsInfo);
+                document.WriteToFilePath(filename + "SetPassword");
+
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                fileNamesIndex++;
+                document.Release();
+            }
+            SafetyGridIsEnabled = "True";
+            MessageBoxEx.Show("已完成");
+        }
+        #endregion
+
+        #region 批量处理逻辑函数
         /// <summary>
         /// 添加PDF文件
         /// </summary>
@@ -312,82 +393,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
 
         }
 
-        public void SetCanOpen()
-        {
-            setPasswordDialogModel.CanOpen = CanOpen;
-            CheckCanConfirmEncrypt();
-        }
-
-        public void SetCanEdit()
-        {
-            setPasswordDialogModel.CanEdit = CanEdit;
-            CheckCanConfirmEncrypt();
-        }
-
-        public void CanOpenTextChanged()
-        {
-            CheckCanConfirmEncrypt();
-        }
-
-        public void CanEditTextChanged()
-        {
-            CheckCanConfirmEncrypt();
-        }
-
-        public void ConfirmEncrypt()
-        {
-            SafetyGridIsEnabled = "False";
-            string openPassword = "";
-            string editPassword = "";
-            CPDFPermissionsInfo permissionsInfo = new CPDFPermissionsInfo();
-            if (setPasswordDialogModel.CanOpen)
-            {
-                if (!string.IsNullOrEmpty(HomePageSetPasswordDialogModel.PasswordForOpen))
-                {
-                    openPassword = HomePageSetPasswordDialogModel.PasswordForOpen;
-                }
-            }
-            if (setPasswordDialogModel.CanEdit)
-            {
-                if (!string.IsNullOrEmpty(HomePageSetPasswordDialogModel.PasswordForEdit))
-                {
-                    editPassword = HomePageSetPasswordDialogModel.PasswordForEdit;
-                    Dictionary<string, HomePageSetPasswordDialogModel.PrintMod> GetPrintMod = new Dictionary<string, HomePageSetPasswordDialogModel.PrintMod>();
-                    Dictionary<string, HomePageSetPasswordDialogModel.ChangeMod> GetChangeMod = new Dictionary<string, HomePageSetPasswordDialogModel.ChangeMod>(); ;
-                    InitPermissionsDictionary(ref GetPrintMod, ref GetChangeMod);
-                    permissionsInfo = setPasswordDialogModel.CreatePermissionsInfo(GetPrintMod[PrintMod], GetChangeMod[ChangeMod]);
-                }
-            }
-            fileNamesIndex = 0;
-            foreach (var filename in fileNames)
-            {
-                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "待完成";
-                CPDFDocument document = CPDFDocument.InitWithFilePath(filename);
-                if (document == null)
-                {
-                    PDFDataTable.Rows[fileNamesIndex]["FileState"] = "文件出错";
-                    continue;
-                }
-                FileInfo fileinfo = new FileInfo(filename);
-                string file_size = (((float)fileinfo.Length) / 1024).ToString() + " K";
-                if (document == null)
-                {
-                    return;
-                }
-                document.Encrypt(openPassword, editPassword, permissionsInfo);
-                document.WriteToFilePath(filename + "SetPassword");
-
-                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
-                fileNamesIndex++;
-                document.Release();
-            }
-            SafetyGridIsEnabled = "True";
-            MessageBoxEx.Show("已完成");
-            SetSafetyGridIsEnabled = "False";
-            AddFileVisibility = Visibility.Visible;
-            fileNames.Clear();
-            HomePageBatchProcessingDialogModel.FilePaths.Clear();
-        }
+        
 
         /// <summary>
         /// 逆序int类型集合
@@ -442,7 +448,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                 AddFileVisibility = Visibility.Collapsed;
             }
         }
-
+        #endregion
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             List<string> filepath = new List<string>();

+ 67 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageExtractDialogViewModel.cs

@@ -46,6 +46,10 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         public DelegateCommand ExtractToSingleFileCommand { get; set; }
 
         public DelegateCommand DeleteAfterExtractCommand { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
         #endregion
 
         public HomePageExtractDialogViewModel()
@@ -54,6 +58,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             ExtractCommand = new DelegateCommand(extract);
             ExtractToSingleFileCommand = new DelegateCommand(extractToSingleFile);
             DeleteAfterExtractCommand = new DelegateCommand(deleteAfterExtract);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
 
         }
         #region 逻辑函数
@@ -135,6 +141,67 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             }
 
         }
+
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var ExtractPreview = e as PageTurningPreview;
+            if (ExtractPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "1" || PageRangeSelectIndex == "2")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref ExtractPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
+
+                }
+                ExtractPreview.PageIndex.Text = (ExtractPreview.PageIndexLists.Last<int>() + 1).ToString();
+                ExtractPreview.CurrentIndex = 0;
+                ExtractPreview.CurrentPage.Text = (ExtractPreview.PageIndexLists[ExtractPreview.CurrentIndex] + 1).ToString();
+                ExtractPreview.AwaitRenderBitmap(ExtractPreview.document);
+            }
+        }
+
+        private void CmbPageTextChangedEvent(object e)
+        {
+            var ExtractPreview = e as PageTurningPreview;
+            if (ExtractPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
+                char[] enumerationSeparator = new char[] { ',' };
+                char[] rangeSeparator = new char[] { '-' };
+
+                if (!CommonHelper.GetPagesInRange(ref ExtractPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                { //TODO
+                    ExtractPreview.PageIndexLists.Add(0);
+
+                    return;
+                }
+                else
+                {
+                    ExtractPreview.PageIndex.Text = (ExtractPreview.PageIndexLists.Last<int>() + 1).ToString();
+                    ExtractPreview.CurrentIndex = 0;
+                    ExtractPreview.CurrentPage.Text = (ExtractPreview.PageIndexLists[ExtractPreview.CurrentIndex] + 1).ToString();
+                    ExtractPreview.AwaitRenderBitmap(ExtractPreview.document);
+                }
+            }
+        }
         #endregion
 
         #region 框架行为

+ 5 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePagePictureToPDFDialogViewModel.cs

@@ -98,6 +98,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         }
 
         #endregion
+
         #region 委托声明
 
         public DelegateCommand ToPDFCommand { get; set; }
@@ -219,7 +220,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             FileInfo file = new FileInfo(filename);
             return filename.Replace(file.Name, "") +pictureToPDFModel.FrontFileNameLabel+file.Name+pictureToPDFModel.RearFileNameLabel+".pdf";
         }
+        #endregion
 
+        #region 批量处理逻辑函数
         /// <summary>
         /// 选择PDF文件
         /// </summary>
@@ -354,7 +357,9 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             ImagesDataTable = imagesdatatable;
 
         }
+        #endregion
 
+        #region 图片转换
         /// <summary>
         /// 图片转PNG
         /// picturefile 图片文件名

+ 99 - 30
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageSplitDialogViewModel.cs

@@ -9,6 +9,7 @@ using PDF_Office.Helper;
 using System.Diagnostics;
 using PDF_Office.CustomControl;
 using PDF_Office.Model.HomePageToolsDialogs;
+using System.Linq;
 
 namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
 {
@@ -26,7 +27,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         private string savefilename { get; set; }
 
         public string PageRangeText { set; get; } = "0";
-        
+
         public string PageRangeSelectIndex { set; get; } = "0";
 
         private string averagePagesIsCheck = "True";
@@ -92,7 +93,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         public string AveragePagesText { set; get; } = "";
 
         public string AverageFilesText { set; get; } = "";
-        
+
 
         private string filePathName = "";
         public string FilePathName
@@ -104,14 +105,14 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             }
         }
 
-        public string FileNameLabelText{ set; get; } = "part";
-        
+        public string FileNameLabelText { set; get; } = "part";
+
+
+        public string FileNameDeimiterText { set; get; } = "-";
 
-        public string FileNameDeimiterText{ set; get; } = "-";
-        
 
         public string FrontFileIsCheck { set; get; } = "True";
-       
+
         public string FileNameLabelIsCheck { set; get; } = "True";
 
         public string FileNameDeimiterIsCheck { set; get; } = "True";
@@ -157,6 +158,10 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
         public DelegateCommand FileNameDeimiterChangeCommand { get; set; }
 
         public DelegateCommand FileNameLabelChangeCommand { get; set; }
+
+        public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
+
+        public DelegateCommand<object> CmbPageTextChanged { get; set; }
         #endregion
 
         public HomePageSplitDialogViewModel()
@@ -171,6 +176,8 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
             FileNameDeimiterCommand = new DelegateCommand(fileNameDeimiter);
             FileNameDeimiterChangeCommand = new DelegateCommand(fileNameDeimiter);
             FileNameLabelChangeCommand = new DelegateCommand(fileNameLabel);
+            CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
+            CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
 
 
         }
@@ -423,38 +430,100 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs
                 }
             }
         }
-        #endregion
 
-        #region 构架行为
-        public string Title => "";
+        private void CmbPageSelectionChangedEvent(object e)
+        {
+            ///这里采用的是将预览UI控件传递过来的方式,为下下策
+            ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
+            ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
+            var SplitPreview = e as PageTurningPreview;
+            if (SplitPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "1" || PageRangeSelectIndex == "2")
+                {
+                    HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
+                    char[] enumerationSeparator = new char[] { ',' };
+                    char[] rangeSeparator = new char[] { '-' };
+                    if (!CommonHelper.GetPagesInRange(ref SplitPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                    { //TODO
+                        Trace.WriteLine("输入不对");
+                        MessageBoxEx.Show("输入不对");
+                        return;
+                    }
 
-        public event Action<IDialogResult> RequestClose;
+                }
+                SplitPreview.PageIndex.Text = (SplitPreview.PageIndexLists.Last<int>() + 1).ToString();
+                SplitPreview.CurrentIndex = 0;
+                SplitPreview.CurrentPage.Text = (SplitPreview.PageIndexLists[SplitPreview.CurrentIndex] + 1).ToString();
+                SplitPreview.AwaitRenderBitmap(SplitPreview.document);
+            }
+        }
 
-        public bool CanCloseDialog()
+        private void CmbPageTextChangedEvent(object e)
         {
-            return true;
+            var SplitPreview = e as PageTurningPreview;
+            if (SplitPreview != null)
+            {
+                string PageRangeSelectIndex = this.PageRangeSelectIndex;
+                var currentViewer = this.currentViewer;
+                string PageRange = "";
+                var PageRangeText = this.PageRangeText;
+                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
+                char[] enumerationSeparator = new char[] { ',' };
+                char[] rangeSeparator = new char[] { '-' };
+
+                if (!CommonHelper.GetPagesInRange(ref SplitPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
+                { //TODO
+                    SplitPreview.PageIndexLists.Add(0);
+
+                    return;
+                }
+                else
+                {
+                    SplitPreview.PageIndex.Text = (SplitPreview.PageIndexLists.Last<int>() + 1).ToString();
+                    SplitPreview.CurrentIndex = 0;
+                    SplitPreview.CurrentPage.Text = (SplitPreview.PageIndexLists[SplitPreview.CurrentIndex] + 1).ToString();
+                    SplitPreview.AwaitRenderBitmap(SplitPreview.document);
+                }
+            }
         }
+    
+    #endregion
 
-        public void OnDialogClosed()
-        {
+    #region 构架行为
+    public string Title => "";
 
-        }
+    public event Action<IDialogResult> RequestClose;
 
-        public void OnDialogOpened(IDialogParameters parameters)
+    public bool CanCloseDialog()
+    {
+        return true;
+    }
+
+    public void OnDialogClosed()
+    {
+
+    }
+
+    public void OnDialogOpened(IDialogParameters parameters)
+    {
+        CPDFViewer viewer = null;
+        string filepath = "";
+        parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out viewer);
+        parameters.TryGetValue<string>(ParameterNames.FilePath, out filepath);
+        if (viewer != null && viewer.Document != null)
         {
-            CPDFViewer viewer = null;
-            string filepath = "";
-            parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out viewer);
-            parameters.TryGetValue<string>(ParameterNames.FilePath, out filepath);
-            if (viewer != null && viewer.Document != null)
-            {
-                currentViewer = viewer;
-                document = viewer.Document;
-                savefilename = currentViewer.Document.FileName;
-                FilePathName = savefilename + "-" + "part" + ".pdf";
-                savefilepath = filepath.Replace(savefilename + ".pdf", "");
-            }
+            currentViewer = viewer;
+            document = viewer.Document;
+            savefilename = currentViewer.Document.FileName;
+            FilePathName = savefilename + "-" + "part" + ".pdf";
+            savefilepath = filepath.Replace(savefilename + ".pdf", "");
         }
-        #endregion
     }
+    #endregion
+}
 }

+ 0 - 16
PDF Office/ViewModels/EditTools/Background/BackgroundBarContentViewModel.cs

@@ -1,16 +0,0 @@
-using Prism.Commands;
-using Prism.Mvvm;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace PDF_Office.ViewModels
-{
-    public class BackgroundBarContentViewModel : BindableBase
-    {
-        public BackgroundBarContentViewModel()
-        {
-
-        }
-    }
-}

+ 2 - 2
PDF Office/ViewModels/EditTools/Background/BackgroundContentViewModel.cs

@@ -56,8 +56,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
         }
 
         public void CloseEditTool()
-        {  
-                this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish();
+        {
+            this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish();
         }
 
         public void EnterTemplateListOrCreate(EnumTemplateListOrCreate enumTemplateListOrCreate)

+ 0 - 16
PDF Office/ViewModels/EditTools/Background/BackgroundTemplateContentViewModel.cs

@@ -1,16 +0,0 @@
-using Prism.Commands;
-using Prism.Mvvm;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace PDF_Office.ViewModels
-{
-    public class BackgroundTemplateContentViewModel : BindableBase
-    {
-        public BackgroundTemplateContentViewModel()
-        {
-
-        }
-    }
-}

+ 28 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkContentViewModel.cs

@@ -0,0 +1,28 @@
+using PDF_Office.EventAggregators;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkContentViewModel : BindableBase
+    {
+        public IEventAggregator eventAggregator;
+
+
+        public DelegateCommand CloseEditToolCommand { get; set; }
+        public WatermarkContentViewModel(IEventAggregator eventAggregator)
+        {
+            this.eventAggregator = eventAggregator;
+            CloseEditToolCommand = new DelegateCommand(CloseEditTool);
+        }
+        public void CloseEditTool()
+        {
+            this.eventAggregator.GetEvent<CloseEditToolEvent>().Publish();
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateBaseContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkCreateBaseContentViewModel : BindableBase
+    {
+        public WatermarkCreateBaseContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateFileContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkCreateFileContentViewModel : BindableBase
+    {
+        public WatermarkCreateFileContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkCreateTextContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkCreateTextContentViewModel : BindableBase
+    {
+        public WatermarkCreateTextContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListBaseContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkTemplateListBaseContentViewModel : BindableBase
+    {
+        public WatermarkTemplateListBaseContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListFileContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkTemplateListFileContentViewModel : BindableBase
+    {
+        public WatermarkTemplateListFileContentViewModel()
+        {
+
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/EditTools/Watermark/WatermarkTemplateListTextContentViewModel.cs

@@ -0,0 +1,16 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+
+namespace PDF_Office.ViewModels.EditTools.Watermark
+{
+    public class WatermarkTemplateListTextContentViewModel : BindableBase
+    {
+        public WatermarkTemplateListTextContentViewModel()
+        {
+
+        }
+    }
+}

+ 10 - 1
PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs

@@ -103,10 +103,19 @@ namespace PDF_Office.ViewModels.HomePanel
                         DialogParameters securitypdf = new DialogParameters();
                         securitypdf.Add(ParameterNames.BatchProcessing_Name, "2");
                         HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
-                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
+                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 2;
                         securitypdf.Add(ParameterNames.FilePath, dlg.FileNames);
                         dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, securitypdf, e => { });
                         
+                        break;
+                    case PDFToolType.ConvertPDF:
+                        DialogParameters convertpdf = new DialogParameters();
+                        convertpdf.Add(ParameterNames.BatchProcessing_Name, "0");
+                        HomePageBatchProcessingDialogModel.FilePaths = dlg.FileNames.ToList();
+                        HomePageBatchProcessingDialogModel.BatchProcessingIndex = 0;
+                        convertpdf.Add(ParameterNames.FilePath, dlg.FileNames);
+                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdf, e => { });
+
                         break;
                 }
 

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

@@ -34,7 +34,9 @@ namespace PDF_Office.ViewModels.Tools
 
         public DelegateCommand CancelPasswordCommand { get; set; }
 
-        public DelegateCommand SetBackgroundCommand { get; set; }
+        public DelegateCommand<object> SetEditToolsCommand { get; set; }
+
+        public DelegateCommand SetWatermarkCommand { get; set; }
 
         public ToolsBarContentViewModel(IDialogService dialogService, IEventAggregator eventAggregator)
         {
@@ -43,14 +45,19 @@ namespace PDF_Office.ViewModels.Tools
             CompressCommand = new DelegateCommand(OpenCompressDialog);
             SetPasswordCommand = new DelegateCommand(OpenSetPasswordDialog);
             CancelPasswordCommand = new DelegateCommand(OpenCancelPasswordDialog);
-            SetBackgroundCommand = new DelegateCommand(SetBackground);
+            SetEditToolsCommand = new DelegateCommand<object>(SetEditTools);
         }
 
-        private void SetBackground()
+        private void SetEditTools(object e)
         {
-            this.eventAggregator.GetEvent<EditToolsEvent>().Publish("SetBackground");
+            var args = e as System.Windows.Controls.Button;
+            if (args != null)
+            {
+                this.eventAggregator.GetEvent<EditToolsEvent>().Publish(args.Name);
+            }
         }
 
+
         private void OpenCompressDialog()
         {
             DialogParameters value = new DialogParameters();

+ 47 - 11
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -18,7 +18,6 @@ using System.Windows.Controls;
 using System.IO;
 using Prism.Events;
 using PDF_Office.EventAggregators;
-
 namespace PDF_Office.ViewModels
 {
 
@@ -84,6 +83,7 @@ namespace PDF_Office.ViewModels
             }
         }
 
+
         private int gridToolRow = 1;
         /// <summary>
         /// 控制ToolContent的Row
@@ -124,6 +124,19 @@ namespace PDF_Office.ViewModels
             }
         }
 
+        private Visibility gridVisibility = Visibility.Visible;
+        /// <summary>
+        /// 是否正在加载中
+        /// </summary>
+        public Visibility GridVisibility
+        {
+            get { return gridVisibility; }
+            set
+            {
+                SetProperty(ref gridVisibility, value);
+            }
+        }
+
         private Visibility isLoading = Visibility.Collapsed;
         /// <summary>
         /// 是否正在加载中
@@ -238,6 +251,7 @@ namespace PDF_Office.ViewModels
         #endregion
 
         public ViewContentViewModel(IRegionManager regionManager, IDialogService dialogService, IEventAggregator eventAggregator)
+
         {
             region = regionManager;
             dialogs = dialogService;
@@ -245,6 +259,7 @@ namespace PDF_Office.ViewModels
             LoadFile = new DelegateCommand(loadFile);
             Load = new DelegateCommand(LoadControl);
             SaveFile = new DelegateCommand(() => { saveFile(); });
+
             SaveAsFile = new DelegateCommand(() => { saveAsFile(); });
             UndoCommand = new DelegateCommand(Undo);
             RedoCommand = new DelegateCommand(Redo);
@@ -265,8 +280,9 @@ namespace PDF_Office.ViewModels
             barContentByTabItem = new Dictionary<string, string>();
             InitialregionNameByTabItem(ref regionNameByTabItem);
             InitialbarContentByTabItem(ref barContentByTabItem);
-
             eventAggregator.GetEvent<EditToolsEvent>().Subscribe(EnterEditTools);
+            eventAggregator.GetEvent<CloseEditToolEvent>().Subscribe(CloseEditTool);
+
         }
 
         private void InitialregionNameByTabItem(ref Dictionary<string, string> dictionary)
@@ -296,7 +312,6 @@ namespace PDF_Office.ViewModels
 
         private void UpdateShowContent(string currentBar)
         {
-
             ToolContentVisible = Visibility.Collapsed;
             ToolsBarContentVisible = Visibility.Collapsed;
             ConverterBarContentVisible = Visibility.Collapsed;
@@ -311,6 +326,13 @@ namespace PDF_Office.ViewModels
                 case "TabItemPageEdit":
                     ToolContentVisible = Visibility.Visible;
                     break;
+                case "WatermarkContent":
+                    ToolContentVisible = Visibility.Visible;
+                    break;
+                case "BackgroundContent":
+                    ToolContentVisible = Visibility.Visible;
+                    break;
+                   
                 default:
                     break;
             }
@@ -327,6 +349,7 @@ namespace PDF_Office.ViewModels
                 CanUndo = PDFViewer.UndoManager.CanUndo;
             }
             if (e.PropertyName == "CanRedo")
+
             {
                 CanRedo = PDFViewer.UndoManager.CanRedo;
             }
@@ -346,6 +369,7 @@ namespace PDF_Office.ViewModels
                 if (previousBar != currentBar)
                 {
                     if (currentBar == "TabItemPageEdit")//如果是页面编辑则进入页面编辑模式
+
                     {
                         EnterToolMode(barContentByTabItem[currentBar]);
                         isInPageEdit = true;
@@ -434,6 +458,7 @@ namespace PDF_Office.ViewModels
         private void Undo()
         {
             if (isInPageEdit)
+
             {
                 //执行页面编辑的Undo
                 PageEditUndo?.Invoke();
@@ -447,6 +472,7 @@ namespace PDF_Office.ViewModels
         private void Redo()
         {
             if (isInPageEdit)
+
             {
                 //执行页面编辑的Redo
                 PageEditRedo?.Invoke();
@@ -466,6 +492,7 @@ namespace PDF_Office.ViewModels
                 parameters.Add(ParameterNames.PDFViewer, PDFViewer);
                 parameters.Add(ParameterNames.ViewContentViewModel, this);
                 region.RequestNavigate(BOTARegionName, "BOTAContent", parameters);
+
             }
             ));
         }
@@ -670,10 +697,12 @@ namespace PDF_Office.ViewModels
         /// 显示前添加内容到Region
         /// </summary>
         /// <param name="isPageEdit"></param>
-        private void ShowContent(string currentBar, bool isToolMode = false)
+
+        private void ShowContent(string currentBar,bool isToolMode=false)
         {
+            GridVisibility = Visibility.Visible;
             //显示页面编辑或其他工具
-            if (currentBar == "TabItemPageEdit" || isToolMode)
+            if (currentBar == "TabItemPageEdit"||isToolMode)
             {
                 if (currentBar == "TabItemPageEdit")//进入页面编辑
                 {
@@ -689,6 +718,7 @@ namespace PDF_Office.ViewModels
                 }
                 else//进入水印等其他工具模式
                 {
+                    GridVisibility = Visibility.Collapsed;
                     if (GridToolRow != 0)
                     {
                         GridToolRow = 0;
@@ -719,13 +749,18 @@ namespace PDF_Office.ViewModels
         /// <param name="EditToolName"></param>
         private void EnterEditTools(string EditToolName)
         {
-            if (EditToolName == "SetBackground")
-            {
-                ToolRowHeight = 0;
-                PropertyColumnWidth = 260;
-            }
+            EnterSelectedEditTool(EditToolName);
+        }
+        private void EnterSelectedEditTool(string EditToolName)
+        {
+            currentBar = EditToolName;
+            EnterToolMode(EditToolName);
+        }
+        private void CloseEditTool()
+        {
+            currentBar = "TabItemTool";
+            EnterSelectedBar(currentBar);
         }
-
         /// <summary>
         /// 进入工具编辑(如页面编辑、水印、密文等)模式
         /// </summary> 
@@ -748,6 +783,7 @@ namespace PDF_Office.ViewModels
             region.RequestNavigate(ToolContentRegionName, targetToolMode, param);
             ShowContent(currentBar, true);
 
+
             IsLoading = Visibility.Collapsed;
         }
 

+ 62 - 31
PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml

@@ -1,43 +1,74 @@
-<UserControl x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterCSVDialog"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-             xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-             xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
-             xmlns:prism="http://prismlibrary.com/"           
-             Width="529"
-             Height="416"
-             d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
-             d:DesignHeight="416"
-             d:DesignWidth="529"
-             prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             mc:Ignorable="d">
+<UserControl
+    x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterCSVDialog"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:converterdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.ConverterDialogs"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
+    xmlns:prism="http://prismlibrary.com/"
+    Width="529"
+    Height="416"
+    d:DataContext="{d:DesignInstance Type=converterdialogs:ConverterCSVDialogViewModel}"
+    d:DesignHeight="416"
+    d:DesignWidth="529"
+    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
     <cus:DialogContent Header="PDF转CSV">
         <cus:DialogContent.Content>
             <Grid Grid.Row="1">
                 <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="212"/>
-                    <ColumnDefinition Width="*"/>
+                    <ColumnDefinition Width="212" />
+                    <ColumnDefinition Width="*" />
                 </Grid.ColumnDefinitions>
                 <Grid Grid.Column="0">
-                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
+                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" />
                 </Grid>
                 <Grid Grid.Column="1">
                     <StackPanel Margin="18,16,0,0">
                         <StackPanel>
-                            <RadioButton Name="ForEachPageRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForEachPageRadioBtn,Path=Name}">
-                                <TextBlock Text="将每个页面转换为一个单独的文档"/>
+                            <RadioButton
+                                Name="ForEachPageRadioBtn"
+                                Command="{Binding RadioButtonCommand}"
+                                CommandParameter="{Binding ElementName=ForEachPageRadioBtn, Path=Name}">
+                                <TextBlock Text="将每个页面转换为一个单独的文档" />
                             </RadioButton>
-                            <RadioButton Margin="0,6,0,0" Name="OnlyTableRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForTheDocRadioBtn,Path=Name}">
-                                <TextBlock Text="只提取表格"/>
+                            <RadioButton
+                                Name="OnlyTableRadioBtn"
+                                Margin="0,6,0,0"
+                                Command="{Binding RadioButtonCommand}"
+                                CommandParameter="{Binding ElementName=ForTheDocRadioBtn, Path=Name}">
+                                <TextBlock Text="只提取表格" />
                             </RadioButton>
                         </StackPanel>
-                        <StackPanel Orientation="Vertical" Margin="0,14,0,0">
-                            <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
-                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                        <StackPanel Margin="0,14,0,0" Orientation="Vertical">
+                            <TextBlock
+                                Width="48"
+                                Height="20"
+                                HorizontalAlignment="Left"
+                                Text="页面范围" />
+                            <cus:WritableComboBox
+                                x:Name="PageRangeComboBox"
+                                Width="228"
+                                Height="28.55"
+                                Margin="0,4,0,0"
+                                HorizontalAlignment="Left"
+                                IsCurrentPage="True"
+                                Loaded="PageRangeComboBox_Loaded"
+                                SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}"
+                                Text="{Binding PageRangeText, Mode=TwoWay}">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
                             </cus:WritableComboBox>
                         </StackPanel>
                     </StackPanel>
@@ -51,15 +82,15 @@
                     Height="32"
                     Margin="0,0,124,0"
                     HorizontalAlignment="Right"
-                    Content="取消" 
-                    Command="{Binding CancelCommand}"/>
+                    Command="{Binding CancelCommand}"
+                    Content="取消" />
                 <Button
                     Width="98"
                     Height="32"
                     Margin="16,0"
                     HorizontalAlignment="Right"
-                    Content="转换" 
-                    Command = "{Binding ConverterCommnad}"/>
+                    Command="{Binding ConverterCommnad}"
+                    Content="转换" />
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

+ 0 - 64
PDF Office/Views/Dialog/ConverterDialogs/ConverterCSVDialog.xaml.cs

@@ -42,70 +42,6 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
                 PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
                 
             }
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
-        }
-
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterCSVDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterCSVDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterCSVDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-           
-            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                ConverterPreview.PageIndexLists.Add(0);
-
-                return;
-            }
-            else {
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-                ConverterPreview.CurrentIndex = 0;
-                ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-                ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
-            }
-            
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) {
-            
-            string PageRangeSelectIndex = ((ConverterCSVDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterCSVDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText=((ConverterCSVDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-                
-            }
-            if (PageRangeSelectIndex == "1") {
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex]+1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-               ((ConverterCSVDialogViewModel)this.DataContext).CurrentPageIndex= (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            }
-            ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            ConverterPreview.CurrentIndex = 0;
-            ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
         }
     }
 }

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

@@ -3,6 +3,7 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
@@ -30,7 +31,7 @@
                         <StackPanel Orientation="Vertical">
                             <TextBlock Text="Excel工作簿设置:" Height="20"/>
                             <StackPanel Orientation="Vertical" Margin="0,7,0,0">
-                                <RadioButton Name="ForEachPageRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForEachPageRadioBtn,Path=Name}">
+                                <RadioButton Name="ForEachPageRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForEachPageRadioBtn,Path=Name}" IsChecked="True">
                                     <TextBlock Text="将每个页面转换为一个单独的工作表"/>
                                 </RadioButton>
                                 <RadioButton Margin="0,6,0,0" Name="ForTheDocRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForTheDocRadioBtn,Path=Name}">
@@ -58,6 +59,14 @@
                             <StackPanel Orientation="Vertical" Margin="0,14,0,0">
                                 <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
                                 <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                                    <i:Interaction.Triggers>
+                                        <i:EventTrigger EventName="SelectionChanged">
+                                            <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                        </i:EventTrigger>
+                                        <i:EventTrigger EventName="TextChanged">
+                                            <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                        </i:EventTrigger>
+                                    </i:Interaction.Triggers>
                                 </cus:WritableComboBox>
                             </StackPanel>
                         </StackPanel>

+ 0 - 67
PDF Office/Views/Dialog/ConverterDialogs/ConverterExcelDialog.xaml.cs

@@ -42,73 +42,6 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
                 PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
 
             }
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
-        }
-
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterExcelDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterExcelDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterExcelDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-
-            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                ConverterPreview.PageIndexLists.Add(0);
-
-                return;
-            }
-            else
-            {
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-                ConverterPreview.CurrentIndex = 0;
-                ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-                ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
-            }
-
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterExcelDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterExcelDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterExcelDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-
-            }
-            if (PageRangeSelectIndex == "1")
-            {
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-               ((ConverterExcelDialogViewModel)this.DataContext).CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            }
-            ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            ConverterPreview.CurrentIndex = 0;
-            ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
         }
 
         private void OnlyTableComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)

+ 9 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml

@@ -3,6 +3,7 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
@@ -38,6 +39,14 @@
                         <StackPanel Orientation="Vertical" Margin="0,14,0,0">
                             <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
                             <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
                             </cus:WritableComboBox>
                         </StackPanel>
                     </StackPanel>

+ 0 - 67
PDF Office/Views/Dialog/ConverterDialogs/ConverterHTMLDialog.xaml.cs

@@ -42,73 +42,6 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
                 PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
 
             }
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
-        }
-
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterHTMLDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterHTMLDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterHTMLDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-
-            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                ConverterPreview.PageIndexLists.Add(0);
-
-                return;
-            }
-            else
-            {
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-                ConverterPreview.CurrentIndex = 0;
-                ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-                ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
-            }
-
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterHTMLDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterHTMLDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterHTMLDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-
-            }
-            if (PageRangeSelectIndex == "1")
-            {
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-               ((ConverterHTMLDialogViewModel)this.DataContext).CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            }
-            ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            ConverterPreview.CurrentIndex = 0;
-            ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
         }
     }
 }

+ 74 - 30
PDF Office/Views/Dialog/ConverterDialogs/ConverterImgDialog.xaml

@@ -1,45 +1,89 @@
-<UserControl x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterImgDialog"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:cus="clr-namespace:PDF_Office.CustomControl"
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-             xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
-             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-             xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
-             xmlns:prism="http://prismlibrary.com/"           
-             Width="480"
-             Height="416"
-             d:DataContext="{d:DesignInstance Type=pageeditdialogs:ExtractDialogViewModel}"
-             d:DesignHeight="416"
-             d:DesignWidth="480"
-             prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
-             prism:ViewModelLocator.AutoWireViewModel="True"
-             mc:Ignorable="d">
+<UserControl
+    x:Class="PDF_Office.Views.Dialog.ConverterDialogs.ConverterImgDialog"
+    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+    xmlns:converterdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.ConverterDialogs"
+    xmlns:cus="clr-namespace:PDF_Office.CustomControl"
+    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+    xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
+    xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
+    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+    xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
+    xmlns:prism="http://prismlibrary.com/"
+    Width="480"
+    Height="416"
+    d:DataContext="{d:DesignInstance Type=converterdialogs:ConverterImgDialogViewModel}"
+    d:DesignHeight="416"
+    d:DesignWidth="480"
+    prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
+    prism:ViewModelLocator.AutoWireViewModel="True"
+    mc:Ignorable="d">
     <cus:DialogContent Header="PDF转图片">
         <cus:DialogContent.Content>
             <Grid Grid.Row="1">
                 <Grid.ColumnDefinitions>
-                    <ColumnDefinition Width="212"/>
-                    <ColumnDefinition Width="*"/>
+                    <ColumnDefinition Width="212" />
+                    <ColumnDefinition Width="*" />
                 </Grid.ColumnDefinitions>
                 <Grid Grid.Column="0">
-                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded"></cus:PageTurningPreview>
+                    <cus:PageTurningPreview x:Name="ConverterPreview" Loaded="ConverterPreview_Loaded" />
                 </Grid>
                 <Grid Grid.Column="1">
                     <StackPanel Margin="18,16,0,0">
                         <StackPanel>
-                            <TextBlock Text="文件类型" Height="20" Width="48" HorizontalAlignment="Left" />
-                            <ComboBox Name="ImageTypeComboBox" Height="32" Width="228" HorizontalAlignment="Left" Margin="0,8,0,0" ItemsSource="{Binding ImageTypeFamily}" SelectedIndex="0" SelectionChanged="ImageTypeComboBox_SelectionChanged"></ComboBox>
-                            <ComboBox Name="ImageDPIComboBox" Height="32" Width="228" HorizontalAlignment="Left" Margin="0,8,0,0" ItemsSource="{Binding ImageDPIFamily}" SelectedIndex="0" SelectionChanged="ImageDPIComboBox_SelectionChanged"></ComboBox>
+                            <TextBlock
+                                Width="48"
+                                Height="20"
+                                HorizontalAlignment="Left"
+                                Text="文件类型" />
+                            <ComboBox
+                                Name="ImageTypeComboBox"
+                                Width="228"
+                                Height="32"
+                                Margin="0,8,0,0"
+                                HorizontalAlignment="Left"
+                                ItemsSource="{Binding ImageTypeFamily}"
+                                SelectedIndex="{Binding ImageTypeSelectedIndex, Mode=TwoWay}"
+                                />
+                            <ComboBox
+                                Name="ImageDPIComboBox"
+                                Width="228"
+                                Height="32"
+                                Margin="0,8,0,0"
+                                HorizontalAlignment="Left"
+                                ItemsSource="{Binding ImageDPIFamily}"
+                                SelectedIndex="{Binding ImageDPISelectedIndex, Mode=TwoWay}"
+                                />
                         </StackPanel>
                         <StackPanel Margin="0,16,0,0">
-                            <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
-                            <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="32" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                            <TextBlock
+                                Width="48"
+                                Height="20"
+                                HorizontalAlignment="Left"
+                                Text="页面范围" />
+                            <cus:WritableComboBox
+                                x:Name="PageRangeComboBox"
+                                Width="228"
+                                Height="32"
+                                Margin="0,4,0,0"
+                                HorizontalAlignment="Left"
+                                IsCurrentPage="True"
+                                Loaded="PageRangeComboBox_Loaded"
+                                SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}"
+                                Text="{Binding PageRangeText, Mode=TwoWay}" >
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
                             </cus:WritableComboBox>
                         </StackPanel>
                     </StackPanel>
                 </Grid>
-            </Grid> 
+            </Grid>
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
             <Grid>
@@ -48,15 +92,15 @@
                     Height="32"
                     Margin="0,0,124,0"
                     HorizontalAlignment="Right"
-                    Content="取消" 
-                    Command="{Binding CancelCommand}"/>
+                    Command="{Binding CancelCommand}"
+                    Content="取消" />
                 <Button
                     Width="98"
                     Height="32"
                     Margin="16,0"
                     HorizontalAlignment="Right"
-                    Content="转换" 
-                    Command = "{Binding ConverterCommnad}"/>
+                    Command="{Binding ConverterCommnad}"
+                    Content="转换" />
             </Grid>
         </cus:DialogContent.BottmBar>
     </cus:DialogContent>

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

@@ -43,132 +43,7 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
                 PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
 
             }
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
         }
 
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterImgDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterImgDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterImgDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-
-            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                ConverterPreview.PageIndexLists.Add(0);
-
-                return;
-            }
-            else
-            {
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-                ConverterPreview.CurrentIndex = 0;
-                ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-                ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
-            }
-
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterImgDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterImgDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterImgDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-
-            }
-            if (PageRangeSelectIndex == "1")
-            {
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-               ((ConverterImgDialogViewModel)this.DataContext).CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            }
-            ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            ConverterPreview.CurrentIndex = 0;
-            ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
-        }
-
-        private void ImageTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-            switch (ImageTypeComboBox.SelectedIndex)
-            {
-                case 0:
-                    ((ConverterImgDialogViewModel)this.DataContext).ConverterImgModel.Type = ImgType.JPEG;
-                    break;
-                case 1:
-                    ((ConverterImgDialogViewModel)this.DataContext).ConverterImgModel.Type = ImgType.JPEG;
-                    break;
-                case 2:
-                    ((ConverterImgDialogViewModel)this.DataContext).ConverterImgModel.Type = ImgType.PNG;
-                    break;
-                case 3:
-                    ((ConverterImgDialogViewModel)this.DataContext).ConverterImgModel.Type = ImgType.JPEG;
-                    break;
-                case 4:
-                    ((ConverterImgDialogViewModel)this.DataContext).ConverterImgModel.Type = ImgType.JPEG;
-                    break;
-                case 5:
-                    ((ConverterImgDialogViewModel)this.DataContext).ConverterImgModel.Type = ImgType.JPEG;
-                    break;
-                case 6:
-                    ((ConverterImgDialogViewModel)this.DataContext).ConverterImgModel.Type = ImgType.JPEG;
-                    break;
-                case 7:
-                    ((ConverterImgDialogViewModel)this.DataContext).ConverterImgModel.Type = ImgType.JPEG;
-                    break;
-                default:
-                    break;
-            }
-        }
-        private void ImageDPIComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-            switch (ImageDPIComboBox.SelectedIndex)
-            {
-                case 0:
-                    Trace.WriteLine("50");
-                    break;
-                case 1:
-                    Trace.WriteLine("72");
-                    break;
-                case 2:
-                    Trace.WriteLine("96");
-                    break;
-                case 3:
-                    Trace.WriteLine("150");
-                    break;
-                case 4:
-                    Trace.WriteLine("300");
-                    break;
-                case 5:
-                    Trace.WriteLine("600");
-                    break;
-                default:
-                    break;
-            }
-        }
     }
 }

+ 9 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterPPTDialog.xaml

@@ -3,6 +3,7 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
@@ -38,6 +39,14 @@
                         <StackPanel Orientation="Vertical" Margin="0,14,0,0">
                             <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
                             <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
                             </cus:WritableComboBox>
                         </StackPanel>
                     </StackPanel>

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

@@ -42,73 +42,6 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
                 PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
 
             }
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
-        }
-
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterPPTDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterPPTDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterPPTDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-
-            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                ConverterPreview.PageIndexLists.Add(0);
-
-                return;
-            }
-            else
-            {
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-                ConverterPreview.CurrentIndex = 0;
-                ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-                ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
-            }
-
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterPPTDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterPPTDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterPPTDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-
-            }
-            if (PageRangeSelectIndex == "1")
-            {
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-               ((ConverterPPTDialogViewModel)this.DataContext).CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            }
-            ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            ConverterPreview.CurrentIndex = 0;
-            ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
         }
     }
 }

+ 9 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml

@@ -3,6 +3,7 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
@@ -38,6 +39,14 @@
                         <StackPanel Orientation="Vertical" Margin="0,14,0,0">
                             <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
                             <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
                             </cus:WritableComboBox>
                         </StackPanel>
                     </StackPanel>

+ 0 - 65
PDF Office/Views/Dialog/ConverterDialogs/ConverterRTFDialog.xaml.cs

@@ -43,71 +43,6 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
                 PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
 
             }
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
-        }
-
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-            
-            string PageRangeSelectIndex = ((ConverterRTFDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterRTFDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterRTFDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                ConverterPreview.PageIndexLists.Add(0);
-                return;
-            }
-            else
-            {
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-                ConverterPreview.CurrentIndex = 0;
-                ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-                ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
-            }
-
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterRTFDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterRTFDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterRTFDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-
-            }
-            if (PageRangeSelectIndex == "1")
-            {
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-               ((ConverterRTFDialogViewModel)this.DataContext).CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            }
-            ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            ConverterPreview.CurrentIndex = 0;
-            ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
         }
     }
 }

+ 9 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterTextDialog.xaml

@@ -3,6 +3,7 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
@@ -38,6 +39,14 @@
                         <StackPanel Orientation="Vertical" Margin="0,14,0,0">
                             <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
                             <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
                             </cus:WritableComboBox>
                         </StackPanel>
                     </StackPanel>

+ 0 - 67
PDF Office/Views/Dialog/ConverterDialogs/ConverterTextDialog.xaml.cs

@@ -42,73 +42,6 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
                 PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
 
             }
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
-        }
-
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterTextDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterTextDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterTextDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-
-            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                ConverterPreview.PageIndexLists.Add(0);
-
-                return;
-            }
-            else
-            {
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-                ConverterPreview.CurrentIndex = 0;
-                ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-                ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
-            }
-
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterTextDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterTextDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterTextDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-
-            }
-            if (PageRangeSelectIndex == "1")
-            {
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-               ((ConverterTextDialogViewModel)this.DataContext).CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            }
-            ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            ConverterPreview.CurrentIndex = 0;
-            ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
         }
     }
 }

+ 9 - 0
PDF Office/Views/Dialog/ConverterDialogs/ConverterWordDialog.xaml

@@ -3,6 +3,7 @@
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:local="clr-namespace:PDF_Office.Views.Dialog.PageEditDialogs"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:pageeditdialogs="clr-namespace:PDF_Office.ViewModels.Dialog.PageEditDialogs"
@@ -50,6 +51,14 @@
                             <StackPanel Orientation="Vertical" Margin="0,14,0,0">
                                 <TextBlock Text="页面范围" Height="20" Width="48" HorizontalAlignment="Left"/>
                                 <cus:WritableComboBox x:Name="PageRangeComboBox" Margin="0,4,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" IsCurrentPage="True" Text="{Binding PageRangeText, Mode=TwoWay}"  SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="PageRangeComboBox_Loaded">
+                                    <i:Interaction.Triggers>
+                                        <i:EventTrigger EventName="SelectionChanged">
+                                            <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                        </i:EventTrigger>
+                                        <i:EventTrigger EventName="TextChanged">
+                                            <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ConverterPreview}" />
+                                        </i:EventTrigger>
+                                    </i:Interaction.Triggers>
                                 </cus:WritableComboBox>
                             </StackPanel>
                         </StackPanel>

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

@@ -42,73 +42,6 @@ namespace PDF_Office.Views.Dialog.ConverterDialogs
                 PageRangeComboBox.writableComboBox.Items.Insert(1, comboBoxItem);
 
             }
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
-        }
-
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterWordDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterWordDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterWordDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-
-            if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                ConverterPreview.PageIndexLists.Add(0);
-
-                return;
-            }
-            else
-            {
-                ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-                ConverterPreview.CurrentIndex = 0;
-                ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-                ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
-            }
-
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((ConverterWordDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((ConverterWordDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((ConverterWordDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "2" || PageRangeSelectIndex == "3")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, true);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-
-            }
-            if (PageRangeSelectIndex == "1")
-            {
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString(), currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-               ((ConverterWordDialogViewModel)this.DataContext).CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            }
-            ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
-            ConverterPreview.CurrentIndex = 0;
-            ConverterPreview.CurrentPage.Text = (ConverterPreview.PageIndexLists[ConverterPreview.CurrentIndex] + 1).ToString();
-            ConverterPreview.AwaitRenderBitmap(ConverterPreview.document);
         }
     }
 }

+ 16 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSV.xaml

@@ -0,0 +1,16 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter.HomePageConverterCSV"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True">
+    <Grid>
+        <StackPanel Width="245">
+            <RadioButton Name="ForEachPageRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForEachPageRadioBtn,Path=Name}">
+                <TextBlock Text="将每个页面转换为一个单独的文档"/>
+            </RadioButton>
+            <RadioButton Margin="0,6,0,0" Name="OnlyTableRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForTheDocRadioBtn,Path=Name}">
+                <TextBlock Text="只提取表格"/>
+            </RadioButton>
+        </StackPanel>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterCSV.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    /// <summary>
+    /// Interaction logic for HomePageConverterCSV
+    /// </summary>
+    public partial class HomePageConverterCSV : UserControl
+    {
+        public HomePageConverterCSV()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 136 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml

@@ -0,0 +1,136 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter.HomePageConverterDialog"
+            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:convert="clr-namespace:PDF_Office.DataConvert"
+             d:DesignHeight="462"
+             d:DesignWidth="892"
+             mc:Ignorable="d">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <Grid IsEnabled="{Binding ConverterGridIsEnabled}">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="632"/>
+            <ColumnDefinition Width="260"/>
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="398"/>
+                <RowDefinition Height="72"/>
+            </Grid.RowDefinitions>
+            <Button Name="BtnBlank" Grid.Row="0" Background="Green" Height="300" Width="300" Visibility="{Binding AddFileVisibility}" Command="{Binding ADDPDFCommand}" >
+            </Button>
+            <ListView x:Name="listView" DataContext="{Binding PDFDataTable,Mode=TwoWay}" Grid.Row="0" Background="White"  ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}">
+                <ListView.ContextMenu>
+                    <ContextMenu  StaysOpen="True" >
+                        <MenuItem Header="打开文件" Name="OpenFileMenuItem"  Click="OpenFileMenuItem_Click"/>
+                        <MenuItem Header="移除" Name="RemoveFileMenuItem" Click="RemoveFileMenuItem_Click"/>
+                    </ContextMenu>
+                </ListView.ContextMenu>
+                <ListView.View>
+                    <GridView>
+                        <GridViewColumn  Header="文档名"  Width="400" DisplayMemberBinding="{Binding FileName}"/>
+                        <GridViewColumn Header="大小" Width="100" DisplayMemberBinding="{Binding FileSize}"/>
+                        <GridViewColumn Header="状态" Width="80" >
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding FileState}" TextDecorations="Underline" Foreground="Black"/>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                    </GridView>
+                </ListView.View>
+                <ListView.ItemContainerStyle>
+                    <Style TargetType="ListViewItem">
+                        <Setter Property="Height" Value="42"/>
+                        <Style.Triggers>
+                            <Trigger Property="ListView.AlternationIndex" Value="1">
+                                <Setter Property="Background" Value="LightGray"/>
+                            </Trigger>
+                        </Style.Triggers>
+                    </Style>
+                </ListView.ItemContainerStyle>
+            </ListView>
+            <Grid Grid.Row="1">
+                <Button x:Name="MenuBtn"  Width="113"
+                    Height="40"
+                    Margin="25,0,0,0"
+                    HorizontalAlignment="Left" Click="Menu_Click">
+                    <StackPanel Orientation="Horizontal" >
+                        <Border HorizontalAlignment="Right">
+                            <TextBlock Text="添加文件" FontSize="18" Foreground="Black"></TextBlock>
+                        </Border>
+                        <Border  Margin="12,0,0,0">
+                            <Path  VerticalAlignment="Center" HorizontalAlignment="Right" Stroke="Black"  Data="M0 0L8 4 L16 0" Height="10" Stretch="Fill" />
+                        </Border>
+                    </StackPanel>
+                </Button>
+                <Popup x:Name="menuPop1" StaysOpen="False"  AllowsTransparency="True" PlacementTarget="{Binding ElementName=MenuBtn}">
+                    <Grid Height="auto" Width="auto" HorizontalAlignment="Left">
+                        <Border BorderThickness="0" CornerRadius="3" Background="White" Margin="3">
+                            <Border.Effect>
+                                <DropShadowEffect ShadowDepth="0" Color="#FFB6B6B6"/>
+                            </Border.Effect>
+                            <StackPanel Margin="0">
+                                <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
+                                <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
+                            </StackPanel>
+                        </Border>
+                    </Grid>
+                </Popup>
+
+                <Button
+                    Width="40"
+                    Height="40"
+                    Margin="0,0,90,0"
+                    HorizontalAlignment="Right">
+
+                </Button>
+                <Button
+                    Width="40"
+                    Height="40"
+                    Margin="25,0"
+                    HorizontalAlignment="Right"
+                    IsEnabled="{Binding RemoveIsEnable}"
+                    Command="{Binding RemovePDFFileCommand}"
+                    >
+
+                </Button>
+            </Grid>
+        </Grid>
+        <Grid Grid.Column="1" Background="WhiteSmoke" IsEnabled="{Binding SetConverterGridIsEnabled}">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="72"/>
+            </Grid.RowDefinitions>
+            <StackPanel Orientation="Vertical" Margin="15,16,0,0" Grid.Row="0">
+                <StackPanel Orientation="Vertical">
+                    <TextBlock Text="转档格式"/>
+                    <ComboBox Name="ConverterTypeComboBox"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left" ItemsSource="{Binding ConverterTypeFamily}" SelectedIndex="0"  SelectionChanged="ConverterTypeComboBox_SelectionChanged">
+                    </ComboBox>
+                </StackPanel>
+                <ContentControl Margin="0,18,0,0" x:Name="PrintMod" prism:RegionManager.RegionName="{Binding ConverterRegionName}"   Visibility="{Binding ConverterVisible}"/>
+                <StackPanel Orientation="Vertical" Margin="0,18,0,0">
+                    <TextBlock Text="文本识别设置:" HorizontalAlignment="Left" Width="84" Height="20"/>
+                    <CheckBox Name="OCRCheckBox"  Margin="0,5,0,0">
+                        <TextBlock Text="在需要时识别文本"/>
+                    </CheckBox>
+                    <ComboBox IsEnabled="{Binding ElementName=OCRCheckBox,Path=IsChecked}"  Margin="0,6,0,0" Width="228" Height="28.55" HorizontalAlignment="Left">
+                    </ComboBox>
+                </StackPanel>
+            </StackPanel>
+            <Grid Grid.Row="2">
+                <Button Height="40" Width="228" Background="Black" Command="{Binding ConvertCommand}">
+                    <TextBlock Text="转档" FontSize="18" Foreground="White"/>
+                </Button>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 66 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialog.xaml.cs

@@ -0,0 +1,66 @@
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
+using Prism.Ioc;
+using Prism.Regions;
+using System.Collections;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    /// <summary>
+    /// Interaction logic for HomePageConverterDialog
+    /// </summary>
+    public partial class HomePageConverterDialog : UserControl
+    {
+        private IContainerProvider containerProvider;
+        public HomePageConverterDialog(IContainerProvider containerProvider)
+        {
+            InitializeComponent();
+            this.containerProvider = containerProvider;
+            var regionManager = containerProvider.Resolve<IRegionManager>();
+            RegionManager.SetRegionManager(this, regionManager);
+            RegionManager.UpdateRegions();
+        }
+        private void Menu_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            menuPop1.IsOpen = true;
+        }
+
+        private void listView_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            IList list = listView.SelectedItems;
+            var lists = listView.Items;
+            System.Data.DataRowView a;
+            ((HomePageConverterDialogViewModel)this.DataContext).fileNamesView.Clear();
+            foreach (var item in list)
+            {
+                a = (System.Data.DataRowView)item;
+                ((HomePageConverterDialogViewModel)this.DataContext).fileNamesView.Add(lists.IndexOf(a));
+            }
+            if (((HomePageConverterDialogViewModel)this.DataContext).fileNamesView.Count > 0)
+            {
+                ((HomePageConverterDialogViewModel)this.DataContext).RemoveIsEnable = "True";
+            }
+            else
+            {
+                ((HomePageConverterDialogViewModel)this.DataContext).RemoveIsEnable = "False";
+            }
+
+        }
+
+        private void RemoveFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            ((HomePageConverterDialogViewModel)this.DataContext).removepdffile();
+        }
+
+        private void OpenFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            ((HomePageConverterDialogViewModel)this.DataContext).openfiledialog();
+        }
+
+        private void ConverterTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            ((HomePageConverterDialogViewModel)this.DataContext).ChangeConverter(ConverterTypeComboBox.SelectedIndex);
+        }
+    }
+}

+ 27 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcel.xaml

@@ -0,0 +1,27 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter.HomePageConverterExcel"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True">
+    <Grid>
+        <StackPanel Orientation="Vertical" Width="245">
+            <TextBlock Text="Excel工作簿设置:" Height="20"/>
+            <StackPanel Orientation="Vertical" Margin="0,7,0,0">
+                <RadioButton Name="ForEachPageRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForEachPageRadioBtn,Path=Name}">
+                    <TextBlock Text="将每个页面转换为一个单独的工作表"/>
+                </RadioButton>
+                <RadioButton Margin="0,6,0,0" Name="ForTheDocRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=ForTheDocRadioBtn,Path=Name}">
+                    <TextBlock Text="将所有页面转换为一个工作表格式"/>
+                </RadioButton>
+                <RadioButton Margin="0,10,0,0" Name="OnlyTableRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=OnlyTableRadioBtn,Path=Name}">
+                    <TextBlock Text="只提取表格"/>
+                </RadioButton>
+                <ComboBox Name="OnlyTableComboBox" Margin="0,8,0,0" Width="228" Height="28.55" IsEnabled="{Binding ElementName=OnlyTableRadioBtn,Path=IsChecked}" SelectionChanged="OnlyTableComboBox_SelectionChanged">
+                    <ComboBoxItem Content="支持一个表格提取到单独的工作表"/>
+                    <ComboBoxItem Content="支持按页面提取表格到单独的工作表"/>
+                    <ComboBoxItem Content="支持将所有表格提取到一个工作表"/>
+                </ComboBox>
+            </StackPanel>
+        </StackPanel>
+    </Grid>
+</UserControl>

+ 36 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterExcel.xaml.cs

@@ -0,0 +1,36 @@
+using ComPDFKit_Conversion.Options;
+using PDF_Office.ViewModels.Dialog.ConverterDialogs;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    /// <summary>
+    /// Interaction logic for HomePageConverterExcel
+    /// </summary>
+    public partial class HomePageConverterExcel : UserControl
+    {
+        public HomePageConverterExcel()
+        {
+            InitializeComponent();
+        }
+
+        private void OnlyTableComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            switch (OnlyTableComboBox.SelectedIndex)
+            {
+                case 0:
+                    ((HomePageConverterExcelViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ((HomePageConverterExcelViewModel)this.DataContext).ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachTable, ContentOptions.OnlyTable);
+                    break;
+                case 1:
+                    ((HomePageConverterExcelViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ((HomePageConverterExcelViewModel)this.DataContext).ConverterExcelModel.ExcelOptions(WorksheetOptions.ForEachPage, ContentOptions.OnlyTable);
+                    break;
+                case 2:
+                    ((HomePageConverterExcelViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterExcelModel.excelOption = ((HomePageConverterExcelViewModel)this.DataContext).ConverterExcelModel.ExcelOptions(WorksheetOptions.ForTheDocument, ContentOptions.OnlyTable);
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+}

+ 13 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImg.xaml

@@ -0,0 +1,13 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter.HomePageConverterImg"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True">
+    <Grid>
+        <StackPanel Width="245">
+            <TextBlock Text="文件类型" Height="20" Width="48" HorizontalAlignment="Left" />
+            <ComboBox Name="ImageTypeComboBox" Height="32" Width="228" HorizontalAlignment="Left" Margin="0,8,0,0" ItemsSource="{Binding ImageTypeFamily}" SelectedIndex="0" SelectionChanged="ImageTypeComboBox_SelectionChanged"></ComboBox>
+            <ComboBox Name="ImageDPIComboBox" Height="32" Width="228" HorizontalAlignment="Left" Margin="0,8,0,0" ItemsSource="{Binding ImageDPIFamily}" SelectedIndex="0" SelectionChanged="ImageDPIComboBox_SelectionChanged"></ComboBox>
+        </StackPanel>
+    </Grid>
+</UserControl>

+ 79 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterImg.xaml.cs

@@ -0,0 +1,79 @@
+using ComPDFKit_Conversion.Converter;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter;
+using System.Diagnostics;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    /// <summary>
+    /// Interaction logic for HomePageConverterImg
+    /// </summary>
+    public partial class HomePageConverterImg : UserControl
+    {
+        public HomePageConverterImg()
+        {
+            InitializeComponent();
+        }
+
+        private void ImageTypeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            if (((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel==null)
+                return;
+            switch (ImageTypeComboBox.SelectedIndex)
+            {
+                case 0:
+                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
+                    break;
+                case 1:
+                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
+                    break;
+                case 2:
+                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.PNG;
+                    break;
+                case 3:
+                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
+                    break;
+                case 4:
+                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
+                    break;
+                case 5:
+                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
+                    break;
+                case 6:
+                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
+                    break;
+                case 7:
+                    ((HomePageConverterImgViewModel)this.DataContext).homePageConverterDialogViewModel.ConverterImgModel.Type = ImgType.JPEG;
+                    break;
+                default:
+                    break;
+            }
+        }
+        private void ImageDPIComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
+        {
+            switch (ImageDPIComboBox.SelectedIndex)
+            {
+                case 0:
+                    Trace.WriteLine("50");
+                    break;
+                case 1:
+                    Trace.WriteLine("72");
+                    break;
+                case 2:
+                    Trace.WriteLine("96");
+                    break;
+                case 3:
+                    Trace.WriteLine("150");
+                    break;
+                case 4:
+                    Trace.WriteLine("300");
+                    break;
+                case 5:
+                    Trace.WriteLine("600");
+                    break;
+                default:
+                    break;
+            }
+        }
+    }
+}

+ 19 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWord.xaml

@@ -0,0 +1,19 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter.HomePageConverterWord"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True">
+    <Grid>
+        <StackPanel Orientation="Vertical" Margin="0,16,0,0" HorizontalAlignment="Left" Width="245">
+            <TextBlock Text="版面设置:" Width="60" Height="20" HorizontalAlignment="Left"/>
+            <StackPanel Orientation="Vertical" Margin="0,7,0,0">
+                <RadioButton Name="FlowingTextRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=FlowingTextRadioBtn,Path=Name}">
+                    <TextBlock Text="保留流排文本"/>
+                </RadioButton>
+                <RadioButton  Margin="0,15,0,0" Name="PageLayoutRadioBtn" Command="{Binding RadioButtonCommand}" CommandParameter="{Binding ElementName=PageLayoutRadioBtn,Path=Name}">
+                    <TextBlock Text="保留页面布局"/>
+                </RadioButton>
+            </StackPanel>
+        </StackPanel>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterWord.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageConverter
+{
+    /// <summary>
+    /// Interaction logic for HomePageConverterWord
+    /// </summary>
+    public partial class HomePageConverterWord : UserControl
+    {
+        public HomePageConverterWord()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 11 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageExtractDialog.xaml

@@ -1,6 +1,7 @@
 <UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageExtractDialog"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
@@ -35,7 +36,16 @@
                     <Grid Grid.Row="0">
                         <StackPanel Orientation="Vertical" Margin="0,40,0,0">
                             <TextBlock Text="页面范围" FontWeight="ExtraBlack" Width="56" Height="22" HorizontalAlignment="Left"/>
-                            <cus:WritableComboBox x:Name="PageRangeComboBox" Width="208" Height="32" HorizontalAlignment="Left" Margin="0,20,0,0" Text="{Binding PageRangeText,Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex,Mode=TwoWay}" Loaded="WritableComboBox_Loaded"></cus:WritableComboBox>
+                            <cus:WritableComboBox x:Name="PageRangeComboBox" Width="208" Height="32" HorizontalAlignment="Left" Margin="0,20,0,0" Text="{Binding PageRangeText,Mode=TwoWay}" SelectedIndex="{Binding PageRangeSelectIndex,Mode=TwoWay}" >
+                                <i:Interaction.Triggers>
+                                    <i:EventTrigger EventName="SelectionChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=ExtractPreview}" />
+                                    </i:EventTrigger>
+                                    <i:EventTrigger EventName="TextChanged">
+                                        <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=ExtractPreview}" />
+                                    </i:EventTrigger>
+                                </i:Interaction.Triggers>
+                            </cus:WritableComboBox>
                         </StackPanel>
                     </Grid>
                     <Grid Grid.Row="1">

+ 0 - 60
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageExtractDialog.xaml.cs

@@ -45,65 +45,5 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
             ExtractPreview.PageIndex.Text = ExtractPreview.document.PageCount.ToString();
 
         }
-
-        private void WritableComboBox_Loaded(object sender, RoutedEventArgs e)
-        {
-
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
-        }
-
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((HomePageExtractDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((HomePageExtractDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((HomePageExtractDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-
-            if (!CommonHelper.GetPagesInRange(ref ExtractPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                ExtractPreview.PageIndexLists.Add(0);
-
-                return;
-            }
-            else
-            {
-                ExtractPreview.PageIndex.Text = (ExtractPreview.PageIndexLists.Last<int>() + 1).ToString();
-                ExtractPreview.CurrentIndex = 0;
-                ExtractPreview.CurrentPage.Text = (ExtractPreview.PageIndexLists[ExtractPreview.CurrentIndex] + 1).ToString();
-                ExtractPreview.AwaitRenderBitmap(ExtractPreview.document);
-            }
-
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((HomePageExtractDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((HomePageExtractDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((HomePageExtractDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "1" || PageRangeSelectIndex == "2")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref ExtractPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-
-            }
-            ExtractPreview.PageIndex.Text = (ExtractPreview.PageIndexLists.Last<int>() + 1).ToString();
-            ExtractPreview.CurrentIndex = 0;
-            ExtractPreview.CurrentPage.Text = (ExtractPreview.PageIndexLists[ExtractPreview.CurrentIndex] + 1).ToString();
-            ExtractPreview.AwaitRenderBitmap(ExtractPreview.document);
-        }
     }
 }

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

@@ -83,6 +83,7 @@
                     HorizontalAlignment="Right"
                     Command="{Binding InsertCommand}"
                     Content="插入" />
+            <cus:CommonWritableComboBox HorizontalAlignment="Left" Width="66" Height="32"></cus:CommonWritableComboBox>
         </Grid>
     </Grid>
 </UserControl>

+ 11 - 1
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageSplitDialog.xaml

@@ -2,6 +2,7 @@
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
              xmlns:cus="clr-namespace:PDF_Office.CustomControl"
              xmlns:prism="http://prismlibrary.com/"             
@@ -50,7 +51,16 @@
                             <StackPanel Orientation="Horizontal">
                                 <RadioButton VerticalAlignment="Center" IsChecked="{Binding CustomPageRangeIsCheck}" Command="{Binding CustomPageRangeCommand}"></RadioButton>
                                 <TextBlock Text="按特定页面拆分" VerticalAlignment="Center"></TextBlock>
-                                <cus:WritableComboBox x:Name="PageRangeComboBox"  Height="32" Width="183" Text="{Binding PageRangeText, Mode=TwoWay}" IsEnabled="{Binding CustomPageRangeIsEnabled}" SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}" Loaded="WritableComboBox_Loaded"/>
+                                <cus:WritableComboBox x:Name="PageRangeComboBox"  Height="32" Width="183" Text="{Binding PageRangeText, Mode=TwoWay}" IsEnabled="{Binding CustomPageRangeIsEnabled}" SelectedIndex="{Binding PageRangeSelectIndex, Mode=TwoWay}">
+                                    <i:Interaction.Triggers>
+                                        <i:EventTrigger EventName="SelectionChanged">
+                                            <i:InvokeCommandAction Command="{Binding CmbPageSelectionChanged}" CommandParameter="{Binding ElementName=SplitPreview}" />
+                                        </i:EventTrigger>
+                                        <i:EventTrigger EventName="TextChanged">
+                                            <i:InvokeCommandAction Command="{Binding CmbPageTextChanged}" CommandParameter="{Binding ElementName=SplitPreview}" />
+                                        </i:EventTrigger>
+                                    </i:Interaction.Triggers>
+                                </cus:WritableComboBox>
                             </StackPanel>
                         </StackPanel>
                     </Grid>

+ 0 - 60
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageSplitDialog.xaml.cs

@@ -69,65 +69,5 @@ namespace PDF_Office.Views.Dialog.HomePageToolsDialogs
             SplitPreview.PageIndex.Text = SplitPreview.document.PageCount.ToString();
            
         }
-
-        private void WritableComboBox_Loaded(object sender, RoutedEventArgs e)
-        {
-
-            PageRangeComboBox.writableComboBox.SelectionChanged += PageRangeComboBox_SelectionChanged;
-            PageRangeComboBox.writableTextBox.TextChanged += WritableTextBox_TextChanged;
-        }
-
-        private void WritableTextBox_TextChanged(object sender, TextChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((HomePageSplitDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((HomePageSplitDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((HomePageSplitDialogViewModel)this.DataContext).PageRangeText;
-            HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
-            char[] enumerationSeparator = new char[] { ',' };
-            char[] rangeSeparator = new char[] { '-' };
-
-            if (!CommonHelper.GetPagesInRange(ref SplitPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-            { //TODO
-                SplitPreview.PageIndexLists.Add(0);
-
-                return;
-            }
-            else
-            {
-                SplitPreview.PageIndex.Text = (SplitPreview.PageIndexLists.Last<int>() + 1).ToString();
-                SplitPreview.CurrentIndex = 0;
-                SplitPreview.CurrentPage.Text = (SplitPreview.PageIndexLists[SplitPreview.CurrentIndex] + 1).ToString();
-                SplitPreview.AwaitRenderBitmap(SplitPreview.document);
-            }
-
-        }
-
-        private void PageRangeComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
-        {
-
-            string PageRangeSelectIndex = ((HomePageSplitDialogViewModel)this.DataContext).PageRangeSelectIndex;
-            var currentViewer = ((HomePageSplitDialogViewModel)this.DataContext).currentViewer;
-            string PageRange = "";
-            var PageRangeText = ((HomePageSplitDialogViewModel)this.DataContext).PageRangeText;
-            if (PageRangeSelectIndex == "0" || PageRangeSelectIndex == "1" || PageRangeSelectIndex == "2")
-            {
-                HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText);
-                char[] enumerationSeparator = new char[] { ',' };
-                char[] rangeSeparator = new char[] { '-' };
-                if (!CommonHelper.GetPagesInRange(ref SplitPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
-                { //TODO
-                    Trace.WriteLine("输入不对");
-                    MessageBoxEx.Show("输入不对");
-                    return;
-                }
-
-            }
-            SplitPreview.PageIndex.Text = (SplitPreview.PageIndexLists.Last<int>() + 1).ToString();
-            SplitPreview.CurrentIndex = 0;
-            SplitPreview.CurrentPage.Text = (SplitPreview.PageIndexLists[SplitPreview.CurrentIndex] + 1).ToString();
-            SplitPreview.AwaitRenderBitmap(SplitPreview.document);
-        }
     }
 }

+ 0 - 56
PDF Office/Views/EditTools/Background/BackgroundBarContent.xaml

@@ -1,56 +0,0 @@
-<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundBarContent"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:prism="http://prismlibrary.com/"             
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-             prism:ViewModelLocator.AutoWireViewModel="True"
-                          Height="40" Width="1280">
-    <UserControl.Resources>
-        <ResourceDictionary>
-            <ResourceDictionary.MergedDictionaries>
-                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
-            </ResourceDictionary.MergedDictionaries>
-        </ResourceDictionary>
-    </UserControl.Resources>
-    <Grid>
-        <Border x:Name="ToolsBorder" BorderBrush="#1A000000" BorderThickness="0,1,0,1" Height="40">
-            <WrapPanel HorizontalAlignment="Center" Height="40">
-                <Button Style="{StaticResource InsideBarBtnStyle }" Command="{Binding CompressCommand}">
-
-                    <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
-                        <StackPanel Margin="0,0,8,0">
-                            <Border Height="30" Width="30" Background="LightSeaGreen" ></Border>
-                        </StackPanel >
-                        <TextBlock Text="添加背景" VerticalAlignment="Center"></TextBlock>
-                    </StackPanel>
-                </Button>
-                <Button Style="{StaticResource InsideBarBtnStyle }" Command="{Binding CompressCommand}">
-
-                    <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
-                        <StackPanel Margin="0,0,8,0">
-                            <Border Height="30" Width="30" Background="LightSeaGreen" ></Border>
-                        </StackPanel >
-                        <TextBlock Text="移除" VerticalAlignment="Center"></TextBlock>
-                    </StackPanel>
-                </Button>
-
-                <Label Height="10" Width="1" Background="LightGray"></Label>
-                
-                <Button Style="{StaticResource InsideBarBtnStyle }" Command="{Binding CompressCommand}">
-                    <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
-                        <StackPanel Margin="0,0,8,0">
-                            <Border Height="30" Width="30" Background="LightSeaGreen" ></Border>
-                        </StackPanel >
-                        <TextBlock Text="批量" VerticalAlignment="Center"></TextBlock>
-                    </StackPanel>
-                </Button>
-            </WrapPanel>
-        </Border>
-        <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
-            <Button Content="应用" Height="24" Width="44"></Button>
-            <Button Content="关闭" Height="24" Width="44" Margin="16,0,16,0"></Button>
-        </StackPanel>
-    </Grid>
-    
-</UserControl>
-

+ 0 - 15
PDF Office/Views/EditTools/Background/BackgroundBarContent.xaml.cs

@@ -1,15 +0,0 @@
-using System.Windows.Controls;
-
-namespace PDF_Office.Views.EditTools.Background
-{
-    /// <summary>
-    /// Interaction logic for BackgroundBarContent
-    /// </summary>
-    public partial class BackgroundBarContent : UserControl
-    {
-        public BackgroundBarContent()
-        {
-            InitializeComponent();
-        }
-    }
-}

+ 4 - 0
PDF Office/Views/EditTools/Background/BackgroundContent.xaml

@@ -68,9 +68,11 @@
             </Grid.ColumnDefinitions>
             <Grid Grid.Column="0" Background="BurlyWood" >
                 <Border  Height="64" Width="293" HorizontalAlignment="Center"  VerticalAlignment="Bottom"  Panel.ZIndex="1" Margin="9" Background="#323232" CornerRadius="4">
+
                     <Grid>
                         <StackPanel Orientation="Horizontal"  VerticalAlignment="Center">
                             <StackPanel Orientation="Horizontal">
+
                                 <TextBlock Text="-" FontSize="20" Foreground="White" Margin="20,0,20,0"></TextBlock>
                                 <TextBlock Text="+" FontSize="20" Foreground="White" Margin="0,0,39,0"></TextBlock>
                             </StackPanel>
@@ -82,11 +84,13 @@
                             <StackPanel Orientation="Horizontal">
                                 <TextBlock Text="↑" FontSize="20" Foreground="White" Margin="20,0,20,0"></TextBlock>
                                 <TextBlock Text="↓" FontSize="20" Foreground="White"></TextBlock>
+
                             </StackPanel>
                         </StackPanel>
                     </Grid>
                 </Border>
             </Grid>
+
             <Grid Grid.Column="1" Background="Wheat">
                 <ContentControl prism:RegionManager.RegionName="{Binding BackgroundSettingsRegionName}" Visibility="{Binding BackgroundSettingsVisible}"></ContentControl>
             </Grid>

+ 0 - 31
PDF Office/Views/EditTools/Background/BackgroundTemplateContent.xaml

@@ -1,31 +0,0 @@
-<UserControl x:Class="PDF_Office.Views.EditTools.Background.BackgroundTemplateContent"
-             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
-             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
-             xmlns:prism="http://prismlibrary.com/"        
-             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
-             prism:ViewModelLocator.AutoWireViewModel="True"
-                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
-                 mc:Ignorable="d"
-             d:DesignHeight ="720"
-             d:DesignWidth ="260">
-    <Grid>
-        <Grid.RowDefinitions>
-            <RowDefinition Height="56"></RowDefinition>
-            <RowDefinition Height="32"></RowDefinition>
-            <RowDefinition></RowDefinition>
-        </Grid.RowDefinitions>
-        <Grid Grid.Row="0">
-            <StackPanel Orientation="Horizontal">
-                <TextBlock Height="32" Width="24" Margin="16" Text="背景"></TextBlock>
-            </StackPanel>
-        </Grid>
-        <Grid Grid.Row="1">
-            <StackPanel Orientation="Horizontal">
-                
-            </StackPanel>
-        </Grid>
-        <Grid Grid.Row="2" Background="AliceBlue" >
-            
-        </Grid>
-    </Grid>
-</UserControl>

+ 0 - 15
PDF Office/Views/EditTools/Background/BackgroundTemplateContent.xaml.cs

@@ -1,15 +0,0 @@
-using System.Windows.Controls;
-
-namespace PDF_Office.Views.EditTools.Background
-{
-    /// <summary>
-    /// Interaction logic for BackgroundTemplateContent
-    /// </summary>
-    public partial class BackgroundTemplateContent : UserControl
-    {
-        public BackgroundTemplateContent()
-        {
-            InitializeComponent();
-        }
-    }
-}

+ 95 - 0
PDF Office/Views/EditTools/Watermark/WatermarkContent.xaml

@@ -0,0 +1,95 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Watermark.WatermarkContent"
+           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:background="clr-namespace:PDF_Office.ViewModels.EditTools.Background" d:DataContext="{d:DesignInstance Type=background:BackgroundContentViewModel}"
+             mc:Ignorable="d"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             d:DesignHeight="760"
+             d:DesignWidth="1280">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <ResourceDictionary.MergedDictionaries>
+                <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
+            </ResourceDictionary.MergedDictionaries>
+        </ResourceDictionary>
+    </UserControl.Resources>
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="40"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0" Background="AntiqueWhite">
+            <Border x:Name="ToolsBorder" BorderBrush="#1A000000" BorderThickness="0,1,0,1" Height="40">
+                <WrapPanel HorizontalAlignment="Center" Height="40">
+                    <Button Style="{StaticResource InsideBarBtnStyle }">
+
+                        <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
+                            <StackPanel Margin="0,0,8,0">
+                                <Border Height="30" Width="30" Background="LightSeaGreen" ></Border>
+                            </StackPanel >
+                            <TextBlock Text="添加水印" VerticalAlignment="Center"></TextBlock>
+                        </StackPanel>
+                    </Button>
+                    <Button Style="{StaticResource InsideBarBtnStyle }" >
+
+                        <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
+                            <StackPanel Margin="0,0,8,0">
+                                <Border Height="30" Width="30" Background="LightSeaGreen" ></Border>
+                            </StackPanel >
+                            <TextBlock Text="移除" VerticalAlignment="Center"></TextBlock>
+                        </StackPanel>
+                    </Button>
+
+                    <Label Height="10" Width="1" Background="LightGray"></Label>
+
+                    <Button Style="{StaticResource InsideBarBtnStyle }" >
+                        <StackPanel Orientation="Horizontal" Margin="12 0 12 0">
+                            <StackPanel Margin="0,0,8,0">
+                                <Border Height="30" Width="30" Background="LightSeaGreen" ></Border>
+                            </StackPanel >
+                            <TextBlock Text="批量" VerticalAlignment="Center"></TextBlock>
+                        </StackPanel>
+                    </Button>
+                </WrapPanel>
+            </Border>
+            <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
+                <Button Content="应用" Height="24" Width="44" ></Button>
+                <Button Content="关闭" Height="24" Width="44" Margin="16,0,16,0" Command="{Binding CloseEditToolCommand}"></Button>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1" >
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition Width="260"></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Grid Grid.Column="0" Background="DarkSlateBlue" >
+                <Border  Height="64" Width="293" HorizontalAlignment="Center"  VerticalAlignment="Bottom"  Panel.ZIndex="1" Margin="9" Background="#323232" CornerRadius="4">
+
+                    <Grid>
+                        <StackPanel Orientation="Horizontal"  VerticalAlignment="Center">
+                            <StackPanel Orientation="Horizontal">
+
+                                <TextBlock Text="-" FontSize="20" Foreground="White" Margin="20,0,20,0"></TextBlock>
+                                <TextBlock Text="+" FontSize="20" Foreground="White" Margin="0,0,39,0"></TextBlock>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal">
+                                <TextBlock Text="1" FontSize="20" Foreground="White" Margin="0,0,24,0"></TextBlock>
+                                <TextBlock Text="/" FontSize="20" Foreground="White" Margin="0,0,24,0"></TextBlock>
+                                <TextBlock Text="20" FontSize="20" Foreground="White" Margin="0,0,24,0"></TextBlock>
+                            </StackPanel>
+                            <StackPanel Orientation="Horizontal">
+                                <TextBlock Text="↑" FontSize="20" Foreground="White" Margin="20,0,20,0"></TextBlock>
+                                <TextBlock Text="↓" FontSize="20" Foreground="White"></TextBlock>
+
+                            </StackPanel>
+                        </StackPanel>
+                    </Grid>
+                </Border>
+            </Grid>
+            <Grid Grid.Column="1" Background="DarkBlue">
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/EditTools/Watermark/WatermarkContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.EditTools.Watermark
+{
+    /// <summary>
+    /// Interaction logic for WatermarkContent
+    /// </summary>
+    public partial class WatermarkContent : UserControl
+    {
+        public WatermarkContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 53 - 0
PDF Office/Views/EditTools/Watermark/WatermarkCreateBaseContent.xaml

@@ -0,0 +1,53 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Watermark.WatermarkCreateBaseContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             mc:Ignorable="d"
+             d:DesignHeight="720"
+             d:DesignWidth="260" >
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="40"></RowDefinition>
+            <RowDefinition Height="48"></RowDefinition>
+            <RowDefinition></RowDefinition>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+            <Button  Height="24" Width="90" HorizontalAlignment="Left" Margin="16,0,0,0">
+                <StackPanel Orientation="Horizontal">
+                    <TextBlock Text="&lt;" FontSize="16"></TextBlock>
+                    <TextBlock Text="创建水印" Margin="8,0,0,0" FontSize="16"></TextBlock>
+                </StackPanel>
+            </Button>
+            <Button  Height="20" Width="64" Margin="0,0,16,0" HorizontalAlignment="Right" >
+                <StackPanel>
+                    <TextBlock Text="保存至模板" FontSize="12" Foreground="#18A0FB"></TextBlock>
+                    <Rectangle Height="2" Fill="#18A0FB"></Rectangle>
+                </StackPanel>
+            </Button>
+        </Grid>
+        <Grid Grid.Row="1" Margin="16,0,16,0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Button Grid.Column="0">
+                <StackPanel Orientation="Vertical"  >
+                    <TextBlock Text="颜色" FontSize="18"></TextBlock>
+                </StackPanel>
+
+            </Button>
+            <Button Grid.Column="1">
+                <StackPanel Orientation="Vertical"  >
+                    <TextBlock Text="文件" FontSize="18" VerticalAlignment="Center"></TextBlock>
+                </StackPanel>
+            </Button>
+        </Grid>
+        <Grid Grid.Row="2">
+
+        </Grid>
+    </Grid>
+</UserControl>
+

+ 15 - 0
PDF Office/Views/EditTools/Watermark/WatermarkCreateBaseContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.EditTools.Watermark
+{
+    /// <summary>
+    /// Interaction logic for WatermarkCreateBaseContent
+    /// </summary>
+    public partial class WatermarkCreateBaseContent : UserControl
+    {
+        public WatermarkCreateBaseContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 108 - 0
PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml

@@ -0,0 +1,108 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Watermark.WatermarkCreateFileContent"
+            xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             mc:Ignorable="d"
+             d:DesignHeight="632"
+             d:DesignWidth="260" >
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="48"/>
+            <RowDefinition Height="464"/>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0" Width="228" Margin="0,16,0,0">
+            <StackPanel Orientation="Horizontal">
+                <TextBox Name="FileNameTextBox" IsEnabled="False" Text="XXXXXXXXXX.pdf" FontSize="14" VerticalContentAlignment="Center"  Width="188"></TextBox>
+                <Button Content="+" Width="32" Height="32" Margin="8,0,0,0"></Button>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1" Visibility="{Binding ElementName=FileNameTextBox,Path=Text}">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="190"/>
+                <RowDefinition Height="200"/>
+                <RowDefinition Height="74"/>
+            </Grid.RowDefinitions>
+            <Grid Grid.Row="0" Margin="0,23,0,0" Width="228">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="外观" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
+                        <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
+                        <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
+                        <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
+                    </StackPanel>
+                </StackPanel>
+                <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
+                <CheckBox Margin="0,11,0,0" >
+                    <TextBlock Text="相对于页面目标的比例" Width="144" Height="22" FontSize="14"/>
+                </CheckBox>
+                <ComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0"></ComboBox>
+            </StackPanel>
+        </Grid>
+        <Grid  Grid.Row="1"  Margin="0,10,0,0" Width="228">
+            <StackPanel>
+                <TextBlock Text="位置" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <Grid Width="74" Height="74">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                        </Grid.RowDefinitions>
+                        <Button Grid.Column="0" Grid.Row="0"></Button>
+                        <Button Grid.Column="1" Grid.Row="0"></Button>
+                        <Button Grid.Column="2" Grid.Row="0"></Button>
+                        <Button Grid.Column="0" Grid.Row="1"></Button>
+                        <Button Grid.Column="1" Grid.Row="1" Background="Black"></Button>
+                        <Button Grid.Column="2" Grid.Row="1"></Button>
+                        <Button Grid.Column="0" Grid.Row="2"></Button>
+                        <Button Grid.Column="1" Grid.Row="2"></Button>
+                        <Button Grid.Column="2" Grid.Row="2"></Button>
+                    </Grid>
+                    <StackPanel Orientation="Vertical" Margin="70,0,0,0">
+                        <StackPanel Orientation="Horizontal">
+                            <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
+                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        </StackPanel>
+                        <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                            <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
+                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        </StackPanel>
+                    </StackPanel>
+
+                </StackPanel>
+                <CheckBox Margin="0,24,0,0" >
+                    <TextBlock Text="平铺" Width="144" Height="22" FontSize="14"/>
+                </CheckBox>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="" Background="Aquamarine" Width="25" Height="9" VerticalAlignment="Center"/>
+                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" Margin="32,0,0,0">
+                        <TextBlock Background="AntiqueWhite" Width="9" Height="25" VerticalAlignment="Center"/>
+                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                    </StackPanel>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+        <Grid Width="228" Grid.Row="2"  Margin="0,10,0,4">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
+                <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
+            </StackPanel>
+        </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/EditTools/Watermark/WatermarkCreateFileContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.EditTools.Watermark
+{
+    /// <summary>
+    /// Interaction logic for WatermarkCreateFileContent
+    /// </summary>
+    public partial class WatermarkCreateFileContent : UserControl
+    {
+        public WatermarkCreateFileContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 117 - 0
PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml

@@ -0,0 +1,117 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Watermark.WatermarkCreateTextContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             mc:Ignorable="d"
+             d:DesignHeight="632"
+             d:DesignWidth="260" >
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="168"/>
+            <RowDefinition Height="190"/>
+            <RowDefinition Height="200"/>
+            <RowDefinition Height="74"/>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0" Width="228">
+            <StackPanel Orientation="Vertical">
+                <TextBox Height="72" Margin="0,16,0,0" Text="一个水印" FontSize="14"></TextBox>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <ComboBox Width="154" Height="32"></ComboBox>
+                    <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
+                </StackPanel>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <StackPanel Orientation="Horizontal">
+                        <Button Width="34.67" Height="32"></Button>
+                        <Button Width="34.67" Height="32"></Button>
+                        <Button Width="34.67" Height="32"></Button>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" Margin="8,0,0,0">
+                        <Button Width="33" Height="32"></Button>
+                        <Button Width="33" Height="32"></Button>
+                    </StackPanel>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1" Margin="0,16,0,0" Width="228">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="外观" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
+                        <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" Margin="28,0,0,0">
+                        <TextBlock Width="24" Height="24" Background="CadetBlue"></TextBlock>
+                        <ComboBox Width="66" Height="32" Margin="8,0,0,0"></ComboBox>
+                    </StackPanel>
+                </StackPanel>
+                <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
+                <CheckBox Margin="0,11,0,0" >
+                    <TextBlock Text="相对于页面目标的比例" Width="144" Height="22" FontSize="14"/>
+                </CheckBox>
+                <ComboBox Width="66" Height="32" HorizontalAlignment="Left" Margin="0,9,0,0"></ComboBox>
+            </StackPanel>
+        </Grid>
+        <Grid  Grid.Row="2"  Margin="0,10,0,0" Width="228">
+            <StackPanel>
+                <TextBlock Text="位置" FontSize="12" Foreground="#666666" Height="20" Width="48" HorizontalAlignment="Left"></TextBlock>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <Grid Width="74" Height="74">
+                        <Grid.ColumnDefinitions>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                            <ColumnDefinition></ColumnDefinition>
+                        </Grid.ColumnDefinitions>
+                        <Grid.RowDefinitions>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                            <RowDefinition></RowDefinition>
+                        </Grid.RowDefinitions>
+                        <Button Grid.Column="0" Grid.Row="0"></Button>
+                        <Button Grid.Column="1" Grid.Row="0"></Button>
+                        <Button Grid.Column="2" Grid.Row="0"></Button>
+                        <Button Grid.Column="0" Grid.Row="1"></Button>
+                        <Button Grid.Column="1" Grid.Row="1" Background="Black"></Button>
+                        <Button Grid.Column="2" Grid.Row="1"></Button>
+                        <Button Grid.Column="0" Grid.Row="2"></Button>
+                        <Button Grid.Column="1" Grid.Row="2"></Button>
+                        <Button Grid.Column="2" Grid.Row="2"></Button>
+                    </Grid>
+                    <StackPanel Orientation="Vertical" Margin="70,0,0,0">
+                        <StackPanel Orientation="Horizontal">
+                            <TextBlock Text="X"  Width="9" Height="20" VerticalAlignment="Center"/>
+                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        </StackPanel>
+                        <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                            <TextBlock Text="Y" Width="9" Height="20" VerticalAlignment="Center"/>
+                            <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                        </StackPanel>
+                    </StackPanel>
+                    
+                </StackPanel>
+                <CheckBox Margin="0,24,0,0" >
+                    <TextBlock Text="平铺" Width="144" Height="22" FontSize="14"/>
+                </CheckBox>
+                <StackPanel Orientation="Horizontal" Margin="0,8,0,0">
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Text="" Background="Aquamarine" Width="25" Height="9" VerticalAlignment="Center"/>
+                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                    </StackPanel>
+                    <StackPanel Orientation="Horizontal" Margin="32,0,0,0">
+                        <TextBlock Background="AntiqueWhite" Width="9" Height="25" VerticalAlignment="Center"/>
+                        <TextBox Width="66" Height="32" Margin="9,0,0,0"></TextBox>
+                    </StackPanel>
+                </StackPanel>
+            </StackPanel>
+        </Grid>
+        <Grid Width="228" Grid.Row="4"  Margin="0,10,0,4">
+            <StackPanel Orientation="Vertical">
+                <TextBlock Text="页面范围" FontSize="12" Foreground="#666666" Height="20" Width="24" HorizontalAlignment="Left"></TextBlock>
+                <ComboBox Height="32" Margin="0,8,0,0"></ComboBox>
+            </StackPanel>
+        </Grid>
+    </Grid>
+</UserControl>

+ 15 - 0
PDF Office/Views/EditTools/Watermark/WatermarkCreateTextContent.xaml.cs

@@ -0,0 +1,15 @@
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.EditTools.Watermark
+{
+    /// <summary>
+    /// Interaction logic for WatermarkCreateTextContent
+    /// </summary>
+    public partial class WatermarkCreateTextContent : UserControl
+    {
+        public WatermarkCreateTextContent()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 45 - 0
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListBaseContent.xaml

@@ -0,0 +1,45 @@
+<UserControl x:Class="PDF_Office.Views.EditTools.Watermark.WatermarkTemplateListBaseContent"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:prism="http://prismlibrary.com/"             
+             prism:ViewModelLocator.AutoWireViewModel="True"
+              xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+             mc:Ignorable="d"
+             d:DesignHeight="720"
+             d:DesignWidth="260">
+    <Grid>
+        <Grid.RowDefinitions>
+            <RowDefinition Height="48"/>
+            <RowDefinition Height="48"/>
+            <RowDefinition/>
+        </Grid.RowDefinitions>
+        <Grid Grid.Row="0">
+                <TextBlock Width="32" Height="24" Text="水印" FontSize="16" Margin="16,0,16,0" HorizontalAlignment="Left"></TextBlock>
+                <StackPanel HorizontalAlignment="Right" Orientation="Horizontal" >
+                    <Button Height="20" Width="20"></Button>
+                    <Button Height="20" Width="20" Margin="16,0,6,0"></Button>
+                </StackPanel>
+        </Grid>
+        <Grid Grid.Row="1" Margin="16,0,16,0">
+            <Grid.ColumnDefinitions>
+                <ColumnDefinition></ColumnDefinition>
+                <ColumnDefinition></ColumnDefinition>
+            </Grid.ColumnDefinitions>
+            <Button Grid.Column="0">
+                <StackPanel Orientation="Vertical"  >
+                    <TextBlock Text="颜色" FontSize="18"></TextBlock>
+                </StackPanel>
+
+            </Button>
+            <Button Grid.Column="1">
+                <StackPanel Orientation="Vertical"  >
+                    <TextBlock Text="文件" FontSize="18" VerticalAlignment="Center"></TextBlock>
+                </StackPanel>
+            </Button>
+        </Grid>
+        <Grid Grid.Row="2">
+
+        </Grid>
+    </Grid>
+</UserControl>

+ 0 - 0
PDF Office/Views/EditTools/Watermark/WatermarkTemplateListBaseContent.xaml.cs


Some files were not shown because too many files changed in this diff