Bläddra i källkod

批量处理-安全,压缩

Li-meng-meng 2 år sedan
förälder
incheckning
c99774d903
17 ändrade filer med 1004 tillägg och 1 borttagningar
  1. 5 1
      PDF Office/App.xaml.cs
  2. 12 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogModel.cs
  3. 22 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogModel.cs
  4. 100 0
      PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogModel.cs
  5. 5 0
      PDF Office/Model/DialogNames.cs
  6. 28 0
      PDF Office/PDF Office.csproj
  7. 60 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs
  8. 76 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogViewModel.cs
  9. 74 0
      PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogViewModel.cs
  10. 16 0
      PDF Office/ViewModels/HomePageSetPasswordDialogViewModel.cs
  11. 10 0
      PDF Office/ViewModels/HomePanel/HomeGuidContentViewModel.cs
  12. 21 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialog.xaml
  13. 25 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialog.xaml.cs
  14. 134 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialog.xaml
  15. 50 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialog.xaml.cs
  16. 178 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialog.xaml
  17. 188 0
      PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialog.xaml.cs

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

@@ -29,7 +29,8 @@ using PDF_Office.Views.Dialog.ToolsDialogs.CompressDialogs;
 using PDF_Office.Views.Dialog.PageEditDialogs;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs ;
 using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePagePrinter;
-
+using PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
+using PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
 
 namespace PDF_Office
 {
@@ -105,6 +106,8 @@ namespace PDF_Office
             containerRegistry.RegisterForNavigation<HomePagePrinterModPosterContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModMutipleContent>();
             containerRegistry.RegisterForNavigation<HomePagePrinterModBookletContent>();
+            containerRegistry.RegisterForNavigation<HomePageCompressDialog>();
+            containerRegistry.RegisterForNavigation<HomePageSetPasswordDialog>();
 
             //注册弹窗
             containerRegistry.RegisterDialog<VerifyPassWordDialog>(DialogNames.VerifyPassWordDialog);
@@ -123,6 +126,7 @@ namespace PDF_Office
             containerRegistry.RegisterDialog<HomePagePrinterDialog>(DialogNames.HomePagePrinterDialog);
             containerRegistry.RegisterDialog<HomePagePrinterPageSetDialog>(DialogNames.HomePagePrinterPageSetDialog);
             containerRegistry.RegisterDialog<HomePagePictureToPDFDialog>(DialogNames.HomePagePictureToPDFDialog);
+            containerRegistry.RegisterDialog<HomePageBatchProcessingDialog>(DialogNames.HomePageBatchProcessingDialog);
 
 
         }

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

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    internal class HomePageBatchProcessingDialogModel
+    {
+    }
+}

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

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageCompressDialogModel
+    {
+        public enum EnumQualityLevel
+        {
+            StatusLarge = 100,
+            StatusStandard = 80,
+            StatusDefault = 45,
+            StatusLittle = 40,
+            StatusMicro = 10
+        }
+
+        public EnumQualityLevel CompressQuality { get; set; }
+    }
+}

+ 100 - 0
PDF Office/Model/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogModel.cs

@@ -0,0 +1,100 @@
+using ComPDFKit.PDFDocument;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PDF_Office.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageSetPasswordDialogModel
+    {
+        public bool CanOpen { get; set; }
+
+        public bool CanEdit { get; set; }
+
+        public static string PasswordForOpen { get; set; }
+
+        public static string PasswordForEdit { get; set; }
+
+        public enum PrintMod
+        {
+            None,
+            LowDpi,
+            HighDpi
+        }
+
+        public enum ChangeMod
+        {
+            None,
+            ChangePage,
+            FormAndSignature,
+            AnnotAndFormAndSignature,
+            ExceptAbstrat
+        }
+
+        ///<returns>
+        ///生成带有指定权限的CPDFPermissionsInfo对象
+        ///</returns>
+        public CPDFPermissionsInfo CreatePermissionsInfo(PrintMod printMod, ChangeMod changeMod)
+        {
+            CPDFPermissionsInfo permissionsInfo = new CPDFPermissionsInfo();
+            switch (printMod)
+            {
+                case PrintMod.None:
+                    permissionsInfo.AllowsPrinting = false;
+                    permissionsInfo.AllowsHighQualityPrinting = false;
+                    break;
+                case PrintMod.LowDpi:
+                    permissionsInfo.AllowsPrinting = true;
+                    permissionsInfo.AllowsHighQualityPrinting = false;
+                    break;
+                case PrintMod.HighDpi:
+                    permissionsInfo.AllowsHighQualityPrinting = true;
+                    permissionsInfo.AllowsPrinting = true;
+                    break;
+                default:
+                    break;
+            }
+            switch (changeMod)
+            {
+                case ChangeMod.None:
+                    permissionsInfo.AllowsCopying = false;
+                    permissionsInfo.AllowsDocumentAssembly = false;
+                    permissionsInfo.AllowsCommenting = false;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = false;
+                    break;
+                case ChangeMod.ChangePage:
+                    permissionsInfo.AllowsCopying = false;
+                    permissionsInfo.AllowsDocumentAssembly = true;
+                    permissionsInfo.AllowsCommenting = false;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = false;
+                    break;
+                case ChangeMod.FormAndSignature:
+                    permissionsInfo.AllowsCopying = false;
+                    permissionsInfo.AllowsDocumentAssembly = false;
+                    permissionsInfo.AllowsCommenting = false;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = true;
+                    break;
+                case ChangeMod.AnnotAndFormAndSignature:
+                    permissionsInfo.AllowsCopying = false;
+                    permissionsInfo.AllowsDocumentAssembly = false;
+                    permissionsInfo.AllowsCommenting = true;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = true;
+                    break;
+                case ChangeMod.ExceptAbstrat:
+                    permissionsInfo.AllowsCopying = true;
+                    permissionsInfo.AllowsDocumentAssembly = true;
+                    permissionsInfo.AllowsCommenting = true;
+                    permissionsInfo.AllowsDocumentChanges = false;
+                    permissionsInfo.AllowsFormFieldEntry = true;
+                    break;
+            }
+            return permissionsInfo;
+        }
+    }
+}

