liyijie 2 лет назад
Родитель
Сommit
fee0654ab8
16 измененных файлов с 2928 добавлено и 342 удалено
  1. 347 338
      PDF Office/App.xaml.cs
  2. 32 0
      PDF Office/PDF Office.csproj
  3. 357 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialogViewModel.cs
  4. 1 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs
  5. 357 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialogViewModel.cs
  6. 2 2
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageConverter/HomePageConverterDialogViewModel.cs
  7. 358 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialogViewModel.cs
  8. 356 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialogViewModel.cs
  9. 130 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml
  10. 149 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml.cs
  11. 130 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml
  12. 149 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml.cs
  13. 130 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml
  14. 150 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml.cs
  15. 130 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml
  16. 150 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml.cs

+ 347 - 338
PDF Office/App.xaml.cs

@@ -1,343 +1,352 @@
-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.Helper;
-using PDF_Office.Views.Dialog.HomePageToolsDialogs;
-using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter;
-using PDF_Office.Views.PropertyPanel;
-using PDF_Office.Views.Dialog.BOTA;
-using PDF_Office.Views.PropertyPanel.AnnotPanel;
-using PDF_Office.Views.FillAndSign;
-using PDF_Office.Views.FillAndSign.PropertyPanel;
-using PDF_Office.Views.PropertyPanel.ViewModular;
-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;
-using PDF_Office.Views.EditTools.Bates;
-using PDF_Office.Views.EditTools.HeaderFooter;
-using PDF_Office.Views.EditTools.Redaction;
-using PDF_Office.Views.Form;
-
-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 CacheFilePath CachePath;
-
-        public static bool IsFirstOpen = true;
-        public static bool IsBookMode = false;
-
-        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
-        }
-
-        private void InitSettings()
-        {
-            if (Settings.Default.RecentOpenFiles == null)
-                Settings.Default.RecentOpenFiles = new RecentOpenFiles();
-
-            if (Settings.Default.AppProperties == null)
-                Settings.Default.AppProperties = new PDFSettings.APPSettingProperties();
-
-            if (Settings.Default.AllPDFToolsList == null)
-                Settings.Default.AllPDFToolsList = new PDFSettings.AllPDFToolsList();
-
-            if (Settings.Default.QuickPDFToolsList == null)
-                Settings.Default.QuickPDFToolsList = new PDFSettings.QuickPDFToolsList();
-        }
-
-        protected override void OnStartup(StartupEventArgs e)
-        {
-            LicenseVerify();
-
-            InitSettings();
-
-            CachePath = CacheFilePath.Instance;
-            //清除临时文件
-            CacheFilePath.Instance.ClearDeleteFiles();
-
-            try
-            {
-                DirectoryInfo info = new DirectoryInfo(CurrentPath);
-                //避免因存在同名文件,导致无法创建文件夹
-                if (File.Exists(CurrentPath))
-                {
-                    File.Delete(CurrentPath);
-                }
-                if (!info.Exists)
-                {
-                    info.Create();
-                }
-            }
-            catch (Exception ex)
-            {
-            }
-
-            base.OnStartup(e);
-        }
-
-        /// <summary>
-        /// 创建启动窗口
-        /// </summary>
-        /// <returns></returns>
-        protected override Window CreateShell()
-        {
-            return Container.Resolve<MainWindow>();
-        }
-
-        protected override void RegisterTypes(IContainerRegistry containerRegistry)
-        {
-            #region 注册内容组件
-
-            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<PropertyPanelContent>();
-            containerRegistry.RegisterForNavigation<PageEditContent>();
-            containerRegistry.RegisterForNavigation<BottomToolContent>();
-            containerRegistry.RegisterForNavigation<ToolsBarContent>();
-            containerRegistry.RegisterForNavigation<TextEditToolContent>();
-            containerRegistry.RegisterForNavigation<AnnotToolContent>();
-            containerRegistry.RegisterForNavigation<BookmarkContent>();
-            containerRegistry.RegisterForNavigation<SearchContent>();
-            containerRegistry.RegisterForNavigation<OutLineControl>();
-            containerRegistry.RegisterForNavigation<ViewModularContent>();
-            containerRegistry.RegisterForNavigation<SplitScreenContent>();
-            containerRegistry.RegisterForNavigation<ThemesContent>();
-            containerRegistry.RegisterForNavigation<ReadModeContent>();
-            containerRegistry.RegisterForNavigation<AnnotationContent>();
-            containerRegistry.RegisterForNavigation<ReadViewContent>();
-
+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.Helper;
+using PDF_Office.Views.Dialog.HomePageToolsDialogs;
+using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter;
+using PDF_Office.Views.PropertyPanel;
+using PDF_Office.Views.Dialog.BOTA;
+using PDF_Office.Views.PropertyPanel.AnnotPanel;
+using PDF_Office.Views.FillAndSign;
+using PDF_Office.Views.FillAndSign.PropertyPanel;
+using PDF_Office.Views.PropertyPanel.ViewModular;
+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;
+using PDF_Office.Views.EditTools.Bates;
+using PDF_Office.Views.EditTools.HeaderFooter;
+using PDF_Office.Views.EditTools.Redaction;
+using PDF_Office.Views.Form;
+using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageHeaderFooter;
+using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates;
+using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageWatermark;
+using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground;
+
+
+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 CacheFilePath CachePath;
+
+        public static bool IsFirstOpen = true;
+        public static bool IsBookMode = false;
+
+        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
+        }
+
+        private void InitSettings()
+        {
+            if (Settings.Default.RecentOpenFiles == null)
+                Settings.Default.RecentOpenFiles = new RecentOpenFiles();
+
+            if (Settings.Default.AppProperties == null)
+                Settings.Default.AppProperties = new PDFSettings.APPSettingProperties();
+
+            if (Settings.Default.AllPDFToolsList == null)
+                Settings.Default.AllPDFToolsList = new PDFSettings.AllPDFToolsList();
+
+            if (Settings.Default.QuickPDFToolsList == null)
+                Settings.Default.QuickPDFToolsList = new PDFSettings.QuickPDFToolsList();
+        }
+
+        protected override void OnStartup(StartupEventArgs e)
+        {
+            LicenseVerify();
+
+            InitSettings();
+
+            CachePath = CacheFilePath.Instance;
+            //清除临时文件
+            CacheFilePath.Instance.ClearDeleteFiles();
+
+            try
+            {
+                DirectoryInfo info = new DirectoryInfo(CurrentPath);
+                //避免因存在同名文件,导致无法创建文件夹
+                if (File.Exists(CurrentPath))
+                {
+                    File.Delete(CurrentPath);
+                }
+                if (!info.Exists)
+                {
+                    info.Create();
+                }
+            }
+            catch (Exception ex)
+            {
+            }
+
+            base.OnStartup(e);
+        }
+
+        /// <summary>
+        /// 创建启动窗口
+        /// </summary>
+        /// <returns></returns>
+        protected override Window CreateShell()
+        {
+            return Container.Resolve<MainWindow>();
+        }
+
+        protected override void RegisterTypes(IContainerRegistry containerRegistry)
+        {
+            #region 注册内容组件
+
+            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<PropertyPanelContent>();
+            containerRegistry.RegisterForNavigation<PageEditContent>();
+            containerRegistry.RegisterForNavigation<BottomToolContent>();
+            containerRegistry.RegisterForNavigation<ToolsBarContent>();
+            containerRegistry.RegisterForNavigation<TextEditToolContent>();
+            containerRegistry.RegisterForNavigation<AnnotToolContent>();
+            containerRegistry.RegisterForNavigation<BookmarkContent>();
+            containerRegistry.RegisterForNavigation<SearchContent>();
+            containerRegistry.RegisterForNavigation<OutLineControl>();
+            containerRegistry.RegisterForNavigation<ViewModularContent>();
+            containerRegistry.RegisterForNavigation<SplitScreenContent>();
+            containerRegistry.RegisterForNavigation<ThemesContent>();
+            containerRegistry.RegisterForNavigation<ReadModeContent>();
+            containerRegistry.RegisterForNavigation<AnnotationContent>();
+            containerRegistry.RegisterForNavigation<ReadViewContent>();
+
 
             containerRegistry.RegisterForNavigation<HomePagePrinterDocumentContent>();
-            containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
-            containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
-            containerRegistry.RegisterForNavigation<HomePagePrinterModMultipleContent>();
-            containerRegistry.RegisterForNavigation<HomePagePrinterModBookletContent>();
-            containerRegistry.RegisterForNavigation<HomePageCompressDialog>();
-            containerRegistry.RegisterForNavigation<HomePageSetPasswordDialog>();
+            containerRegistry.RegisterForNavigation<HomePagePrinterModSizeContent>();
+            containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
+            containerRegistry.RegisterForNavigation<HomePagePrinterModMultipleContent>();
+            containerRegistry.RegisterForNavigation<HomePagePrinterModBookletContent>();
+            containerRegistry.RegisterForNavigation<HomePageCompressDialog>();
+            containerRegistry.RegisterForNavigation<HomePageSetPasswordDialog>();
             containerRegistry.RegisterForNavigation<HomePageRemoveDialog>();
-            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.RegisterForNavigation<BackgroundTemplateListBaseContent>();
-            containerRegistry.RegisterForNavigation<BackgroundTemplateListColorContent>();
-            containerRegistry.RegisterForNavigation<BackgroundTemplateListFileContent>();
-            containerRegistry.RegisterForNavigation<BackgroundCreateBaseContent>();
-            containerRegistry.RegisterForNavigation<BackgroundCreateColorContent>();
-            containerRegistry.RegisterForNavigation<BackgroundCreateFileContent>();
-            containerRegistry.RegisterForNavigation<BackgroundDocumentContent>();
-            containerRegistry.RegisterForNavigation<WatermarkTemplateListBaseContent>();
-            containerRegistry.RegisterForNavigation<WatermarkTemplateListTextContent>();
-            containerRegistry.RegisterForNavigation<WatermarkTemplateListFileContent>();
-            containerRegistry.RegisterForNavigation<WatermarkCreateBaseContent>();
-            containerRegistry.RegisterForNavigation<WatermarkCreateTextContent>();
-            containerRegistry.RegisterForNavigation<WatermarkCreateFileContent>();
-            containerRegistry.RegisterForNavigation<WatermarkDocumentContent>();
-            containerRegistry.RegisterForNavigation<HomePagePrinterModMultipleContent>();
-            containerRegistry.RegisterForNavigation<FreehandAnnotProperty>();
-            containerRegistry.RegisterForNavigation<FreetextAnnotProperty>();
-            containerRegistry.RegisterForNavigation<ImageAnnotProperty>();
-            containerRegistry.RegisterForNavigation<LinkAnnotProperty>();
-            containerRegistry.RegisterForNavigation<SharpsAnnotProperty>();
-            containerRegistry.RegisterForNavigation<StampAnnotProperty>();
-            containerRegistry.RegisterForNavigation<SignatureAnnotProperty>();
-            containerRegistry.RegisterForNavigation<TextAnnotProperty>();
-            containerRegistry.RegisterForNavigation<TextEditProperty>();
-            containerRegistry.RegisterForNavigation<BatesContent>();
-            containerRegistry.RegisterForNavigation<BatesTemplateListContent>();
-            containerRegistry.RegisterForNavigation<BatesCreateContent>();
-            containerRegistry.RegisterForNavigation<BatesDocumentContent>();
-            containerRegistry.RegisterForNavigation<HeaderFooterContent>();
-            containerRegistry.RegisterForNavigation<HeaderFooterTemplateListContent>();
-            containerRegistry.RegisterForNavigation<HeaderFooterCreateContent>();
-            containerRegistry.RegisterForNavigation<HeaderFooterDocumentContent>();
-            containerRegistry.RegisterForNavigation<RedactionContent>();
-            containerRegistry.RegisterForNavigation<RedactionDocumentContent>();
-            //填写与签名
-            containerRegistry.RegisterForNavigation<FillAndSignContent>();
-            containerRegistry.RegisterForNavigation<DateFillProperty>();
-            containerRegistry.RegisterForNavigation<ShapFillProperty>();
-            containerRegistry.RegisterForNavigation<TextFillProperty>();
-            //Form表单
-            containerRegistry.RegisterForNavigation<FormsToolContent>();
-            containerRegistry.RegisterForNavigation<TextFieldProperty>();
-            containerRegistry.RegisterForNavigation<ButtonProperty>();
-            containerRegistry.RegisterForNavigation<CheckBoxProperty>();
-            containerRegistry.RegisterForNavigation<ListBoxProperty>();
-            containerRegistry.RegisterForNavigation<RadioButtonProperty>();
-            containerRegistry.RegisterForNavigation<SignProperty>();
-
-            #endregion 注册内容组件
-
-            #region 注册弹窗
-
-            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);
-            containerRegistry.RegisterDialog<HomePagePrinterDialog>(DialogNames.HomePagePrinterDialog);
+            containerRegistry.RegisterForNavigation<HomePageHeaderFooterDialog>();
+            containerRegistry.RegisterForNavigation<HomePageBatesDialog>();
+            containerRegistry.RegisterForNavigation<HomePageBackgroundDialog>();
+            containerRegistry.RegisterForNavigation<HomePageWatermarkDialog>();
+            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.RegisterForNavigation<BackgroundTemplateListBaseContent>();
+            containerRegistry.RegisterForNavigation<BackgroundTemplateListColorContent>();
+            containerRegistry.RegisterForNavigation<BackgroundTemplateListFileContent>();
+            containerRegistry.RegisterForNavigation<BackgroundCreateBaseContent>();
+            containerRegistry.RegisterForNavigation<BackgroundCreateColorContent>();
+            containerRegistry.RegisterForNavigation<BackgroundCreateFileContent>();
+            containerRegistry.RegisterForNavigation<BackgroundDocumentContent>();
+            containerRegistry.RegisterForNavigation<WatermarkTemplateListBaseContent>();
+            containerRegistry.RegisterForNavigation<WatermarkTemplateListTextContent>();
+            containerRegistry.RegisterForNavigation<WatermarkTemplateListFileContent>();
+            containerRegistry.RegisterForNavigation<WatermarkCreateBaseContent>();
+            containerRegistry.RegisterForNavigation<WatermarkCreateTextContent>();
+            containerRegistry.RegisterForNavigation<WatermarkCreateFileContent>();
+            containerRegistry.RegisterForNavigation<WatermarkDocumentContent>();
+            containerRegistry.RegisterForNavigation<HomePagePrinterModMultipleContent>();
+            containerRegistry.RegisterForNavigation<FreehandAnnotProperty>();
+            containerRegistry.RegisterForNavigation<FreetextAnnotProperty>();
+            containerRegistry.RegisterForNavigation<ImageAnnotProperty>();
+            containerRegistry.RegisterForNavigation<LinkAnnotProperty>();
+            containerRegistry.RegisterForNavigation<SharpsAnnotProperty>();
+            containerRegistry.RegisterForNavigation<StampAnnotProperty>();
+            containerRegistry.RegisterForNavigation<SignatureAnnotProperty>();
+            containerRegistry.RegisterForNavigation<TextAnnotProperty>();
+            containerRegistry.RegisterForNavigation<TextEditProperty>();
+            containerRegistry.RegisterForNavigation<BatesContent>();
+            containerRegistry.RegisterForNavigation<BatesTemplateListContent>();
+            containerRegistry.RegisterForNavigation<BatesCreateContent>();
+            containerRegistry.RegisterForNavigation<BatesDocumentContent>();
+            containerRegistry.RegisterForNavigation<HeaderFooterContent>();
+            containerRegistry.RegisterForNavigation<HeaderFooterTemplateListContent>();
+            containerRegistry.RegisterForNavigation<HeaderFooterCreateContent>();
+            containerRegistry.RegisterForNavigation<HeaderFooterDocumentContent>();
+            containerRegistry.RegisterForNavigation<RedactionContent>();
+            containerRegistry.RegisterForNavigation<RedactionDocumentContent>();
+            //填写与签名
+            containerRegistry.RegisterForNavigation<FillAndSignContent>();
+            containerRegistry.RegisterForNavigation<DateFillProperty>();
+            containerRegistry.RegisterForNavigation<ShapFillProperty>();
+            containerRegistry.RegisterForNavigation<TextFillProperty>();
+            //Form表单
+            containerRegistry.RegisterForNavigation<FormsToolContent>();
+            containerRegistry.RegisterForNavigation<TextFieldProperty>();
+            containerRegistry.RegisterForNavigation<ButtonProperty>();
+            containerRegistry.RegisterForNavigation<CheckBoxProperty>();
+            containerRegistry.RegisterForNavigation<ListBoxProperty>();
+            containerRegistry.RegisterForNavigation<RadioButtonProperty>();
+            containerRegistry.RegisterForNavigation<SignProperty>();
+
+            #endregion 注册内容组件
+
+            #region 注册弹窗
+
+            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);
+            containerRegistry.RegisterDialog<HomePagePrinterDialog>(DialogNames.HomePagePrinterDialog);
             containerRegistry.RegisterDialog<HomePagePrinterPaperSettingsDialog>(DialogNames.HomePagePrinterPaperSettingsDialog);
