<UserControl x:Class="PDF_Office.Views.Dialog.ToolsDialogs.SaftyDialogs.SetPasswordDialog"
             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/"             

            xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
             prism:ViewModelLocator.AutoWireViewModel="True"
             d:DesignHeight="500"
             d:DesignWidth="400"
             mc:Ignorable="d">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Name="HeadRow" Height="40" />
            <RowDefinition Height="*"/>
            <RowDefinition Height="55" />
        </Grid.RowDefinitions>
        <TextBlock Grid.Row="0" Text="设置密码" FontSize="20" FontWeight="ExtraBlack" VerticalAlignment="Center" HorizontalAlignment="Left"  Margin="20,0,0,0" Height="28" Width="120"/>
        <Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1,0,1" VerticalAlignment="Center">
            <StackPanel Margin="50,0,50,10">
                <StackPanel Margin="0,10,0,15">
                    <CheckBox x:Name="CanOpenCheckBox" IsChecked="{Binding CanOpen}" Margin="0,0,0,10" Command="{Binding DelegateSetOpenCommand}">
                        <TextBlock Text="开启文档口令"></TextBlock>
                    </CheckBox>
                    <Grid>
                        <PasswordBox x:Name="CanOpenPasswordBox" Width="300" Height="24" Visibility="Visible" VerticalAlignment="Center"
                                     GotFocus="PasswordBox_GotFocus" PasswordChanged="PasswordBox_PasswordChanged" IsEnabled="{Binding ElementName=CanOpenCheckBox, Path=IsChecked}">
                        </PasswordBox>
                        <TextBox x:Name="CanOpenTextBox" Width="300"  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,0,0,15">
                    <CheckBox IsChecked="{Binding CanEdit}" Name="CanEditCheckBox" Margin="0,0,0,10"  Command="{Binding  DelegateSetEditCommand}">
                        <TextBlock Text="许可口令"></TextBlock>
                    </CheckBox>
                    <Grid>
                        <PasswordBox x:Name="CanEditPasswordBox" Width="300" Height="24" Visibility="Visible" VerticalAlignment="Center" 
                                     GotFocus="PasswordBox_GotFocus" PasswordChanged="PasswordBox_PasswordChanged" IsEnabled="{Binding ElementName=CanEditCheckBox, Path=IsChecked}">
                        </PasswordBox>
                        <TextBox x:Name="CanEditTextBox" Width="300"  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  Margin="0,0,0,15">
                    <TextBlock Text="允许打印" Margin="0,0,0,10"/>
                    <ComboBox Width="300" Height="24" SelectedIndex="{Binding PrintMod,Mode=TwoWay}" HorizontalAlignment="Left"  IsEnabled="{Binding ElementName=CanEditCheckBox, Path=IsChecked}">
                        <ComboBoxItem Tag="NoneTag">无</ComboBoxItem>
                        <ComboBoxItem Tag="LowDpiTag">低分辨率（150dpi）</ComboBoxItem>
                        <ComboBoxItem Tag="HighDpiTag">高分辨率</ComboBoxItem>
                    </ComboBox>
                </StackPanel>
                <StackPanel  Margin="0,0,0,15">
                    <TextBlock Text="允许更改" Margin="0,0,0,10"/>
                    <ComboBox Width="300" SelectedIndex="{Binding ChangeMod,Mode=TwoWay}" Height="24" HorizontalAlignment="Left"  IsEnabled="{Binding ElementName=CanEditCheckBox, Path=IsChecked}">
                        <ComboBoxItem Tag="NoneTag">无</ComboBoxItem>
                        <ComboBoxItem Tag="ChangePageTag">插入，删除和旋转页面</ComboBoxItem>
                        <ComboBoxItem Tag="FormAndSignatureTag">填写表单域和签名现有的签名域</ComboBoxItem>
                        <ComboBoxItem Tag="AnnotAndFormAndSignatureTag">注释，填写表单域和签名现有签名域</ComboBoxItem>
                        <ComboBoxItem Tag="ExceptAbstrat">除了提取页面</ComboBoxItem>
                    </ComboBox>
                </StackPanel>
                <StackPanel  Margin="0,0,0,15">
                    <TextBlock Text="加密级别" Margin="0,0,0,10"/>
                    <ComboBox SelectedIndex="0" Width="300" Height="24" HorizontalAlignment="Left">
                        <ComboBoxItem Tag="0">128-bit-RC4</ComboBoxItem>
                        <ComboBoxItem Tag="1">128-bit-AES</ComboBoxItem>
                        <ComboBoxItem Tag="2">256 -bit-AES</ComboBoxItem>
                    </ComboBox>
                </StackPanel>
            </StackPanel>
        </Border>
        <Grid Grid.Row="2" Width="400"  VerticalAlignment="Center">
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                <Button x:Name="ConfirmEncryptBtn" Background="WhiteSmoke" Width="100" Height="25" Margin="10,0,0,0">
                    <Border>
                        <TextBlock Text="批量处理" ></TextBlock>
                    </Border>
                </Button>
            </StackPanel>
            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Background="WhiteSmoke" Width="100" Height="25" Margin="0,0,10,0" Command="{Binding DelegateCancelEncryptCommand}">
                    <Border>
                        <TextBlock Text="取消"></TextBlock>
                    </Border>
                </Button>
                <Button IsEnabled="{Binding IsEnabledConfirm, Mode=TwoWay}" Background="WhiteSmoke" Width="100" Height="25" Margin="0,0,10,0" Command="{Binding DelegateConfirmEncryptCommand}">
                    <Border>
                        <TextBlock Text="加密" ></TextBlock>
                    </Border>
                </Button>
            </StackPanel>
        </Grid>
    </Grid>
</UserControl>