+ 5 - 0
PDF Office/Model/DialogNames.cs

@@ -90,5 +90,10 @@ namespace PDF_Office.Model
         /// </summary>
         public static string HomePagePictureToPDFDialog = "HomePagePictureToPDFDialog";
 
+        ///<summary>
+        ///主页工具-PDF批量工具
+        /// </summary>
+        public static string HomePageBatchProcessingDialog ="HomePageBatchProcessingDialog";
+
     }
 }

+ 28 - 0
PDF Office/PDF Office.csproj

@@ -184,6 +184,9 @@
     <Compile Include="CustomControl\LoadingControl.xaml.cs">
       <DependentUpon>LoadingControl.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialogModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialogModel.cs" />
+    <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialogModel.cs" />
     <Compile Include="Model\Dialog\HomePageToolsDialogs\HomePagePictureToPDFDialogModel.cs" />
     <Compile Include="Model\Dialog\ToolsDialogs\CompressDialogModel\CompressDialogModel.cs" />
     <Compile Include="Model\Dialog\ToolsDialogs\SaftyDialogs\CheckPasswordDialogModel.cs" />
@@ -209,6 +212,9 @@
     <Compile Include="ViewModels\BottomToolContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\ExtractDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\FullScreenWindowViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialogViewModel.cs" />
+    <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModBookletContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModMutipleContentViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePrinter\HomePagePrinterModPosterContentViewModel.cs" />
@@ -226,6 +232,7 @@
     <Compile Include="ViewModels\Dialog\ToolsDialogs\SaftyDialogs\SetPasswordDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\VerifyPassWordDialogViewModel.cs" />
     <Compile Include="ViewModels\Dialog\HomePageToolsDialogs\HomePagePictureToPDFDialogViewModel.cs" />
+    <Compile Include="ViewModels\HomePageSetPasswordDialogViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\HomeCloudContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\HomeGuidContentViewModel.cs" />
     <Compile Include="ViewModels\HomePanel\HomeToolsContentViewModel.cs" />
@@ -243,6 +250,15 @@
     <Compile Include="Views\Dialog\FullScreenWindow.xaml.cs">
       <DependentUpon>FullScreenWindow.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageBatchProcessingDialog.xaml.cs">
+      <DependentUpon>HomePageBatchProcessingDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageCompressDialog.xaml.cs">
+      <DependentUpon>HomePageCompressDialog.xaml</DependentUpon>
+    </Compile>
+    <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialog.xaml.cs">
+      <DependentUpon>HomePageSetPasswordDialog.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Views\Dialog\HomePageToolsDialogs\HomePageExtractDialog.xaml.cs">
       <DependentUpon>HomePageExtractDialog.xaml</DependentUpon>
     </Compile>
@@ -425,6 +441,18 @@
       <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\HomePageCompressDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
+    <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageBatchProcessing\HomePageSetPasswordDialog.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Views\Dialog\HomePageToolsDialogs\HomePageExtractDialog.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>

+ 60 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialogViewModel.cs