-            containerRegistry.RegisterDialog<HomePagePictureToPDFDialog>(DialogNames.HomePagePictureToPDFDialog);
-            containerRegistry.RegisterDialog<HomePageBatchProcessingDialog>(DialogNames.HomePageBatchProcessingDialog);
-            containerRegistry.RegisterDialog<DynamicPropertyDialog>(DialogNames.DynamicPropertyDialog);
-            containerRegistry.RegisterDialog<CustomCreateDialog>(DialogNames.CustomCreateDialog);
-            containerRegistry.RegisterDialog<SignatureCreateDialog>(DialogNames.SignatureCreateDialog);
-            containerRegistry.RegisterDialog<ConverterCSVDialog>(DialogNames.ConverterCSVDialog);
-            containerRegistry.RegisterDialog<ConverterPPTDialog>(DialogNames.ConverterPPTDialog);
-            containerRegistry.RegisterDialog<ConverterTextDialog>(DialogNames.ConverterTextDialog);
-            containerRegistry.RegisterDialog<ConverterWordDialog>(DialogNames.ConverterWordDialog);
-            containerRegistry.RegisterDialog<ConverterHTMLDialog>(DialogNames.ConverterHTMLDialog);
-            containerRegistry.RegisterDialog<ConverterImgDialog>(DialogNames.ConverterImgDialog);
-            containerRegistry.RegisterDialog<ConverterRTFDialog>(DialogNames.ConverterRTFDialog);
-            containerRegistry.RegisterDialog<ConverterExcelDialog>(DialogNames.ConverterExcelDialog);
-            containerRegistry.RegisterDialog<ConverterProgressBarDialog>(DialogNames.ConverterProgressBarDialog);
-            containerRegistry.RegisterDialog<ScreenAnnotationDialog>(DialogNames.ScreenAnnotationDialog);
-
-            #endregion 注册弹窗
-        }
-
-        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 { }
-            SDKLisenceHelper sdkhelper = new SDKLisenceHelper();
-            string devKey = "";
-            string devSecret = "";
-#if DEBUG
-            devKey = "ehrnKqkWc1XSEAWyPUt6+95GzCoLEyoKrCbsUuJkCqGmxmP5ozX4bS0R6crHItQVNTFvC5mBZ1M7QjJ6Ekdu4Daj7PM+EDLTBKbFJinK4Ri9E5E2X+a9vF5zSj0TkIscQPVnwj9ikxAFOWGIyybMwQQzwc8a4j1cGOqGXQRDMMY=";
-            devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6ccHhEu996bvBgqf8Sw8OekQKQq13VBewK5AckaDux4W7SGRhCUNWC4MItkr36JnXMD2tiFQYzMG8C66HYmRGSLh";
-            devKey = sdkhelper.DevKey;
-            devSecret = sdkhelper.DevSecret;
-#endif
-            string userKey = sdkhelper.UserKey;
-            string userSecret = sdkhelper.UserSecret;
-
-            try
-            {
-                LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(devKey, devSecret);
-                if (verifyResult != 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) + "\\";
-                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);
-        }
-    }
+            containerRegistry.RegisterDialog<HomePagePictureToPDFDialog>(DialogNames.HomePagePictureToPDFDialog);
+            containerRegistry.RegisterDialog<HomePageBatchProcessingDialog>(DialogNames.HomePageBatchProcessingDialog);
+            containerRegistry.RegisterDialog<DynamicPropertyDialog>(DialogNames.DynamicPropertyDialog);
+            containerRegistry.RegisterDialog<CustomCreateDialog>(DialogNames.CustomCreateDialog);
+            containerRegistry.RegisterDialog<SignatureCreateDialog>(DialogNames.SignatureCreateDialog);
+            containerRegistry.RegisterDialog<ConverterCSVDialog>(DialogNames.ConverterCSVDialog);
+            containerRegistry.RegisterDialog<ConverterPPTDialog>(DialogNames.ConverterPPTDialog);
+            containerRegistry.RegisterDialog<ConverterTextDialog>(DialogNames.ConverterTextDialog);
+            containerRegistry.RegisterDialog<ConverterWordDialog>(DialogNames.ConverterWordDialog);
+            containerRegistry.RegisterDialog<ConverterHTMLDialog>(DialogNames.ConverterHTMLDialog);
+            containerRegistry.RegisterDialog<ConverterImgDialog>(DialogNames.ConverterImgDialog);
+            containerRegistry.RegisterDialog<ConverterRTFDialog>(DialogNames.ConverterRTFDialog);
+            containerRegistry.RegisterDialog<ConverterExcelDialog>(DialogNames.ConverterExcelDialog);
+            containerRegistry.RegisterDialog<ConverterProgressBarDialog>(DialogNames.ConverterProgressBarDialog);
+            containerRegistry.RegisterDialog<ScreenAnnotationDialog>(DialogNames.ScreenAnnotationDialog);
+
+            #endregion 注册弹窗
+        }
+
+        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 { }
+            SDKLisenceHelper sdkhelper = new SDKLisenceHelper();
+            string devKey = "";
+            string devSecret = "";
+#if DEBUG
+            devKey = "ehrnKqkWc1XSEAWyPUt6+95GzCoLEyoKrCbsUuJkCqGmxmP5ozX4bS0R6crHItQVNTFvC5mBZ1M7QjJ6Ekdu4Daj7PM+EDLTBKbFJinK4Ri9E5E2X+a9vF5zSj0TkIscQPVnwj9ikxAFOWGIyybMwQQzwc8a4j1cGOqGXQRDMMY=";
+            devSecret = "mG0c3O3Mzeu5dkZJW3gpqq9uA7o7EGQveSC38Q8TK4gQurxTxGuBlGAhs0P1mD3X3bHT+AHfcLiymaqE4DY7kTFHoPs9I3tl5ErS+BHdzHRhrp9sGpqfp0B228KI+IMTu4aGVjtYuk+Uxs/kosIBw1367/WkJ00tM7U7tttD6ccHhEu996bvBgqf8Sw8OekQKQq13VBewK5AckaDux4W7SGRhCUNWC4MItkr36JnXMD2tiFQYzMG8C66HYmRGSLh";
+            devKey = sdkhelper.DevKey;
+            devSecret = sdkhelper.DevSecret;
+#endif
+            string userKey = sdkhelper.UserKey;
+            string userSecret = sdkhelper.UserSecret;
+
+            try
+            {
+                LicenseErrorCode verifyResult = CPDFSDKVerifier.LicenseVerify(devKey, devSecret);
+                if (verifyResult != 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) + "\\";
+                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);
+        }
+    }
 }

