SetEncryptionControl.xaml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <UserControl x:Class="ComPDFKit.Controls.PDFControl.SetEncryptionControl"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  7. mc:Ignorable="d"
  8. Height="362" Width="368">
  9. <UserControl.Resources>
  10. <ResourceDictionary>
  11. <ResourceDictionary.MergedDictionaries>
  12. <ResourceDictionary Source="pack://application:,,,/ComPDFKit.Controls;component/Asset/Styles/ComboBoxStyle.xaml"/>
  13. </ResourceDictionary.MergedDictionaries>
  14. <common:SecurityResourceConverter x:Key="SecurityResourceConverter"/>
  15. <common:AndMultiBoolValueConverter x:Key="AndMultiValueConverter"></common:AndMultiBoolValueConverter>
  16. <common:ReverseBoolConverter x:Key="ReverseBoolConverter" />
  17. </ResourceDictionary>
  18. </UserControl.Resources>
  19. <Grid>
  20. <Grid.RowDefinitions>
  21. <RowDefinition Height="12*"></RowDefinition>
  22. <RowDefinition Height="20*"></RowDefinition>
  23. <RowDefinition Height="Auto"></RowDefinition>
  24. </Grid.RowDefinitions>
  25. <Grid Background="White" Margin="20,0,0,0" Panel.ZIndex="1" Height="20" HorizontalAlignment="Left" VerticalAlignment="Top">
  26. <TextBlock Foreground="#001A4E" Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Title_OpenPassword}" FontWeight="Bold" FontSize="16"></TextBlock>
  27. </Grid>
  28. <Border Margin="0,10,7,12" BorderBrush="#33000000" BorderThickness="1">
  29. <Grid Margin="8,0,20,15">
  30. <Grid.RowDefinitions>
  31. <RowDefinition Height="*"></RowDefinition>
  32. <RowDefinition Height="Auto"></RowDefinition>
  33. </Grid.RowDefinitions>
  34. <StackPanel Orientation="Horizontal">
  35. <CheckBox IsChecked="{Binding IsUserPasswordEnabled, Mode=OneWayToSource}" x:Name="ChbUserPassword" Width="20" Height="20" Margin="0,5,0,0"></CheckBox>
  36. <TextBlock Height="20" FontFamily="Microsoft YaHei" FontSize="14" Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Chk_OpenPassword}"></TextBlock>
  37. </StackPanel>
  38. <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="20,0,0,-5">
  39. <TextBlock Height="25" FontFamily="Microsoft YaHei" FontSize="14" Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Text_Password}"/>
  40. <common:PasswordBoxControl Password="{Binding UserPassword, Mode=OneWayToSource}" IsEnabled="{Binding IsUserPasswordEnabled,Mode=OneWay}" Margin="10,0,0,0" Watermark="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Holder_EnterPassword}" Height="41" Width="210"></common:PasswordBoxControl>
  41. </StackPanel>
  42. </Grid>
  43. </Border>
  44. <Grid Grid.Row="1" Background="White" Margin="20,0,0,0" Panel.ZIndex="1" Height="20" HorizontalAlignment="Left" VerticalAlignment="Top">
  45. <TextBlock Foreground="#001A4E" Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Title_OwnerPassword}" FontWeight="Bold" FontSize="16"></TextBlock>
  46. </Grid>
  47. <Border Grid.Row="1" Margin="0,10,7,5" BorderBrush="#33000000" BorderThickness="1">
  48. <Grid Margin="8,10,20,8">
  49. <Grid.RowDefinitions>
  50. <RowDefinition Height="*"></RowDefinition>
  51. <RowDefinition Height="*"></RowDefinition>
  52. <RowDefinition Height="*"></RowDefinition>
  53. <RowDefinition Height="*"></RowDefinition>
  54. </Grid.RowDefinitions>
  55. <StackPanel Orientation="Horizontal">
  56. <CheckBox IsChecked="{Binding IsOwnerPasswordEnabled,Mode=OneWayToSource}" x:Name="ChbOwnerPassword" Width="20" Height="20" Margin="0,5,0,0"></CheckBox>
  57. <TextBlock Height="20" FontFamily="Microsoft YaHei" FontSize="14" Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Chk_OwnerPassword}"></TextBlock>
  58. </StackPanel>
  59. <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="20,0,0,0">
  60. <TextBlock Height="25" FontFamily="Microsoft YaHei" FontSize="14" Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Text_Password}"/>
  61. <common:PasswordBoxControl Password="{Binding OwnerPassword, Mode=OneWayToSource}" IsEnabled="{Binding IsOwnerPasswordEnabled}" Margin="10,0,0,0" Watermark="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Holder_EnterPassword}" Height="41" Width="210"></common:PasswordBoxControl>
  62. </StackPanel>
  63. <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="20,0,0,0">
  64. <CheckBox Width="20" Height="20" Margin="0,5,0,0"
  65. IsChecked="{Binding IsAllowPrint,Converter={StaticResource ReverseBoolConverter} ,Mode=OneWayToSource}"
  66. IsEnabled="{Binding IsOwnerPasswordEnabled}">
  67. </CheckBox>
  68. <TextBlock Height="20" FontFamily="Microsoft YaHei" FontSize="14" Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Chk_NoPrint}"></TextBlock>
  69. </StackPanel>
  70. <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="20,0,0,0">
  71. <CheckBox Width="20" Height="20" Margin="0,5,0,0"
  72. IsChecked="{Binding IsAllowCopy,Converter={StaticResource ReverseBoolConverter} ,Mode=OneWayToSource}"
  73. IsEnabled="{Binding IsOwnerPasswordEnabled}">
  74. </CheckBox>
  75. <TextBlock Height="20" FontFamily="Microsoft YaHei" FontSize="14" Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Chk_NoCopy}"></TextBlock>
  76. </StackPanel>
  77. </Grid>
  78. </Border>
  79. <DockPanel Grid.Row="2" Margin="10,0,10,10">
  80. <TextBlock HorizontalAlignment="Left" Text="{Binding Converter={StaticResource SecurityResourceConverter}, ConverterParameter=Text_EncryptionLevel}" FontFamily="Microsoft YaHei" FontSize="14" Margin="21,0,10,0" VerticalAlignment="Center"></TextBlock>
  81. <ComboBox HorizontalAlignment="Right" SelectedIndex="{Binding CryptographicLevel,Mode=OneWayToSource}" Style="{StaticResource ComboBoxStyle1}" FontFamily="Microsoft YaHei" FontSize="14" VerticalContentAlignment="Center" Width="150" Height="30" VerticalAlignment="Center">
  82. <ComboBoxItem IsSelected="True">128 - bit RC4</ComboBoxItem>
  83. <ComboBoxItem>128 - bit AES</ComboBoxItem>
  84. <ComboBoxItem>256 - bit AES</ComboBoxItem>
  85. </ComboBox>
  86. </DockPanel>
  87. </Grid>
  88. </UserControl>