@@ -0,0 +1,60 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Drawing;
+using System.Linq;
+using System.Windows.Controls;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageBatchProcessingDialogViewModel : BindableBase, IDialogAware
+    {
+        public IRegionManager BatchProcessingRegion;
+
+        public string BatchProcessingRegionName { get; set; }
+
+        public List<string> GetBatchProcessing = new List<string> { "HomePageSetPasswordDialog", "HomePageCompressDialog" };
+
+        private string batchProcessingSelectedIndex = "0";
+        public string BatchProcessingSelectedIndex
+        {
+            get { return batchProcessingSelectedIndex; }
+            set
+            {
+                SetProperty(ref batchProcessingSelectedIndex, value);
+            }
+        }
+
+        public HomePageBatchProcessingDialogViewModel(IRegionManager regionManager)
+        {
+            BatchProcessingRegion = regionManager;
+            BatchProcessingRegionName = Guid.NewGuid().ToString();
+        }
+
+
+        public string Title => "PDF批量工具";
+
+        public event Action<IDialogResult> RequestClose;
+
+        public bool CanCloseDialog()
+        {
+            return true;
+        }
+
+        public void OnDialogClosed()
+        {
+
+        }
+
+        public void OnDialogOpened(IDialogParameters parameters)
+        {
+            BatchProcessingRegion.RequestNavigate(BatchProcessingRegionName, GetBatchProcessing[0]);
+            BatchProcessingRegion.RequestNavigate(BatchProcessingRegionName, GetBatchProcessing[1]);
+            BatchProcessingSelectedIndex = "0";
+
+        }
+    }
+}

+ 76 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialogViewModel.cs

@@ -0,0 +1,76 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Windows;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageCompressDialogViewModel : BindableBase, INavigationAware
+    {
+        public HomePageCompressDialogViewModel()
+        {
+
+        }
+        private DataTable imagesDataTable = new DataTable();
+        public DataTable ImagesDataTable
+        {
+            get { return imagesDataTable; }
+            set
+            {
+                SetProperty(ref imagesDataTable, 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 Visibility addFileVisibility = Visibility.Hidden;
+        public Visibility AddFileVisibility
+        {
+            get { return addFileVisibility; }
+            set
+            {
+                SetProperty(ref addFileVisibility, value);
+                RaisePropertyChanged();
+
+            }
+        }
+
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+            
+        }
+
+    }
+}

+ 74 - 0
PDF Office/ViewModels/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialogViewModel.cs

@@ -0,0 +1,74 @@
+using Prism.Commands;
+using Prism.Mvvm;
+using Prism.Regions;
+using Prism.Services.Dialogs;
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Windows;
+
+namespace PDF_Office.ViewModels.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    public class HomePageSetPasswordDialogViewModel : BindableBase, INavigationAware
+    {
+        public HomePageSetPasswordDialogViewModel()
+        {
+
+        }
+        private DataTable imagesDataTable = new DataTable();
+        public DataTable ImagesDataTable
+        {
+            get { return imagesDataTable; }
+            set
+            {
+                SetProperty(ref imagesDataTable, 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 Visibility addFileVisibility = Visibility.Hidden;
+        public Visibility AddFileVisibility
+        {
+            get { return addFileVisibility; }
+            set
+            {
+                SetProperty(ref addFileVisibility, value);
+                RaisePropertyChanged();
+
+            }
+        }
+
+
+        public bool IsNavigationTarget(NavigationContext navigationContext)
+        {
+            return true;
+        }
+
+        public void OnNavigatedFrom(NavigationContext navigationContext)
+        {
+        }
+
+        public void OnNavigatedTo(NavigationContext navigationContext)
+        {
+        }
+    }
+}

+ 16 - 0
PDF Office/ViewModels/HomePageSetPasswordDialogViewModel.cs

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

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

@@ -68,6 +68,11 @@ namespace PDF_Office.ViewModels.HomePanel
                         break;
 
                     case PDFToolType.Compress:
+                        DialogParameters compresspdf = new DialogParameters();
+                        compresspdf.Add(ParameterNames.PDFViewer, viewer);
+                        compresspdf.Add(ParameterNames.FilePath, dlg.FileName);
+                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, compresspdf, e => { });
+                        break;
                         break;
 
                     case PDFToolType.Merge:
@@ -84,6 +89,11 @@ namespace PDF_Office.ViewModels.HomePanel
                         break;
 
                     case PDFToolType.Security:
+                        DialogParameters securitypdf = new DialogParameters();
+                        securitypdf.Add(ParameterNames.PDFViewer, viewer); ;
+                        securitypdf.Add(ParameterNames.FilePath, dlg.FileName);
+                        dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, securitypdf, e => { });
+                        
                         break;
                 }
 

+ 21 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialog.xaml