+ 32 - 0
PDF Office/PDF Office.csproj

@@ -421,6 +421,10 @@
     <Compile Include="ViewModels\Form\RadioButtonPropertyViewModel.cs" />
     <Compile Include="ViewModels\Form\SignPropertyViewModel.cs" />
     <Compile Include="ViewModels\Form\TextFieldPropertyViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkDialogViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\PDFToolsContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\PDFTools\QuickToolsContentViewModel.cs" />
     <Compile Include="ViewModels\PropertyPanel\AnnotPanel\SignatureAnnotPropertyViewModel.cs" />
@@ -558,9 +562,15 @@
     <Compile Include="Views\Dialog\FullScreenWindow.xaml.cs">
       <DependentUpon>FullScreenWindow.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundDialog.xaml.cs">
+      <DependentUpon>HomePageBackgroundDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialog.xaml.cs">
       <DependentUpon>HomePageBatchProcessingDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesDialog.xaml.cs">
+      <DependentUpon>HomePageBatesDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialog.xaml.cs">
       <DependentUpon>HomePageCompressDialog.xaml</DependentUpon>
     </Compile>
@@ -579,12 +589,18 @@
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageConverter\HomePageConverterWord.xaml.cs">
       <DependentUpon>HomePageConverterWord.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterDialog.xaml.cs">
