SetEncryptionControl.xaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <UserControl x:Class="Compdfkit_Tools.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:local="clr-namespace:Compdfkit_Tools"
  7. xmlns:common="clr-namespace:Compdfkit_Tools.Common"
  8. xmlns:pdfControl="clr-namespace:Compdfkit_Tools.PDFControl"
  9. mc:Ignorable="d"
  10. Height="362" Width="368">
  11. <UserControl.Resources>
  12. <ResourceDictionary>
  13. <ResourceDictionary.MergedDictionaries>
  14. <ResourceDictionary Source="pack://application:,,,/Compdfkit_Tools;component/Asset/Styles/ComboBoxStyle.xaml"/>
  15. </ResourceDictionary.MergedDictionaries>
  16. <common:AndMultiBoolValueConverter x:Key="AndMultiValueConverter"></common:AndMultiBoolValueConverter>
  17. <common:ReverseBoolConverter x:Key="ReverseBoolConverter" />
  18. </ResourceDictionary>
  19. </UserControl.Resources>
  20. <Grid>
  21. <Grid.RowDefinitions>
  22. <RowDefinition Height="12*"></RowDefinition>
  23. <RowDefinition Height="20*"></RowDefinition>
  24. <RowDefinition Height="Auto"></RowDefinition>
  25. </Grid.RowDefinitions>
  26. <Grid Background="White" Margin="20,0,0,0" Panel.ZIndex="1" Height="20" HorizontalAlignment="Left" VerticalAlignment="Top">
  27. <TextBlock Foreground="#001A4E" Text="Open the Document" FontWeight="Bold" FontSize="16"></TextBlock>
  28. </Grid>
  29. <Border Margin="0,10,7,12" BorderBrush="#33000000" BorderThickness="1">
  30. <Grid Margin="8,0,20,15">
  31. <Grid.RowDefinitions>
  32. <RowDefinition Height="*"></RowDefinition>
  33. <RowDefinition Height="Auto"></RowDefinition>
  34. </Grid.RowDefinitions>
  35. <StackPanel Orientation="Horizontal">
  36. <CheckBox IsChecked="{Binding IsUserPasswordEnabled, Mode=OneWayToSource}" x:Name="ChbUserPassword" Width="20" Height="20" Margin="0,0,0,0"></CheckBox>
  37. <TextBlock Height="20" FontFamily="Segoe UI" FontSize="14" Text="Require a password to open the document"></TextBlock>
  38. </StackPanel>
  39. <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="20,0,0,-5">
  40. <TextBlock Height="25" FontFamily="Segoe UI" FontSize="14" Text="Open Password"/>
  41. <common:PasswordBoxControl Password="{Binding UserPassword, Mode=OneWayToSource}" IsEnabled="{Binding IsUserPasswordEnabled,Mode=OneWay}" Margin="10,0,0,0" Watermark="Enter the password" Height="41" Width="175"></common:PasswordBoxControl>
  42. </StackPanel>
  43. </Grid>
  44. </Border>
  45. <Grid Grid.Row="1" Background="White" Margin="20,0,0,0" Panel.ZIndex="1" Height="20" HorizontalAlignment="Left" VerticalAlignment="Top">
  46. <TextBlock Foreground="#001A4E" Text="Password and Permissions" FontWeight="Bold" FontSize="16"></TextBlock>
  47. </Grid>
  48. <Border Grid.Row="1" Margin="0,10,7,5" BorderBrush="#33000000" BorderThickness="1">
  49. <Grid Margin="8,10,20,8">
  50. <Grid.RowDefinitions>
  51. <RowDefinition Height="*"></RowDefinition>
  52. <RowDefinition Height="*"></RowDefinition>
  53. <RowDefinition Height="*"></RowDefinition>
  54. <RowDefinition Height="*"></RowDefinition>
  55. </Grid.RowDefinitions>
  56. <StackPanel Orientation="Horizontal">
  57. <CheckBox IsChecked="{Binding IsOwnerPasswordEnabled,Mode=OneWayToSource}" x:Name="ChbOwnerPassword" Width="20" Height="20" Margin="0,5,0,0"></CheckBox>
  58. <TextBlock Height="20" FontFamily="Segoe UI" FontSize="14" Text="Restrict printing or copying"></TextBlock>
  59. </StackPanel>
  60. <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="20,0,0,0">
  61. <TextBlock Height="25" FontFamily="Segoe UI" FontSize="14" Text="Open Password"/>
  62. <common:PasswordBoxControl Password="{Binding OwnerPassword, Mode=OneWayToSource}" IsEnabled="{Binding IsOwnerPasswordEnabled}" Margin="10,0,0,0" Watermark="Enter Password" Height="41" Width="175"></common:PasswordBoxControl>
  63. </StackPanel>
  64. <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="20,0,0,0">
  65. <CheckBox Width="20" Height="20" Margin="0,5,0,0"
  66. IsChecked="{Binding IsAllowPrint,Converter={StaticResource ReverseBoolConverter} ,Mode=OneWayToSource}"
  67. IsEnabled="{Binding IsOwnerPasswordEnabled}">
  68. </CheckBox>
  69. <TextBlock Height="20" FontFamily="Segoe UI" FontSize="14" Text="Restrict document printing"></TextBlock>
  70. </StackPanel>
  71. <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="20,0,0,0">
  72. <CheckBox Width="20" Height="20" Margin="0,5,0,0"
  73. IsChecked="{Binding IsAllowCopy,Converter={StaticResource ReverseBoolConverter} ,Mode=OneWayToSource}"
  74. IsEnabled="{Binding IsOwnerPasswordEnabled}">
  75. </CheckBox>
  76. <TextBlock Height="20" FontFamily="Segoe UI" FontSize="14" Text="Restrict content copying"></TextBlock>
  77. </StackPanel>
  78. </Grid>
  79. </Border>
  80. <DockPanel Grid.Row="2" Margin="10,0,10,10">
  81. <TextBlock HorizontalAlignment="Left" Text="Encryption Level" FontFamily="Segoe UI" FontSize="14" Margin="21,0,10,0" VerticalAlignment="Center"></TextBlock>
  82. <ComboBox HorizontalAlignment="Right" SelectedIndex="{Binding CryptographicLevel,Mode=OneWayToSource}" Style="{StaticResource ComboBoxStyle1}" FontFamily="Segoe UI" FontSize="14" VerticalContentAlignment="Center" Width="150" Height="30" VerticalAlignment="Center">
  83. <ComboBoxItem IsSelected="True">128 - bit RC4</ComboBoxItem>
  84. <ComboBoxItem>128 - bit AES</ComboBoxItem>
  85. <ComboBoxItem>256 - bit AES</ComboBoxItem>
  86. </ComboBox>
  87. </DockPanel>
  88. </Grid>
  89. </UserControl>