SetEncryptionControl.xaml 5.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. <common:AndMultiBoolValueConverter x:Key="AndMultiValueConverter"></common:AndMultiBoolValueConverter>
  14. <common:ReverseBoolConverter x:Key="ReverseBoolConverter" />
  15. </ResourceDictionary>
  16. </UserControl.Resources>
  17. <Grid>
  18. <Grid.RowDefinitions>
  19. <RowDefinition Height="*"></RowDefinition>
  20. <RowDefinition Height="2*"></RowDefinition>
  21. </Grid.RowDefinitions>
  22. <Grid Background="White" Margin="20,0,0,0" Panel.ZIndex="1" Height="20" HorizontalAlignment="Left" VerticalAlignment="Top">
  23. <TextBlock Foreground="#001A4E" Text="Open the Document" FontWeight="Bold" FontSize="16"></TextBlock>
  24. </Grid>
  25. <Border Margin="0,10,7,12" BorderBrush="#33000000" BorderThickness="1">
  26. <Grid Margin="8,0,20,15">
  27. <Grid.RowDefinitions>
  28. <RowDefinition Height="*"></RowDefinition>
  29. <RowDefinition Height="Auto"></RowDefinition>
  30. </Grid.RowDefinitions>
  31. <StackPanel Orientation="Horizontal">
  32. <CheckBox IsChecked="{Binding IsUserPasswordEnabled, Mode=OneWayToSource}" x:Name="ChbUserPassword" Width="20" Height="20" Margin="0,0,0,0"></CheckBox>
  33. <TextBlock Height="20" FontFamily="Segoe UI" FontSize="14" Text="Require a password to open the document"></TextBlock>
  34. </StackPanel>
  35. <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="20,0,0,-5">
  36. <TextBlock Height="25" FontFamily="Segoe UI" FontSize="14" Text="Open Password"/>
  37. <common:PasswordBoxControl Password="{Binding UserPassword, Mode=OneWayToSource}" IsEnabled="{Binding IsUserPasswordEnabled,Mode=OneWay}" Margin="10,0,0,0" Watermark="Enter Password" Height="41" Width="170"></common:PasswordBoxControl>
  38. </StackPanel>
  39. </Grid>
  40. </Border>
  41. <Grid Grid.Row="1" Background="White" Margin="20,0,0,0" Panel.ZIndex="1" Height="20" HorizontalAlignment="Left" VerticalAlignment="Top">
  42. <TextBlock Foreground="#001A4E" Text="Password and Permissions" FontWeight="Bold" FontSize="16"></TextBlock>
  43. </Grid>
  44. <Border Grid.Row="1" Margin="0,10,7,12" BorderBrush="#33000000" BorderThickness="1">
  45. <Grid Margin="8,10,20,15">
  46. <Grid.RowDefinitions>
  47. <RowDefinition Height="*"></RowDefinition>
  48. <RowDefinition Height="*"></RowDefinition>
  49. <RowDefinition Height="*"></RowDefinition>
  50. <RowDefinition Height="*"></RowDefinition>
  51. </Grid.RowDefinitions>
  52. <StackPanel Orientation="Horizontal">
  53. <CheckBox IsChecked="{Binding IsOwnerPasswordEnabled,Mode=OneWayToSource}" x:Name="ChbOwnerPassword" Width="20" Height="20" Margin="0,5,0,0"></CheckBox>
  54. <TextBlock Height="20" FontFamily="Segoe UI" FontSize="14" Text="Restrict printing or copying"></TextBlock>
  55. </StackPanel>
  56. <StackPanel Orientation="Horizontal" Grid.Row="1" Margin="20,0,0,0">
  57. <TextBlock Height="25" FontFamily="Segoe UI" FontSize="14" Text="Open Password"/>
  58. <common:PasswordBoxControl Password="{Binding OwnerPassword, Mode=OneWayToSource}" IsEnabled="{Binding IsOwnerPasswordEnabled}" Margin="10,0,0,0" Watermark="Enter Password" Height="41" Width="170"></common:PasswordBoxControl>
  59. </StackPanel>
  60. <StackPanel Grid.Row="2" Orientation="Horizontal" Margin="20,0,0,0">
  61. <CheckBox Width="20" Height="20" Margin="0,5,0,0"
  62. IsChecked="{Binding IsAllowPrint,Converter={StaticResource ReverseBoolConverter} ,Mode=OneWayToSource}"
  63. IsEnabled="{Binding IsOwnerPasswordEnabled}">
  64. </CheckBox>
  65. <TextBlock Height="20" FontFamily="Segoe UI" FontSize="14" Text="Restrict document printing"></TextBlock>
  66. </StackPanel>
  67. <StackPanel Grid.Row="3" Orientation="Horizontal" Margin="20,0,0,0">
  68. <CheckBox Width="20" Height="20" Margin="0,5,0,0"
  69. IsChecked="{Binding IsAllowCopy,Converter={StaticResource ReverseBoolConverter} ,Mode=OneWayToSource}"
  70. IsEnabled="{Binding IsOwnerPasswordEnabled}">
  71. </CheckBox>
  72. <TextBlock Height="20" FontFamily="Segoe UI" FontSize="14" Text="Restrict content copying"></TextBlock>
  73. </StackPanel>
  74. </Grid>
  75. </Border>
  76. </Grid>
  77. </UserControl>