@@ -0,0 +1,21 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageBatchProcessingDialog"
+             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"
+             d:DesignHeight="554"
+             d:DesignWidth="892"
+             mc:Ignorable="d">
+    <UserControl.Resources>
+        <Style TargetType="{x:Type TabItem}">
+            <Setter Property="Width" Value="106"/>
+            <Setter Property="Height" Value="32"/>
+            <Setter Property="Header" Value="{Binding DataContext.Title}"></Setter>
+        </Style>
+    </UserControl.Resources>
+    <Grid>
+        <TabControl x:Name="BatchProcessingTabControl" prism:RegionManager.RegionName="{Binding BatchProcessingRegionName}" SelectedIndex="{Binding BatchProcessingSelectedIndex}"></TabControl>
+    </Grid>
+</UserControl>

+ 25 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageBatchProcessingDialog.xaml.cs

@@ -0,0 +1,25 @@
+using Prism.Ioc;
+using Prism.Regions;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    /// <summary>
+    /// Interaction logic for HomePageBatchProcessingDialog
+    /// </summary>
+    public partial class HomePageBatchProcessingDialog : UserControl
+    {
+        private IContainerProvider containerProvider;
+        public HomePageBatchProcessingDialog(IContainerProvider containerProvider)
+        {
+            
+            InitializeComponent();
+            this.containerProvider = containerProvider;
+            var regionManager = containerProvider.Resolve<IRegionManager>();
+            RegionManager.SetRegionManager(this, regionManager);
+            RegionManager.UpdateRegions();
+            this.BatchProcessingTabControl.SelectedIndex = 0;
+
+        }
+    }
+}

+ 134 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialog.xaml

@@ -0,0 +1,134 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageCompressDialog"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:convert="clr-namespace:PDF_Office.DataConvert"
+             d:DesignHeight="462"
+             d:DesignWidth="892"
+             mc:Ignorable="d">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="632"/>
+            <ColumnDefinition Width="260"/>
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="482"/>
+                <RowDefinition Height="72"/>
+            </Grid.RowDefinitions>
+            <Button Name="BtnBlank" Grid.Row="0" Background="Green" Height="400" Width="400" Visibility="{Binding AddFileVisibility}" >
+            </Button>
+            <ListView x:Name="listView" DataContext="{Binding ImagesDataTable}" Grid.Row="0" Background="White"  ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" >
+                <ListView.ContextMenu>
+                    <ContextMenu  StaysOpen="True" >
+                        <MenuItem Header="打开文件" Name="OpenFileMenuItem"  Click="OpenFileMenuItem_Click"/>
+                        <MenuItem Header="移除" Name="RemoveFileMenuItem" Click="RemoveFileMenuItem_Click"/>
+                    </ContextMenu>
+                </ListView.ContextMenu>
+                <ListView.View>
+                    <GridView>
+                        <GridViewColumn  Header="文档名"  Width="400" DisplayMemberBinding="{Binding FileName}"/>
+                        <GridViewColumn Header="大小" Width="100" DisplayMemberBinding="{Binding FileSize}"/>
+                        <GridViewColumn Header="状态" Width="80" >
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding FileState}" TextDecorations="Underline" Foreground="Black"/>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                    </GridView>
+                </ListView.View>
+                <ListView.ItemContainerStyle>
+                    <Style TargetType="ListViewItem">
+                        <Setter Property="Height" Value="42"/>
+                        <Style.Triggers>
+                            <Trigger Property="ListView.AlternationIndex" Value="1">
+                                <Setter Property="Background" Value="LightGray"/>
+                            </Trigger>
+                        </Style.Triggers>
+                    </Style>
+                </ListView.ItemContainerStyle>
+            </ListView>
+            <Grid Grid.Row="1">
+                <Button x:Name="MenuBtn"  Width="113"
+                    Height="40"
+                    Margin="25,0,0,0"
+                    HorizontalAlignment="Left" Click="Menu_Click">
+                    <StackPanel Orientation="Horizontal" >
+                        <Border HorizontalAlignment="Right">
+                            <TextBlock Text="添加文件" FontSize="18" Foreground="Black"></TextBlock>
+                        </Border>
+                        <Border  Margin="12,0,0,0">
+                            <Path  VerticalAlignment="Center" HorizontalAlignment="Right" Stroke="Black"  Data="M0 0L8 4 L16 0" Height="10" Stretch="Fill" />
+                        </Border>
+                    </StackPanel>
+                </Button>
+                <Popup x:Name="menuPop1" StaysOpen="False"  AllowsTransparency="True" PlacementTarget="{Binding ElementName=MenuBtn}">
+                    <Grid Height="auto" Width="auto" HorizontalAlignment="Left">
+                        <Border BorderThickness="0" CornerRadius="3" Background="White" Margin="3">
+                            <Border.Effect>
+                                <DropShadowEffect ShadowDepth="0" Color="#FFB6B6B6"/>
+                            </Border.Effect>
+                            <StackPanel Margin="0">
+                                <MenuItem x:Name="添加文件" Header="添加文件"></MenuItem>
+                                <MenuItem x:Name="添加文件夹" Header="添加文件夹"></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}"
+                    >
+
+                </Button>
+            </Grid>
+        </Grid>
+        <Grid Grid.Column="1" Background="WhiteSmoke">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="72"/>
+            </Grid.RowDefinitions>
+            <StackPanel Orientation="Vertical" Margin="15,16,0,0" Grid.Row="0">
+                <TextBlock Text="优化选项"/>
+                <RadioButton Click="RadioButton_Click" Margin="0,8,0,0">
+                    <TextBlock Text="大型文件"/>
+                </RadioButton>
+                <RadioButton Click="RadioButton_Click" Margin="0,8,0,0">
+                    <TextBlock Text="标准文件"/>
+                </RadioButton>
+                <RadioButton Click="RadioButton_Click" Margin="0,8,0,0">
+                    <TextBlock Text="小型文件"/>
+                </RadioButton>
+                <RadioButton Click="RadioButton_Click" Margin="0,8,0,0">
+                    <TextBlock Text="微型文件"/>
+                </RadioButton>
+            </StackPanel>
+            <Grid Grid.Row="2">
+                <Button Height="40" Width="228" Background="Black">
+                    <TextBlock Text="压缩" FontSize="18" Foreground="White"/>
+                </Button>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 50 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageCompressDialog.xaml.cs