+      <DependentUpon>HomePageHeaderFooterDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageRemoveDialog.xaml.cs">
       <DependentUpon>HomePageRemoveDialog.xaml</DependentUpon>
     </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialog.xaml.cs">
       <DependentUpon>HomePageSetPasswordDialog.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkDialog.xaml.cs">
+      <DependentUpon>HomePageWatermarkDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageExtractDialog.xaml.cs">
       <DependentUpon>HomePageExtractDialog.xaml</DependentUpon>
     </Compile>
@@ -1112,14 +1128,30 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBackground\HomePageBackgroundDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBates\HomePageBatesDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageHeaderFooter\HomePageHeaderFooterDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageRemoveDialog.xaml">
       <Generator>MSBuild:Compile</Generator>
       <SubType>Designer</SubType>
     </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageWatermark\HomePageWatermarkDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterDocumentContent.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 357 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialogViewModel.cs

@@ -0,0 +1,357 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using System.Windows;
+using PDF_Office.Helper;
+using Prism.Regions;
+using ComPDFKit.PDFDocument;
+using PDF_Office.CustomControl;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Model;
+using System.Diagnostics;
+using System.IO;
+using System.Windows.Forms;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground
+{
+    public class HomePageBackgroundDialogViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        private List<string> fileNames;
+
+
+        private CPDFDocument tempDocument;
+
+        public string PageNumber = "";
+
+        public IRegionManager BackgroundRegion;
+
+        public List<int> fileNamesView = new List<int>();
+
+        private int fileNamesIndex = 0;
+
+        private string backgroundGridIsEnabled = "True";
+        public string BackgroundGridIsEnabled
+        {
+            get
+            {
+                return backgroundGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref backgroundGridIsEnabled, value);
+            }
+        }
+
+        private string setBackgroundGridIsEnabled = "True";
+        public string SetBackgroundGridIsEnabled
+        {
+            get
+            {
+                return setBackgroundGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref setBackgroundGridIsEnabled, 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 backgroundRegionName;
+        public string BackgroundRegionName
+        {
+            get
+            {
+                return backgroundRegionName;
+            }
+            set
+            {
+                SetProperty(ref backgroundRegionName, value);
+            }
+        }
+
+        private Visibility backgroundVisible = Visibility.Collapsed;
+        public Visibility BackgroundVisible
+        {
+            get { return backgroundVisible; }
+            set { SetProperty(ref backgroundVisible, 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 CreateCommand { get; set; }
+
+        public DelegateCommand ADDPDFFilesCommand { get; set; }
+        #endregion
+        public HomePageBackgroundDialogViewModel(IRegionManager backgroundRegion)
+        {
+            PDFDataTable.Columns.Add("FileName");
+            PDFDataTable.Columns.Add("FileSize");
+            PDFDataTable.Columns.Add("FileState");
+            ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
+            RemovePDFFileCommand = new DelegateCommand(removepdffile);
+            CreateCommand = new DelegateCommand(create);
+            BackgroundRegion = backgroundRegion;
+            BackgroundRegionName = Guid.NewGuid().ToString();
+        }
+        #region 逻辑函数
+
+
+        private void create()
+        {
+
+            fileNamesIndex = 0;
+            BackgroundGridIsEnabled = "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;
+                }
+
+                document.Release();
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                fileNamesIndex++;
+            }
+            BackgroundGridIsEnabled = "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);
+                SetBackgroundGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+                updateListview("待确定");
+            }
+        }
+
+        public void addPDFFiles(string filename)
+        {
+            fileNames.Add(filename);
+            RemoveExcess(ref fileNames);
+            SetBackgroundGridIsEnabled = "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("待确定");
+                SetBackgroundGridIsEnabled = "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)
+            {
+                SetBackgroundGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            updateListview("待确定");
+        }
+
+
+        public void PDFFileCount()
+        {
+            if (fileNames.Count == 0)
+            {
+                SetBackgroundGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            else
+            {
+                SetBackgroundGridIsEnabled = "True";
+                AddFileVisibility = 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("待确定");
+            }
+        }
+
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}
+

+ 1 - 2
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs

@@ -54,13 +54,12 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
         }
         #region 逻辑函数
         public void ChangeBatchProcessing(string index) {
-            if (index=="0"||index =="1"||index=="2"||index=="7") { 
+            
             NavigationParameters param = new NavigationParameters();
             param.Add(ParameterNames.FilePath, HomePageBatchProcessingDialogModel.FilePaths);
             BatchProcessingVisible = Visibility.Collapsed;
             BatchProcessingRegion.RequestNavigate(BatchProcessingRegionName, HomePageBatchProcessingDialogModel.GetBatchProcessing[int.Parse(index)], param);
             BatchProcessingVisible = Visibility.Visible;
-            }
         }
         #endregion
 

+ 357 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialogViewModel.cs

@@ -0,0 +1,357 @@
+using ComPDFKit.PDFDocument;
+using PDF_Office.CustomControl;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using PDF_Office.Helper;
+using System.Windows;
+using System.Windows.Forms;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates
+{
+    public class HomePageBatesDialogViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        private List<string> fileNames;
+
+
+        private CPDFDocument tempDocument;
+
+        public string PageNumber = "";
+
+        public IRegionManager BatesRegion;
+
+        public List<int> fileNamesView = new List<int>();
+
+        private int fileNamesIndex = 0;
+
+        private string batesGridIsEnabled = "True";
+        public string BatesGridIsEnabled
+        {
+            get
+            {
+                return batesGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref batesGridIsEnabled, value);
+            }
+        }
+
+        private string setBatesGridIsEnabled = "True";
+        public string SetBatesGridIsEnabled
+        {
+            get
+            {
+                return setBatesGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref setBatesGridIsEnabled, 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 batesRegionName;
+        public string BatesRegionName
+        {
+            get
+            {
+                return batesRegionName;
+            }
+            set
+            {
+                SetProperty(ref batesRegionName, value);
+            }
+        }
+
+        private Visibility batesVisible = Visibility.Collapsed;
+        public Visibility BatesVisible
+        {
+            get { return batesVisible; }
+            set { SetProperty(ref batesVisible, 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 CreateCommand { get; set; }
+
+        public DelegateCommand ADDPDFFilesCommand { get; set; }
+        #endregion
+        public HomePageBatesDialogViewModel(IRegionManager batesRegion)
+        {
+            PDFDataTable.Columns.Add("FileName");
+            PDFDataTable.Columns.Add("FileSize");
+            PDFDataTable.Columns.Add("FileState");
+            ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
+            RemovePDFFileCommand = new DelegateCommand(removepdffile);
+            CreateCommand = new DelegateCommand(create);
+            BatesRegion = batesRegion;
+            BatesRegionName = Guid.NewGuid().ToString();
+        }
+        #region 逻辑函数
+
+
+        private void create()
+        {
+
+            fileNamesIndex = 0;
+            BatesGridIsEnabled = "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;
+                }
+
+                document.Release();
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                fileNamesIndex++;
+            }
+            BatesGridIsEnabled = "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);
+                SetBatesGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+                updateListview("待确定");
+            }
+        }
+
+        public void addPDFFiles(string filename)
+        {
+            fileNames.Add(filename);
+            RemoveExcess(ref fileNames);
+            SetBatesGridIsEnabled = "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("待确定");
+                SetBatesGridIsEnabled = "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)
+            {
+                SetBatesGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            updateListview("待确定");
+        }
+
+
+        public void PDFFileCount()
+        {
+            if (fileNames.Count == 0)
+            {
+                SetBatesGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            else
+            {
+                SetBatesGridIsEnabled = "True";
+                AddFileVisibility = 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("待确定");
+            }
+        }
+
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}
+

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

@@ -241,7 +241,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                         if (ConverterRTFModel != null)
                         {
                             PageNumber = ConverterRTFModel.PageIndexLists.Count().ToString();
-                            result = await ConverterHelper.RTFConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterPPTModel.Pawssword);
+                            result = await ConverterHelper.RTFConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterRTFModel.Pawssword);
                         }
                         break;
                     case 4:
@@ -249,7 +249,7 @@ namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcess
                         if (ConverterHTMLModel != null)
                         {
                             PageNumber = ConverterHTMLModel.PageIndexLists.Count().ToString();
-                            result = await ConverterHelper.HTMLConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterExcelModel.Pawssword, ConverterHTMLModel.HTMLOptions());
+                            result = await ConverterHelper.HTMLConvert(filename, OutputPath, GetProgress, PageIndexLists, ConverterHTMLModel.Pawssword, ConverterHTMLModel.HTMLOptions());
                         }
                         break;
                     case 5:

+ 358 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialogViewModel.cs

@@ -0,0 +1,358 @@
+using ComPDFKit.PDFDocument;
+using PDF_Office.CustomControl;
+using PDF_Office.Helper;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows;
+using System.Windows.Forms;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageHeaderFooter
+{
+    public class HomePageHeaderFooterDialogViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        private List<string> fileNames;
+
+
+        private CPDFDocument tempDocument;
+
+        public string PageNumber = "";
+
+        public IRegionManager HeaderFooterRegion;
+
+        public List<int> fileNamesView = new List<int>();
+
+        private int fileNamesIndex = 0;
+
+        private string headerFooterGridIsEnabled = "True";
+        public string HeaderFooterGridIsEnabled
+        {
+            get
+            {
+                return headerFooterGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref headerFooterGridIsEnabled, value);
+            }
+        }
+
+        private string setHeaderFooterGridIsEnabled = "True";
+        public string SetHeaderFooterGridIsEnabled
+        {
+            get
+            {
+                return setHeaderFooterGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref setHeaderFooterGridIsEnabled, 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 headerFooterRegionName;
+        public string HeaderFooterRegionName
+        {
+            get
+            {
+                return headerFooterRegionName;
+            }
+            set
+            {
+                SetProperty(ref headerFooterRegionName, value);
+            }
+        }
+
+        private Visibility headerFooterVisible = Visibility.Collapsed;
+        public Visibility HeaderFooterVisible
+        {
+            get { return headerFooterVisible; }
+            set { SetProperty(ref headerFooterVisible, 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 CreateCommand { get; set; }
+
+        public DelegateCommand ADDPDFFilesCommand { get; set; }
+        #endregion
+
+        public HomePageHeaderFooterDialogViewModel(IRegionManager headerFooterRegion)
+        {
+           
+            PDFDataTable.Columns.Add("FileName");
+            PDFDataTable.Columns.Add("FileSize");
+            PDFDataTable.Columns.Add("FileState");
+            ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
+            RemovePDFFileCommand = new DelegateCommand(removepdffile);
+            CreateCommand = new DelegateCommand(create);
+            HeaderFooterRegion = headerFooterRegion;
+            HeaderFooterRegionName = Guid.NewGuid().ToString();
+        }
+        #region 逻辑函数
+   
+
+        private  void create()
+        {
+
+            fileNamesIndex = 0;
+            HeaderFooterGridIsEnabled = "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;
+                }
+               
+                document.Release();
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                fileNamesIndex++;
+            }
+            HeaderFooterGridIsEnabled = "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);
+                SetHeaderFooterGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+                updateListview("待确定");
+            }
+        }
+
+        public void addPDFFiles(string filename)
+        {
+            fileNames.Add(filename);
+            RemoveExcess(ref fileNames);
+            SetHeaderFooterGridIsEnabled = "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("待确定");
+                SetHeaderFooterGridIsEnabled = "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)
+            {
+                SetHeaderFooterGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            updateListview("待确定");
+        }
+
+
+        public void PDFFileCount()
+        {
+            if (fileNames.Count == 0)
+            {
+                SetHeaderFooterGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            else
+            {
+                SetHeaderFooterGridIsEnabled = "True";
+                AddFileVisibility = 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("待确定");
+            }
+        }
+
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}

+ 356 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialogViewModel.cs

@@ -0,0 +1,356 @@
+using ComPDFKit.PDFDocument;
+using PDF_Office.CustomControl;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Model;
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using PDF_Office.Helper;
+using System.Windows;
+using System.Data;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageWatermark
+{
+    public class HomePageWatermarkDialogViewModel : BindableBase, INavigationAware
+    {
+        #region 参数和属性
+        private List<string> fileNames;
+
+
+        private CPDFDocument tempDocument;
+
+        public string PageNumber = "";
+
+        public IRegionManager WatermarkRegion;
+
+        public List<int> fileNamesView = new List<int>();
+
+        private int fileNamesIndex = 0;
+
+        private string watermarkGridIsEnabled = "True";
+        public string WatermarkGridIsEnabled
+        {
+            get
+            {
+                return watermarkGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref watermarkGridIsEnabled, value);
+            }
+        }
+
+        private string setWatermarkGridIsEnabled = "True";
+        public string SetWatermarkGridIsEnabled
+        {
+            get
+            {
+                return setWatermarkGridIsEnabled;
+            }
+            set
+            {
+                SetProperty(ref setWatermarkGridIsEnabled, 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 watermarkRegionName;
+        public string WatermarkRegionName
+        {
+            get
+            {
+                return watermarkRegionName;
+            }
+            set
+            {
+                SetProperty(ref watermarkRegionName, value);
+            }
+        }
+
+        private Visibility watermarkVisible = Visibility.Collapsed;
+        public Visibility WatermarkVisible
+        {
+            get { return watermarkVisible; }
+            set { SetProperty(ref watermarkVisible, 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 CreateCommand { get; set; }
+
+        public DelegateCommand ADDPDFFilesCommand { get; set; }
+        #endregion
+        public HomePageWatermarkDialogViewModel(IRegionManager watermarkRegion)
+        {
+            PDFDataTable.Columns.Add("FileName");
+            PDFDataTable.Columns.Add("FileSize");
+            PDFDataTable.Columns.Add("FileState");
+            ADDPDFCommand = new DelegateCommand(addpicture);
+            ADDPDFFilesCommand = new DelegateCommand(addpicturefiles);
+            RemovePDFFileCommand = new DelegateCommand(removepdffile);
+            CreateCommand = new DelegateCommand(create);
+            WatermarkRegion = watermarkRegion;
+            WatermarkRegionName = Guid.NewGuid().ToString();
+        }
+        #region 逻辑函数
+
+
+        private void create()
+        {
+
+            fileNamesIndex = 0;
+            WatermarkGridIsEnabled = "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;
+                }
+
+                document.Release();
+                PDFDataTable.Rows[fileNamesIndex]["FileState"] = "完成";
+                fileNamesIndex++;
+            }
+            WatermarkGridIsEnabled = "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);
+                SetWatermarkGridIsEnabled = "True";
+                AddFileVisibility = Visibility.Collapsed;
+                updateListview("待确定");
+            }
+        }
+
+        public void addPDFFiles(string filename)
+        {
+            fileNames.Add(filename);
+            RemoveExcess(ref fileNames);
+            SetWatermarkGridIsEnabled = "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("待确定");
+                SetWatermarkGridIsEnabled = "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)
+            {
+                SetWatermarkGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            updateListview("待确定");
+        }
+
+
+        public void PDFFileCount()
+        {
+            if (fileNames.Count == 0)
+            {
+                SetWatermarkGridIsEnabled = "False";
+                AddFileVisibility = Visibility.Visible;
+            }
+            else
+            {
+                SetWatermarkGridIsEnabled = "True";
+                AddFileVisibility = 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("待确定");
+            }
+        }
+
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+        #endregion
+    }
+}

+ 130 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml

@@ -0,0 +1,130 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground.HomePageBackgroundDialog"
+             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="600"
+             d:DesignWidth="818"
+             mc:Ignorable="d">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <Grid IsEnabled="{Binding ConverterGridIsEnabled}">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="558*"/>
+            <ColumnDefinition Width="260*"/>
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="556*"/>
+                <RowDefinition Height="64*"/>
+            </Grid.RowDefinitions>
+            <Grid  Grid.Row="0" AllowDrop="True"
+                  Drop="Grid_Drop"
+                  DragEnter="MainPage_DragEnter"
+                  DragOver="MainPage_DragOver"
+                  DragLeave="MainPage_DragLeave"
+                  >
+                <Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>
+                <Button Name="BtnBlank"  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 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>
+            <Grid Grid.Row="2">
+                <Button Height="40" Width="228" Background="Black" Command="{Binding CreateCommand}">
+                    <TextBlock Text="Apply" FontSize="18" Foreground="White"/>
+                </Button>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 149 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBackground/HomePageBackgroundDialog.xaml.cs

@@ -0,0 +1,149 @@
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground;
+using Prism.Ioc;
+using Prism.Regions;
+using System;
+using System.Collections;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Interop;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBackground
+{
+    /// <summary>
+    /// Interaction logic for HomePageBackgroundDialog
+    /// </summary>
+    public partial class HomePageBackgroundDialog : UserControl
+    {
+        private IContainerProvider containerProvider;
+        private IDropTargetHelper dropHelper;
+        private HomePageBackgroundDialogViewModel viewModel;
+        public HomePageBackgroundDialog(IContainerProvider containerProvider)
+        {
+            InitializeComponent();
+            this.containerProvider = containerProvider;
+            var regionManager = containerProvider.Resolve<IRegionManager>();
+            RegionManager.SetRegionManager(this, regionManager);
+            RegionManager.UpdateRegions();
+            viewModel = this.DataContext as HomePageBackgroundDialogViewModel;
+        }
+        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;
+            viewModel.fileNamesView.Clear();
+            foreach (var item in list)
+            {
+                a = (System.Data.DataRowView)item;
+                viewModel.fileNamesView.Add(lists.IndexOf(a));
+            }
+            if (viewModel.fileNamesView.Count > 0)
+            {
+                viewModel.RemoveIsEnable = "True";
+            }
+            else
+            {
+                viewModel.RemoveIsEnable = "False";
+            }
+
+        }
+
+        private void RemoveFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            viewModel.removepdffile();
+        }
+
+        private void OpenFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            viewModel.openfiledialog();
+        }
+
+
+        private void Grid_Drop(object sender, DragEventArgs e)
+        {
+
+            try
+            {
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+            string dropFile = "Drop";
+            if (e.Data.GetDataPresent(System.Windows.DataFormats.FileDrop))
+            {
+                DropGrid.Visibility = Visibility.Collapsed;
+                int count = ((System.Array)e.Data.GetData(System.Windows.DataFormats.FileDrop)).Length;
+                for (int i = 0; i < count; i++)
+                {
+                    dropFile = ((System.Array)e.Data.GetData(System.Windows.DataFormats.FileDrop)).GetValue(i).ToString(); ;
+                    //MessageBox.Show(dropFile);
+                    if (dropFile.ToLower().EndsWith("pdf"))
+                    { viewModel.addPDFFiles(dropFile); }
+                }
+            }
+        }
+        private void MainPage_DragEnter(object sender, DragEventArgs e)
+        {
+            DropGrid.Visibility = Visibility.Visible;
+            //页面编辑和缩略图
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                if (dropHelper == null)
+                {
+                    dropHelper = Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("4657278A-411B-11D2-839A-00C04FD918D0"))) as IDropTargetHelper;
+                }
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+
+        private void MainPage_DragOver(object sender, DragEventArgs e)
+        {
+
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.DragOver(ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+
+        private void MainPage_DragLeave(object sender, DragEventArgs e)
+        {
+            DropGrid.Visibility = Visibility.Collapsed;
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                dropHelper?.DragLeave();
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+    }
+}

+ 130 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml

@@ -0,0 +1,130 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates.HomePageBatesDialog"
+            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="600"
+             d:DesignWidth="818"
+             mc:Ignorable="d">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <Grid IsEnabled="{Binding ConverterGridIsEnabled}">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="558*"/>
+            <ColumnDefinition Width="260*"/>
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="556*"/>
+                <RowDefinition Height="64*"/>
+            </Grid.RowDefinitions>
+            <Grid  Grid.Row="0" AllowDrop="True"
+                  Drop="Grid_Drop"
+                  DragEnter="MainPage_DragEnter"
+                  DragOver="MainPage_DragOver"
+                  DragLeave="MainPage_DragLeave"
+                  >
+                <Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>
+                <Button Name="BtnBlank"  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 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>
+            <Grid Grid.Row="2">
+                <Button Height="40" Width="228" Background="Black" Command="{Binding CreateCommand}">
+                    <TextBlock Text="Apply" FontSize="18" Foreground="White"/>
+                </Button>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 149 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBates/HomePageBatesDialog.xaml.cs

@@ -0,0 +1,149 @@
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates;
+using Prism.Ioc;
+using Prism.Regions;
+using System;
+using System.Collections;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Interop;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBates
+{
+    /// <summary>
+    /// Interaction logic for HomePageBatesDialog
+    /// </summary>
+    public partial class HomePageBatesDialog : UserControl
+    {
+        private IContainerProvider containerProvider;
+        private IDropTargetHelper dropHelper;
+        private HomePageBatesDialogViewModel viewModel;
+        public HomePageBatesDialog(IContainerProvider containerProvider)
+        {
+            InitializeComponent();
+            this.containerProvider = containerProvider;
+            var regionManager = containerProvider.Resolve<IRegionManager>();
+            RegionManager.SetRegionManager(this, regionManager);
+            RegionManager.UpdateRegions();
+            viewModel = this.DataContext as HomePageBatesDialogViewModel;
+        }
+        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;
+            viewModel.fileNamesView.Clear();
+            foreach (var item in list)
+            {
+                a = (System.Data.DataRowView)item;
+                viewModel.fileNamesView.Add(lists.IndexOf(a));
+            }
+            if (viewModel.fileNamesView.Count > 0)
+            {
+                viewModel.RemoveIsEnable = "True";
+            }
+            else
+            {
+                viewModel.RemoveIsEnable = "False";
+            }
+
+        }
+
+        private void RemoveFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            viewModel.removepdffile();
+        }
+
+        private void OpenFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            viewModel.openfiledialog();
+        }
+
+
+        private void Grid_Drop(object sender, DragEventArgs e)
+        {
+
+            try
+            {
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+            string dropFile = "Drop";
+            if (e.Data.GetDataPresent(System.Windows.DataFormats.FileDrop))
+            {
+                DropGrid.Visibility = Visibility.Collapsed;
+                int count = ((System.Array)e.Data.GetData(System.Windows.DataFormats.FileDrop)).Length;
+                for (int i = 0; i < count; i++)
+                {
+                    dropFile = ((System.Array)e.Data.GetData(System.Windows.DataFormats.FileDrop)).GetValue(i).ToString(); ;
+                    //MessageBox.Show(dropFile);
+                    if (dropFile.ToLower().EndsWith("pdf"))
+                    { viewModel.addPDFFiles(dropFile); }
+                }
+            }
+        }
+        private void MainPage_DragEnter(object sender, DragEventArgs e)
+        {
+            DropGrid.Visibility = Visibility.Visible;
+            //页面编辑和缩略图
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                if (dropHelper == null)
+                {
+                    dropHelper = Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("4657278A-411B-11D2-839A-00C04FD918D0"))) as IDropTargetHelper;
+                }
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+
+        private void MainPage_DragOver(object sender, DragEventArgs e)
+        {
+
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.DragOver(ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+
+        private void MainPage_DragLeave(object sender, DragEventArgs e)
+        {
+            DropGrid.Visibility = Visibility.Collapsed;
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                dropHelper?.DragLeave();
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+    }
+}

+ 130 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml

@@ -0,0 +1,130 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageHeaderFooter.HomePageHeaderFooterDialog"
+             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="600"
+             d:DesignWidth="818"
+             mc:Ignorable="d">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <Grid IsEnabled="{Binding ConverterGridIsEnabled}">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="558*"/>
+            <ColumnDefinition Width="260*"/>
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="556*"/>
+                <RowDefinition Height="64*"/>
+            </Grid.RowDefinitions>
+            <Grid  Grid.Row="0" AllowDrop="True"
+                  Drop="Grid_Drop"
+                  DragEnter="MainPage_DragEnter"
+                  DragOver="MainPage_DragOver"
+                  DragLeave="MainPage_DragLeave"
+                  >
+                <Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>
+                <Button Name="BtnBlank"  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 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>
+            <Grid Grid.Row="2">
+                <Button Height="40" Width="228" Background="Black" Command="{Binding CreateCommand}">
+                    <TextBlock Text="Apply" FontSize="18" Foreground="White"/>
+                </Button>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 150 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageHeaderFooter/HomePageHeaderFooterDialog.xaml.cs

@@ -0,0 +1,150 @@
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageHeaderFooter;
+using Prism.Ioc;
+using Prism.Regions;
+using System;
+using System.Collections;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Interop;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageHeaderFooter
+{ 
+    /// <summary>
+    /// Interaction logic for HomePageHeaderFooterDialog
+    /// </summary>
+    public partial class HomePageHeaderFooterDialog : UserControl
+    {
+        private IContainerProvider containerProvider;
+        private IDropTargetHelper dropHelper;
+        private HomePageHeaderFooterDialogViewModel viewModel;
+        public HomePageHeaderFooterDialog(IContainerProvider containerProvider)
+        {
+            InitializeComponent();
+            this.containerProvider = containerProvider;
+            var regionManager = containerProvider.Resolve<IRegionManager>();
+            RegionManager.SetRegionManager(this, regionManager);
+            RegionManager.UpdateRegions();
+            viewModel = this.DataContext as HomePageHeaderFooterDialogViewModel;
+        }
+        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;
+            viewModel.fileNamesView.Clear();
+            foreach (var item in list)
+            {
+                a = (System.Data.DataRowView)item;
+                viewModel.fileNamesView.Add(lists.IndexOf(a));
+            }
+            if (viewModel.fileNamesView.Count > 0)
+            {
+                viewModel.RemoveIsEnable = "True";
+            }
+            else
+            {
+                viewModel.RemoveIsEnable = "False";
+            }
+
+        }
+
+        private void RemoveFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            viewModel.removepdffile();
+        }
+
+        private void OpenFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            viewModel.openfiledialog();
+        }
+
+
+        private void Grid_Drop(object sender, DragEventArgs e)
+        {
+
+            try
+            {
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+            string dropFile = "Drop";
+            if (e.Data.GetDataPresent(System.Windows.DataFormats.FileDrop))
+            {
+                DropGrid.Visibility = Visibility.Collapsed;
+                int count = ((System.Array)e.Data.GetData(System.Windows.DataFormats.FileDrop)).Length;
+                for (int i = 0; i < count; i++)
+                {
+                    dropFile = ((System.Array)e.Data.GetData(System.Windows.DataFormats.FileDrop)).GetValue(i).ToString(); ;
+                    //MessageBox.Show(dropFile);
+                    if (dropFile.ToLower().EndsWith("pdf"))
+                    { viewModel.addPDFFiles(dropFile); }
+                }
+            }
+        }
+        private void MainPage_DragEnter(object sender, DragEventArgs e)
+        {
+            DropGrid.Visibility = Visibility.Visible;
+            //页面编辑和缩略图
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                if (dropHelper == null)
+                {
+                    dropHelper = Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("4657278A-411B-11D2-839A-00C04FD918D0"))) as IDropTargetHelper;
+                }
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+
+        private void MainPage_DragOver(object sender, DragEventArgs e)
+        {
+
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.DragOver(ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+
+        private void MainPage_DragLeave(object sender, DragEventArgs e)
+        {
+            DropGrid.Visibility = Visibility.Collapsed;
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                dropHelper?.DragLeave();
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+    }
+}
+

+ 130 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml

@@ -0,0 +1,130 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageWatermark.HomePageWatermarkDialog"
+            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="600"
+             d:DesignWidth="818"
+             mc:Ignorable="d">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <Grid IsEnabled="{Binding ConverterGridIsEnabled}">
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="558*"/>
+            <ColumnDefinition Width="260*"/>
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="556*"/>
+                <RowDefinition Height="64*"/>
+            </Grid.RowDefinitions>
+            <Grid  Grid.Row="0" AllowDrop="True"
+                  Drop="Grid_Drop"
+                  DragEnter="MainPage_DragEnter"
+                  DragOver="MainPage_DragOver"
+                  DragLeave="MainPage_DragLeave"
+                  >
+                <Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>
+                <Button Name="BtnBlank"  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 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>
+            <Grid Grid.Row="2">
+                <Button Height="40" Width="228" Background="Black" Command="{Binding CreateCommand}">
+                    <TextBlock Text="Apply" FontSize="18" Foreground="White"/>
+                </Button>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 150 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageWatermark/HomePageWatermarkDialog.xaml.cs

@@ -0,0 +1,150 @@
+using PDF_Office.Helper;
+using PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageWatermark;
+using Prism.Ioc;
+using Prism.Regions;
+using System;
+using System.Collections;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Interop;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageWatermark
+{
+    /// <summary>
+    /// Interaction logic for HomePageWatermarkDialog
+    /// </summary>
+    public partial class HomePageWatermarkDialog : UserControl
+    {
+        private IContainerProvider containerProvider;
+        private IDropTargetHelper dropHelper;
+        private HomePageWatermarkDialogViewModel viewModel;
+        public HomePageWatermarkDialog(IContainerProvider containerProvider)
+        {
+            InitializeComponent();
+            this.containerProvider = containerProvider;
+            var regionManager = containerProvider.Resolve<IRegionManager>();
+            RegionManager.SetRegionManager(this, regionManager);
+            RegionManager.UpdateRegions();
+            viewModel = this.DataContext as HomePageWatermarkDialogViewModel;
+        }
+        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;
+            viewModel.fileNamesView.Clear();
+            foreach (var item in list)
+            {
+                a = (System.Data.DataRowView)item;
+                viewModel.fileNamesView.Add(lists.IndexOf(a));
+            }
+            if (viewModel.fileNamesView.Count > 0)
+            {
+                viewModel.RemoveIsEnable = "True";
+            }
+            else
+            {
+                viewModel.RemoveIsEnable = "False";
+            }
+
+        }
+
+        private void RemoveFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            viewModel.removepdffile();
+        }
+
+        private void OpenFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+            viewModel.openfiledialog();
+        }
+
+
+        private void Grid_Drop(object sender, DragEventArgs e)
+        {
+
+            try
+            {
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.Drop((System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+            string dropFile = "Drop";
+            if (e.Data.GetDataPresent(System.Windows.DataFormats.FileDrop))
+            {
+                DropGrid.Visibility = Visibility.Collapsed;
+                int count = ((System.Array)e.Data.GetData(System.Windows.DataFormats.FileDrop)).Length;
+                for (int i = 0; i < count; i++)
+                {
+                    dropFile = ((System.Array)e.Data.GetData(System.Windows.DataFormats.FileDrop)).GetValue(i).ToString(); ;
+                    //MessageBox.Show(dropFile);
+                    if (dropFile.ToLower().EndsWith("pdf"))
+                    { viewModel.addPDFFiles(dropFile); }
+                }
+            }
+        }
+        private void MainPage_DragEnter(object sender, DragEventArgs e)
+        {
+            DropGrid.Visibility = Visibility.Visible;
+            //页面编辑和缩略图
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                if (dropHelper == null)
+                {
+                    dropHelper = Activator.CreateInstance(Type.GetTypeFromCLSID(new Guid("4657278A-411B-11D2-839A-00C04FD918D0"))) as IDropTargetHelper;
+                }
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.DragEnter(new WindowInteropHelper(Window.GetWindow(this)).Handle, (System.Runtime.InteropServices.ComTypes.IDataObject)e.Data, ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+
+        private void MainPage_DragOver(object sender, DragEventArgs e)
+        {
+
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                Point iconPoint = e.GetPosition(this);
+                dropHelper?.DragOver(ref iconPoint, e.Effects);
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+
+        private void MainPage_DragLeave(object sender, DragEventArgs e)
+        {
+            DropGrid.Visibility = Visibility.Collapsed;
+            if ((e.OriginalSource as Image) != null)
+                return;
+            try
+            {
+                dropHelper?.DragLeave();
+            }
+            catch (Exception ex)
+            {
+
+            }
+
+        }
+    }
+}
+