HomePageSetPasswordDialog.xaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. <UserControl x:Class="PDF_Office.Views.Dialog.HomePageToolsDialogs.HomePageBatchProcessing.HomePageSetPasswordDialog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:prism="http://prismlibrary.com/"
  7. prism:ViewModelLocator.AutoWireViewModel="True"
  8. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  9. d:DesignHeight="600"
  10. d:DesignWidth="818"
  11. mc:Ignorable="d">
  12. <UserControl.Resources>
  13. <ResourceDictionary>
  14. <convert:UnVisivleConvert x:Key="unVisibleConvert"/>
  15. </ResourceDictionary>
  16. </UserControl.Resources>
  17. <Grid IsEnabled="{Binding SafetyGridIsEnabled}">
  18. <Grid.ColumnDefinitions>
  19. <ColumnDefinition Width="558*"/>
  20. <ColumnDefinition Width="260*"/>
  21. </Grid.ColumnDefinitions>
  22. <Grid Grid.Column="0">
  23. <Grid.RowDefinitions>
  24. <RowDefinition Height="556*"/>
  25. <RowDefinition Height="64*"/>
  26. </Grid.RowDefinitions>
  27. <Grid Grid.Row="0" AllowDrop="True"
  28. Drop="Grid_Drop"
  29. DragEnter="MainPage_DragEnter"
  30. DragOver="MainPage_DragOver"
  31. DragLeave="MainPage_DragLeave"
  32. >
  33. <Label Name="DropGrid" Background="#18A0FB" Opacity="0.5" Panel.ZIndex="1" Visibility="Collapsed"/>
  34. <Button Name="BtnBlank" Background="Green" Height="300" Width="300" Visibility="{Binding AddFileVisibility}" Command="{Binding ADDPDFCommand}" >
  35. </Button>
  36. <ListView x:Name="listView" DataContext="{Binding PDFDataTable,Mode=TwoWay}" Background="White" ItemsSource="{Binding}" SelectionChanged="listView_SelectionChanged" Visibility="{Binding ElementName=BtnBlank, Path=Visibility, Converter={StaticResource unVisibleConvert}}">
  37. <ListView.ContextMenu>
  38. <ContextMenu StaysOpen="True" >
  39. <MenuItem Header="打开文件" Name="OpenFileMenuItem" Click="OpenFileMenuItem_Click"/>
  40. <MenuItem Header="移除" Name="RemoveFileMenuItem" Click="RemoveFileMenuItem_Click"/>
  41. </ContextMenu>
  42. </ListView.ContextMenu>
  43. <ListView.View>
  44. <GridView>
  45. <GridViewColumn Header="文档名" Width="400" DisplayMemberBinding="{Binding FileName}"/>
  46. <GridViewColumn Header="大小" Width="100" DisplayMemberBinding="{Binding FileSize}"/>
  47. <GridViewColumn Header="状态" Width="80" >
  48. <GridViewColumn.CellTemplate>
  49. <DataTemplate>
  50. <TextBlock Text="{Binding FileState}" TextDecorations="Underline" Foreground="Black"/>
  51. </DataTemplate>
  52. </GridViewColumn.CellTemplate>
  53. </GridViewColumn>
  54. <GridViewColumn Header="" Width="100">
  55. <GridViewColumn.CellTemplate>
  56. <DataTemplate >
  57. <Button Name="DeleteTemplateBtn" Width="14" Height="14" Content="X" Foreground="Red" FontSize="8" Click="DeleteTemplateBtn_Click">
  58. </Button>
  59. <DataTemplate.Triggers>
  60. <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="True">
  61. <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Visible"/>
  62. </DataTrigger>
  63. <DataTrigger Binding="{Binding Path=IsMouseOver, RelativeSource={RelativeSource FindAncestor, AncestorType=ListViewItem}}" Value="False">
  64. <Setter TargetName="DeleteTemplateBtn" Property="Visibility" Value="Hidden"/>
  65. </DataTrigger>
  66. </DataTemplate.Triggers>
  67. </DataTemplate>
  68. </GridViewColumn.CellTemplate>
  69. </GridViewColumn>
  70. </GridView>
  71. </ListView.View>
  72. <ListView.ItemContainerStyle>
  73. <Style TargetType="ListViewItem">
  74. <Setter Property="Height" Value="42"/>
  75. <Style.Triggers>
  76. <Trigger Property="ListView.AlternationIndex" Value="1">
  77. <Setter Property="Background" Value="LightGray"/>
  78. </Trigger>
  79. </Style.Triggers>
  80. </Style>
  81. </ListView.ItemContainerStyle>
  82. </ListView>
  83. </Grid>
  84. <Grid Grid.Row="1">
  85. <Button x:Name="MenuBtn" Width="113"
  86. Height="40"
  87. Margin="25,0,0,0"
  88. HorizontalAlignment="Left" Click="Menu_Click">
  89. <StackPanel Orientation="Horizontal" >
  90. <Border HorizontalAlignment="Right">
  91. <TextBlock Text="添加文件" FontSize="18" Foreground="Black"></TextBlock>
  92. </Border>
  93. <Border Margin="12,0,0,0">
  94. <Path VerticalAlignment="Center" HorizontalAlignment="Right" Stroke="Black" Data="M0 0L8 4 L16 0" Height="10" Stretch="Fill" />
  95. </Border>
  96. </StackPanel>
  97. </Button>
  98. <Popup x:Name="menuPop1" StaysOpen="False" AllowsTransparency="True" PlacementTarget="{Binding ElementName=MenuBtn}">
  99. <Grid Height="auto" Width="auto" HorizontalAlignment="Left">
  100. <Border BorderThickness="0" CornerRadius="3" Background="White" Margin="3">
  101. <Border.Effect>
  102. <DropShadowEffect ShadowDepth="0" Color="#FFB6B6B6"/>
  103. </Border.Effect>
  104. <StackPanel Margin="0">
  105. <MenuItem x:Name="添加文件" Header="添加文件" Command="{Binding ADDPDFCommand}"></MenuItem>
  106. <MenuItem x:Name="添加文件夹" Header="添加文件夹" Command="{Binding ADDPDFFilesCommand}"></MenuItem>
  107. </StackPanel>
  108. </Border>
  109. </Grid>
  110. </Popup>
  111. <Button
  112. Width="40"
  113. Height="40"
  114. Margin="0,0,90,0"
  115. HorizontalAlignment="Right">
  116. </Button>
  117. <Button
  118. Width="40"
  119. Height="40"
  120. Margin="25,0"
  121. HorizontalAlignment="Right"
  122. IsEnabled="{Binding RemoveIsEnable}"
  123. Command="{Binding RemovePDFFileCommand}">
  124. </Button>
  125. </Grid>
  126. </Grid>
  127. <Grid Grid.Column="1" Background="WhiteSmoke" IsEnabled="{Binding SetSafetyGridIsEnabled}">
  128. <Grid.RowDefinitions>
  129. <RowDefinition Height="*"/>
  130. <RowDefinition Height="*"/>
  131. <RowDefinition Height="72"/>
  132. </Grid.RowDefinitions>
  133. <Grid Grid.Row="0">
  134. <StackPanel Margin="15,23,0,0">
  135. <TextBlock Text="设置密码" Width="48" Height="20" HorizontalAlignment="Left"/>
  136. <StackPanel Margin="0,11,0,0">
  137. <CheckBox x:Name="CanOpenCheckBox" IsChecked="{Binding CanOpen}" Margin="0,0,0,10" Command="{Binding DelegateSetOpenCommand}">
  138. <TextBlock Text="开启文档口令"></TextBlock>
  139. </CheckBox>
  140. <Grid HorizontalAlignment="Left" Width="228">
  141. <PasswordBox x:Name="CanOpenPasswordBox" Width="228" Height="24" Visibility="Visible" VerticalAlignment="Center"
  142. GotFocus="PasswordBox_GotFocus" PasswordChanged="PasswordBox_PasswordChanged" IsEnabled="{Binding ElementName=CanOpenCheckBox, Path=IsChecked}">
  143. </PasswordBox>
  144. <TextBox x:Name="CanOpenTextBox" Width="228" Height="24" Visibility="Hidden" VerticalAlignment="Center"
  145. GotFocus="TextBox_GotFocus" TextChanged="TextBox_TextChanged" >
  146. </TextBox>
  147. <Label x:Name="ShowOpenPasswordBoxEyeLabel" HorizontalAlignment="Right" Margin="0,3,0,3"
  148. MouseLeftButtonUp="ShowPasswordBoxEyeLabel_MouseLeftButtonUp">
  149. <Border Height="23" Width="27" Background="MediumVioletRed" ></Border>
  150. </Label>
  151. <Label x:Name="ShowOpenTextBoxEyeLabel" HorizontalAlignment="Right" Visibility="Hidden" Margin="0,3,0,3"
  152. MouseLeftButtonUp="ShowTextBoxEyeLabel_MouseLeftButtonUp">
  153. <Border Height="23" Width="27" Background="LightSeaGreen" ></Border>
  154. </Label>
  155. </Grid>
  156. </StackPanel>
  157. <StackPanel Margin="0,17,0,0">
  158. <CheckBox IsChecked="{Binding CanEdit}" Name="CanEditCheckBox" Margin="0,0,0,10" Command="{Binding DelegateSetEditCommand}">
  159. <TextBlock Text="许可口令"></TextBlock>
  160. </CheckBox>
  161. <Grid HorizontalAlignment="Left" Width="228">
  162. <PasswordBox x:Name="CanEditPasswordBox" Width="228" Height="24" Visibility="Visible" VerticalAlignment="Center"
  163. GotFocus="PasswordBox_GotFocus" PasswordChanged="PasswordBox_PasswordChanged" IsEnabled="{Binding ElementName=CanEditCheckBox, Path=IsChecked}">
  164. </PasswordBox>
  165. <TextBox x:Name="CanEditTextBox" Width="228" Height="24" Visibility="Hidden" VerticalAlignment="Center"
  166. GotFocus="TextBox_GotFocus" TextChanged="TextBox_TextChanged">
  167. </TextBox>
  168. <Label x:Name="ShowEditPasswordBoxEyeLabel" HorizontalAlignment="Right" Margin="0,3,0,3"
  169. MouseLeftButtonUp="ShowPasswordBoxEyeLabel_MouseLeftButtonUp">
  170. <Border Height="23" Width="27" Background="MediumVioletRed"
  171. ></Border>
  172. </Label>
  173. <Label x:Name="ShowEditTextBoxEyeLabel" HorizontalAlignment="Right" Visibility="Hidden" Margin="0,3,0,3"
  174. MouseLeftButtonUp="ShowTextBoxEyeLabel_MouseLeftButtonUp">
  175. <Border Height="23" Width="27" Background="LightSeaGreen" ></Border>
  176. </Label>
  177. </Grid>
  178. </StackPanel>
  179. </StackPanel>
  180. </Grid>
  181. <Grid Grid.Row="1">
  182. <StackPanel Margin="15,0,0,0">
  183. <TextBlock Text="允许打印" Width="48" Height="20" HorizontalAlignment="Left"/>
  184. <ComboBox Height="24" Width="228" HorizontalAlignment="Left" Margin="0,8.5,0,0" SelectedIndex="{Binding PrintMod,Mode=TwoWay}" IsEnabled="{Binding ElementName=CanEditCheckBox, Path=IsChecked}"></ComboBox>
  185. <TextBlock Text="允许更改" Margin="0,20.5,0,0" Width="48" Height="20" HorizontalAlignment="Left"/>
  186. <ComboBox Height="24" Width="228" HorizontalAlignment="Left" Margin="0,8.5,0,0" SelectedIndex="{Binding ChangeMod,Mode=TwoWay}" IsEnabled="{Binding ElementName=CanEditCheckBox, Path=IsChecked}"></ComboBox>
  187. <TextBlock Text="加密级别" Width="48" Height="20" HorizontalAlignment="Left" Margin="0,20.5,0,0"/>
  188. <ComboBox Height="24" Width="228" HorizontalAlignment="Left" Margin="0,8.5,0,0" >
  189. <ComboBoxItem Tag="0">128-bit-RC4</ComboBoxItem>
  190. <ComboBoxItem Tag="1">128-bit-AES</ComboBoxItem>
  191. <ComboBoxItem Tag="2">256 -bit-AES</ComboBoxItem>
  192. </ComboBox>
  193. </StackPanel>
  194. </Grid>
  195. <Grid Grid.Row="2">
  196. <Button Height="40" Width="228" Background="Black" Command="{Binding DelegateConfirmEncryptCommand}" IsEnabled="{Binding IsEnabledConfirm, Mode=TwoWay}">
  197. <TextBlock Text="设置安全密码" FontSize="18" Foreground="White"/>
  198. </Button>
  199. </Grid>
  200. </Grid>
  201. </Grid>
  202. </UserControl>