@@ -0,0 +1,50 @@
+using System.Collections;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    /// <summary>
+    /// Interaction logic for HomePageCompressDialog
+    /// </summary>
+    public partial class HomePageCompressDialog : UserControl
+    {
+        public string Title { get; set; }
+        public HomePageCompressDialog()
+        {
+            InitializeComponent();
+            Title = "压缩";
+            this.DataContext = this;
+        }
+        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 datarowview;
+            foreach (var item in list)
+            {
+                datarowview = (System.Data.DataRowView)item;
+            }
+
+        }
+
+        private void RemoveFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+
+        }
+
+        private void OpenFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+
+        }
+
+        private void RadioButton_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+
+        }
+    }
+}

+ 178 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialog.xaml

@@ -0,0 +1,178 @@
+<UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageSetPasswordDialog"
+             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+             xmlns:prism="http://prismlibrary.com/"
+             prism:ViewModelLocator.AutoWireViewModel="True"
+             xmlns:convert="clr-namespace:PDF_Office.DataConvert"
+             d:DesignHeight="462"
+             d:DesignWidth="892"
+             mc:Ignorable="d">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
+        </ResourceDictionary>
+    </UserControl.Resources>
+
+    <Grid>
+        <Grid.ColumnDefinitions>
+            <ColumnDefinition Width="632"/>
+            <ColumnDefinition Width="260"/>
+        </Grid.ColumnDefinitions>
+        <Grid Grid.Column="0">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="482"/>
+                <RowDefinition Height="72"/>
+            </Grid.RowDefinitions>
+            <Button Name="BtnBlank" Grid.Row="0" Background="Green" Height="400" Width="400" Visibility="{Binding AddFileVisibility}" >
+            </Button>
+            <ListView x:Name="listView" DataContext="{Binding ImagesDataTable}" Grid.Row="0" Background="White"  ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" >
+                <ListView.ContextMenu>
+                    <ContextMenu  StaysOpen="True" >
+                        <MenuItem Header="打开文件" Name="OpenFileMenuItem"  Click="OpenFileMenuItem_Click"/>
+                        <MenuItem Header="移除" Name="RemoveFileMenuItem" Click="RemoveFileMenuItem_Click"/>
+                    </ContextMenu>
+                </ListView.ContextMenu>
+                <ListView.View>
+                    <GridView>
+                        <GridViewColumn  Header="文档名"  Width="400" DisplayMemberBinding="{Binding FileName}"/>
+                        <GridViewColumn Header="大小" Width="100" DisplayMemberBinding="{Binding FileSize}"/>
+                        <GridViewColumn Header="状态" Width="80" >
+                            <GridViewColumn.CellTemplate>
+                                <DataTemplate>
+                                    <TextBlock Text="{Binding FileState}" TextDecorations="Underline" Foreground="Black"/>
+                                </DataTemplate>
+                            </GridViewColumn.CellTemplate>
+                        </GridViewColumn>
+                    </GridView>
+                </ListView.View>
+                <ListView.ItemContainerStyle>
+                    <Style TargetType="ListViewItem">
+                        <Setter Property="Height" Value="42"/>
+                        <Style.Triggers>
+                            <Trigger Property="ListView.AlternationIndex" Value="1">
+                                <Setter Property="Background" Value="LightGray"/>
+                            </Trigger>
+                        </Style.Triggers>
+                    </Style>
+                </ListView.ItemContainerStyle>
+            </ListView>
+            <Grid Grid.Row="1">
+                <Button x:Name="MenuBtn"  Width="113"
+                    Height="40"
+                    Margin="25,0,0,0"
+                    HorizontalAlignment="Left" Click="Menu_Click">
+                    <StackPanel Orientation="Horizontal" >
+                        <Border HorizontalAlignment="Right">
+                            <TextBlock Text="添加文件" FontSize="18" Foreground="Black"></TextBlock>
+                        </Border>
+                        <Border  Margin="12,0,0,0">
+                            <Path  VerticalAlignment="Center" HorizontalAlignment="Right" Stroke="Black"  Data="M0 0L8 4 L16 0" Height="10" Stretch="Fill" />
+                        </Border>
+                    </StackPanel>
+                </Button>
+                <Popup x:Name="menuPop1" StaysOpen="False"  AllowsTransparency="True" PlacementTarget="{Binding ElementName=MenuBtn}">
+                    <Grid Height="auto" Width="auto" HorizontalAlignment="Left">
+                        <Border BorderThickness="0" CornerRadius="3" Background="White" Margin="3">
+                            <Border.Effect>
+                                <DropShadowEffect ShadowDepth="0" Color="#FFB6B6B6"/>
+                            </Border.Effect>
+                            <StackPanel Margin="0">
+                                <MenuItem x:Name="添加文件" Header="添加文件" ></MenuItem>
+                                <MenuItem x:Name="添加文件夹" Header="添加文件夹" ></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}"
+                    >
+
+                </Button>
+            </Grid>
+        </Grid>
+        <Grid Grid.Column="1" Background="WhiteSmoke">
+            <Grid.RowDefinitions>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="*"/>
+                <RowDefinition Height="72"/>
+            </Grid.RowDefinitions>
+            <Grid Grid.Row="0">
+                <StackPanel Margin="15,23,0,0">
+                    <TextBlock Text="设置密码" Width="48" Height="20" HorizontalAlignment="Left"/>
+                    <StackPanel Margin="0,11,0,0">
+                        <CheckBox x:Name="CanOpenCheckBox" IsChecked="{Binding CanOpen}" Margin="0,0,0,10" >
+                            <TextBlock Text="开启文档口令"></TextBlock>
+                        </CheckBox>
+                        <Grid HorizontalAlignment="Left" Width="228">
+                            <PasswordBox x:Name="CanOpenPasswordBox" Width="228" Height="24" Visibility="Visible" VerticalAlignment="Center"
+                                     GotFocus="PasswordBox_GotFocus" PasswordChanged="PasswordBox_PasswordChanged" IsEnabled="{Binding ElementName=CanOpenCheckBox, Path=IsChecked}">
+                            </PasswordBox>
+                            <TextBox x:Name="CanOpenTextBox" Width="228"  Height="24" Visibility="Hidden" VerticalAlignment="Center"
+                                 GotFocus="TextBox_GotFocus" TextChanged="TextBox_TextChanged" >
+                            </TextBox>
+                            <Label x:Name="ShowOpenPasswordBoxEyeLabel" HorizontalAlignment="Right" Margin="0,3,0,3" 
+                               MouseLeftButtonUp="ShowPasswordBoxEyeLabel_MouseLeftButtonUp">
+                                <Border Height="23" Width="27" Background="MediumVioletRed" ></Border>
+                            </Label>
+                            <Label x:Name="ShowOpenTextBoxEyeLabel" HorizontalAlignment="Right" Visibility="Hidden" Margin="0,3,0,3" 
+                               MouseLeftButtonUp="ShowTextBoxEyeLabel_MouseLeftButtonUp">
+                                <Border Height="23" Width="27" Background="LightSeaGreen" ></Border>
+                            </Label>
+                        </Grid>
+                    </StackPanel>
+                    <StackPanel Margin="0,17,0,0">
+                        <CheckBox IsChecked="{Binding CanEdit}" Name="CanEditCheckBox" Margin="0,0,0,10"  >
+                            <TextBlock Text="许可口令"></TextBlock>
+                        </CheckBox>
+                        <Grid HorizontalAlignment="Left" Width="228">
+                            <PasswordBox x:Name="CanEditPasswordBox" Width="228" Height="24" Visibility="Visible" VerticalAlignment="Center" 
+                                     GotFocus="PasswordBox_GotFocus" PasswordChanged="PasswordBox_PasswordChanged" IsEnabled="{Binding ElementName=CanEditCheckBox, Path=IsChecked}">
+                            </PasswordBox>
+                            <TextBox x:Name="CanEditTextBox" Width="228"  Height="24" Visibility="Hidden" VerticalAlignment="Center"
+                                 GotFocus="TextBox_GotFocus" TextChanged="TextBox_TextChanged">
+                            </TextBox>
+                            <Label x:Name="ShowEditPasswordBoxEyeLabel" HorizontalAlignment="Right" Margin="0,3,0,3" 
+                               MouseLeftButtonUp="ShowPasswordBoxEyeLabel_MouseLeftButtonUp">
+                                <Border Height="23" Width="27" Background="MediumVioletRed" 
+                                      ></Border>
+                            </Label>
+                            <Label x:Name="ShowEditTextBoxEyeLabel" HorizontalAlignment="Right" Visibility="Hidden" Margin="0,3,0,3"  
+                                MouseLeftButtonUp="ShowTextBoxEyeLabel_MouseLeftButtonUp">
+                                <Border Height="23" Width="27" Background="LightSeaGreen" ></Border>
+                            </Label>
+                        </Grid>
+                    </StackPanel>
+                </StackPanel>
+            </Grid>
+            <Grid Grid.Row="1">
+                <StackPanel Margin="15,0,0,0">
+                    <TextBlock Text="允许打印" Width="48" Height="20" HorizontalAlignment="Left"/>
+                    <ComboBox Height="24" Width="228" HorizontalAlignment="Left" Margin="0,8.5,0,0" ></ComboBox>
+                    <TextBlock Text="允许更改" Margin="0,20.5,0,0" Width="48" Height="20" HorizontalAlignment="Left"/>
+                    <ComboBox Height="24" Width="228" HorizontalAlignment="Left" Margin="0,8.5,0,0" ></ComboBox>
+                    <TextBlock Text="加密级别" Width="48" Height="20" HorizontalAlignment="Left" Margin="0,20.5,0,0"/>
+                    <ComboBox Height="24" Width="228" HorizontalAlignment="Left" Margin="0,8.5,0,0" ></ComboBox>
+                </StackPanel>
+            </Grid>
+            <Grid Grid.Row="2">
+                <Button Height="40" Width="228" Background="Black">
+                    <TextBlock Text="设置安全密码" FontSize="18" Foreground="White"/>
+                </Button>
+            </Grid>
+        </Grid>
+    </Grid>
+</UserControl>

+ 188 - 0
PDF Office/Views/Dialog/HomePageToolsDialogs/HomePageBatchProcessing/HomePageSetPasswordDialog.xaml.cs

@@ -0,0 +1,188 @@
+using PDF_Office.Model.Dialog.ToolsDialogs.SaftyDialogs;
+using PDF_Office.ViewModels.Dialog.ToolsDialogs.SaftyDialogs;
+using System;
+using System.Collections;
+using System.Windows;
+using System.Windows.Controls;
+
+namespace PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing
+{
+    /// <summary>
+    /// Interaction logic for HomePageSetPasswordDialog
+    /// </summary>
+    public partial class HomePageSetPasswordDialog : UserControl
+    {
+        public string Title { get; set; }
+
+        private Boolean canOpenPasswordBoxHasFocus = false;
+        private Boolean canOpenTextBoxHasFocus = false;
+
+        private Boolean canEditPasswordBoxHasFocus = false;
+        private Boolean canEditTextBoxHasFocus = false;
+
+        private string canOpenPasswordBoxName = "CanOpenPasswordBox";
+        private string canEditPasswordBoxName = "CanEditPasswordBox";
+
+        private string canOpenTextBoxName = "CanOpenTextBox";
+        private string canEditTextBoxName = "CanEditTextBox";
+
+        private string showOpenPasswordBoxEyeLabelName = "ShowOpenPasswordBoxEyeLabel";
+        private string showEditPasswordBoxEyeLabelName = "ShowEditPasswordBoxEyeLabel";
+
+        private string showOpenTextBoxEyeLabelName = "ShowOpenTextBoxEyeLabel";
+        private string showEditTextBoxEyeLabelName = "ShowEditTextBoxEyeLabel";
+
+        public HomePageSetPasswordDialog()
+        {
+            InitializeComponent();
+            Title = "安全";
+            this.DataContext = this;
+        }
+        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 datarowview;
+            foreach (var item in list)
+            {
+                datarowview = (System.Data.DataRowView)item;
+            }
+
+        }
+
+        private void RemoveFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+
+        }
+
+        private void OpenFileMenuItem_Click(object sender, System.Windows.RoutedEventArgs e)
+        {
+
+        }
+
+        private void PasswordBox_GotFocus(object sender, RoutedEventArgs e)
+        {
+            var passwordBox = sender as PasswordBox;
+            if (passwordBox.Name == canOpenPasswordBoxName)
+            {
+                canOpenPasswordBoxHasFocus = true;
+                canOpenTextBoxHasFocus = false;
+            }
+            else if (passwordBox.Name == canEditPasswordBoxName)
+            {
+                canEditPasswordBoxHasFocus = true;
+                canEditTextBoxHasFocus = false;
+            }
+        }
+
+        private void TextBox_GotFocus(object sender, RoutedEventArgs e)
+        {
+            var textBox = sender as TextBox;
+            if (textBox.Name == canOpenTextBoxName)
+            {
+                canOpenPasswordBoxHasFocus = false;
+                canOpenTextBoxHasFocus = true;
+            }
+            else if (textBox.Name == canEditTextBoxName)
+            {
+                canEditPasswordBoxHasFocus = false;
+                canEditTextBoxHasFocus = true;
+            }
+        }
+
+        private void PasswordBox_PasswordChanged(object sender, RoutedEventArgs e)
+        {
+            var passwordBox = sender as PasswordBox;
+            if (passwordBox.Name == canOpenPasswordBoxName)
+            {
+                if (canOpenTextBoxHasFocus)
+                {
+                    return;
+                }
+                CanOpenTextBox.Text = CanOpenPasswordBox.Password;
+               // SetPasswordDialogModel.PasswordForOpen = CanOpenTextBox.Text;
+                //((SetPasswordDialogViewModel)this.DataContext).DelegateCanOpenTextChangedCommand.Execute();
+            }
+            else if (passwordBox.Name == canEditPasswordBoxName)
+            {
+                if (canEditTextBoxHasFocus)
+                {
+                    return;
+                }
+                CanEditTextBox.Text = CanEditPasswordBox.Password;
+                //SetPasswordDialogModel.PasswordForEdit = CanEditTextBox.Text;
+                //((SetPasswordDialogViewModel)this.DataContext).DelegateCanOpenTextChangedCommand.Execute();
+            }
+        }
+
+        private void TextBox_TextChanged(object sender, TextChangedEventArgs e)
+        {
+            var textBox = sender as TextBox;
+            if (textBox.Name == canOpenTextBoxName)
+            {
+                if (canOpenPasswordBoxHasFocus)
+                {
+                    return;
+                }
+                CanOpenPasswordBox.Password = CanOpenTextBox.Text;
+                //SetPasswordDialogModel.PasswordForOpen = CanOpenPasswordBox.Password;
+                //((SetPasswordDialogViewModel)this.DataContext).DelegateCanOpenTextChangedCommand.Execute();
+            }
+            else if (textBox.Name == canEditTextBoxName)
+            {
+                if (canEditPasswordBoxHasFocus)
+                { return; }
+                CanEditPasswordBox.Password = CanEditTextBox.Text;
+                //SetPasswordDialogModel.PasswordForEdit = CanEditPasswordBox.Password;
+                //((SetPasswordDialogViewModel)this.DataContext).DelegateCanOpenTextChangedCommand.Execute();
+            }
+        }
+
+        private void ShowPasswordBoxEyeLabel_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            var label = sender as Label;
+            if (label.Name == showOpenPasswordBoxEyeLabelName)
+            {
+                CanOpenPasswordBox.Visibility = Visibility.Hidden;
+                ShowOpenPasswordBoxEyeLabel.Visibility = Visibility.Hidden;
+
+                CanOpenTextBox.Visibility = Visibility.Visible;
+                ShowOpenTextBoxEyeLabel.Visibility = Visibility.Visible;
+            }
+            else if (label.Name == showEditPasswordBoxEyeLabelName)
+            {
+                CanEditPasswordBox.Visibility = Visibility.Hidden;
+                ShowEditPasswordBoxEyeLabel.Visibility = Visibility.Hidden;
+
+                CanEditTextBox.Visibility = Visibility.Visible;
+                ShowEditTextBoxEyeLabel.Visibility = Visibility.Visible;
+            }
+        }
+
+        private void ShowTextBoxEyeLabel_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
+        {
+            var label = sender as Label;
+            if (label.Name == showOpenTextBoxEyeLabelName)
+            {
+                CanOpenPasswordBox.Visibility = Visibility.Visible;
+                ShowOpenPasswordBoxEyeLabel.Visibility = Visibility.Visible;
+
+                CanOpenTextBox.Visibility = Visibility.Hidden;
+                ShowOpenTextBoxEyeLabel.Visibility = Visibility.Hidden;
+            }
+            else if (label.Name == showEditTextBoxEyeLabelName)
+            {
+                CanEditPasswordBox.Visibility = Visibility.Visible;
+                ShowEditPasswordBoxEyeLabel.Visibility = Visibility.Visible;
+
+                CanEditTextBox.Visibility = Visibility.Hidden;
+                ShowEditTextBoxEyeLabel.Visibility = Visibility.Hidden;
+            }
+        }
+    }
+}