FillDigitalSignatureControl.xaml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <UserControl x:Class="Compdfkit_Tools.PDFControl.FillDigitalSignatureControl"
  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.PDFControl"
  7. xmlns:common="clr-namespace:Compdfkit_Tools.Common"
  8. mc:Ignorable="d"
  9. d:DesignHeight="530" d:DesignWidth="630"
  10. >
  11. <UserControl.Resources>
  12. <ResourceDictionary>
  13. <ResourceDictionary.MergedDictionaries>
  14. <ResourceDictionary Source="../../Asset/Styles/ToggleButtonStyle.xaml"></ResourceDictionary>
  15. <ResourceDictionary Source="../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
  16. <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
  17. </ResourceDictionary.MergedDictionaries>
  18. </ResourceDictionary>
  19. </UserControl.Resources>
  20. <Grid>
  21. <Grid Name="MainGrid" Background="White">
  22. <Grid.RowDefinitions>
  23. <RowDefinition Height="auto"></RowDefinition>
  24. <RowDefinition Height="auto"></RowDefinition>
  25. <RowDefinition Height="30"></RowDefinition>
  26. <RowDefinition Height="auto"></RowDefinition>
  27. <RowDefinition Height="auto"></RowDefinition>
  28. <RowDefinition Height="auto"></RowDefinition>
  29. </Grid.RowDefinitions>
  30. <Grid Grid.Row="0" Width="314" HorizontalAlignment="Center" Margin="0,20,0,1">
  31. <Grid.ColumnDefinitions>
  32. <ColumnDefinition Width="91"></ColumnDefinition>
  33. <ColumnDefinition Width="87"></ColumnDefinition>
  34. <ColumnDefinition Width="68"></ColumnDefinition>
  35. <ColumnDefinition Width="68"></ColumnDefinition>
  36. </Grid.ColumnDefinitions>
  37. <Grid>
  38. <Border Name="KeyboardBorder" Background="White" Padding="0,0,0,5" BorderBrush="#4982E6" Width="75"
  39. MouseDown="Border_MouseDown" Tag="Keyboard">
  40. <TextBlock FontSize="16">Keyboard</TextBlock>
  41. </Border>
  42. </Grid>
  43. <Grid Grid.Column="1">
  44. <Border Name="TrackpadBorder" Background="White" Padding="0,0,0,5" BorderBrush="#4982E6" Width="72"
  45. MouseDown="Border_MouseDown" Tag="Trackpad">
  46. <TextBlock FontSize="16">Trackpad</TextBlock>
  47. </Border>
  48. </Grid>
  49. <Grid Grid.Column="2">
  50. <Border Name="ImageBorder" Background="White" Padding="0,0,0,5" BorderBrush="#4982E6" Width="52"
  51. MouseDown="Border_MouseDown" Tag="Image">
  52. <TextBlock FontSize="16">Image</TextBlock>
  53. </Border>
  54. </Grid>
  55. <Grid Grid.Column="3">
  56. <Border Name="NoneBorder" Background="White" Padding="0,0,0,5" BorderBrush="#4982E6" Width="43"
  57. MouseDown="Border_MouseDown" Tag="None">
  58. <TextBlock FontSize="16">None</TextBlock>
  59. </Border>
  60. </Grid>
  61. </Grid>
  62. <Canvas Grid.Row="1" Width="580" Height="187" Background="#F4F7FF">
  63. <Image Width="580" Height="187" x:Name="imageControl" />
  64. </Canvas>
  65. <StackPanel Grid.Row="2" Name="ImagePickPanel" HorizontalAlignment="Right" Orientation="Horizontal" Margin="0,6,30,0"
  66. Visibility="Hidden">
  67. <TextBlock x:Name="BrowseTxt" Foreground="Blue" MouseLeftButtonDown="BrowseTxt_MouseLeftButtonDown">Browse</TextBlock>
  68. <TextBlock x:Name="ClearTxt" Margin="10,0,0,0" Foreground="Blue" MouseLeftButtonDown="ClearTxt_MouseLeftButtonDown">Clear</TextBlock>
  69. </StackPanel>
  70. <Grid Grid.Row="3" Margin="25,0,25,0">
  71. <Grid.ColumnDefinitions>
  72. <ColumnDefinition Width="*"></ColumnDefinition>
  73. <ColumnDefinition Width="auto"></ColumnDefinition>
  74. </Grid.ColumnDefinitions>
  75. <TextBlock FontSize="14" Margin="0,3,0,0">Include Text</TextBlock>
  76. <StackPanel Margin="00,0,20,0" Grid.Column="1" Orientation="Horizontal">
  77. <TextBlock FontSize="14" VerticalAlignment="Center" Margin="0,0,8,0">Alignment</TextBlock>
  78. <ToggleButton Name="TextAlignLeftBtn" Style="{StaticResource ToggleButtonStyle}" BorderThickness="0" Width="73" Height="30"
  79. IsChecked="True" Click="TextAlignBtn_Click">
  80. <Path Fill="Black">
  81. <Path.Data>
  82. M13 4V3H0V4H13ZM16 8V7H0V8H16ZM10 11V12H0V11H10Z
  83. </Path.Data>
  84. </Path>
  85. </ToggleButton>
  86. <ToggleButton Name="TextAlignRightBtn" Style="{StaticResource ToggleButtonStyle}" BorderThickness="0" Width="73" Height="30"
  87. Click="TextAlignBtn_Click">
  88. <Path Fill="Black">
  89. <Path.Data>
  90. M16 4V3H3.00079V4H16ZM16 8V7H0.000976562V8H16ZM16 11V12H6.00061V11H16Z
  91. </Path.Data>
  92. </Path>
  93. </ToggleButton>
  94. </StackPanel>
  95. </Grid>
  96. <Grid Grid.Row="4" Margin="25,10,0,0">
  97. <Grid.ColumnDefinitions>
  98. <ColumnDefinition Width="auto"></ColumnDefinition>
  99. <ColumnDefinition Width="auto"></ColumnDefinition>
  100. </Grid.ColumnDefinitions>
  101. <Grid HorizontalAlignment="Left">
  102. <Grid.RowDefinitions>
  103. <RowDefinition Height="32"></RowDefinition>
  104. <RowDefinition Height="32"></RowDefinition>
  105. <RowDefinition Height="32"></RowDefinition>
  106. <RowDefinition Height="32"></RowDefinition>
  107. </Grid.RowDefinitions>
  108. <Grid.ColumnDefinitions>
  109. <ColumnDefinition Width="auto"></ColumnDefinition>
  110. <ColumnDefinition Width="50"></ColumnDefinition>
  111. <ColumnDefinition Width="auto"></ColumnDefinition>
  112. <ColumnDefinition Width="auto"></ColumnDefinition>
  113. </Grid.ColumnDefinitions>
  114. <CheckBox x:Name="NameChk" FontSize="14" Click="NameChk_Click">Name</CheckBox>
  115. <CheckBox x:Name="DateChk" FontSize="14" Grid.Row="1" Click="DateChk_Click">Date</CheckBox>
  116. <CheckBox x:Name="LogoChk" FontSize="14" Grid.Row="2" Click="LogoChk_Click">Logo</CheckBox>
  117. <CheckBox x:Name="ReasonChk" FontSize="14" Grid.Row="3" Click="ReasonChk_Click">Reason</CheckBox>
  118. <CheckBox x:Name="DistinguishableNameChk" FontSize="14" Grid.Column="2" Click="DistinguishableNameChk_Click">Distinguishable Name</CheckBox>
  119. <CheckBox x:Name="ComPDFKitVersionChk" FontSize="14" Grid.Column="2" Grid.Row="1" Click="ComPDFKitVersionChk_Click">ComPDFKit Versions</CheckBox>
  120. <CheckBox x:Name="PositionChk" FontSize="14" Grid.Column="2" Grid.Row="2" Click="PositionChk_Click">Position</CheckBox>
  121. <CheckBox x:Name="TabChk" FontSize="14" Grid.Column="2" Grid.Row="3" Click="TabChk_Click">Tab</CheckBox>
  122. <StackPanel x:Name="Reasonstp" Visibility="Collapsed" Orientation="Horizontal" Grid.Column="4" Margin="30,0,0,0" Grid.RowSpan="2" Height="30" Width="280">
  123. <TextBlock Text="Reason: " VerticalAlignment="Center" Width="50"></TextBlock>
  124. <ComboBox x:Name="ReasonCmb" SelectionChanged="ReasonCmb_SelectionChanged" Width="220" VerticalContentAlignment="Center">
  125. <ComboBoxItem Content="&lt; None &gt;"></ComboBoxItem>
  126. <ComboBoxItem Content="I am the owner of the document." IsSelected="True"></ComboBoxItem>
  127. <ComboBoxItem Content="I am approving the document."></ComboBoxItem>
  128. <ComboBoxItem Content="I have reviewed this document"></ComboBoxItem>
  129. </ComboBox>
  130. </StackPanel>
  131. <StackPanel x:Name="PositionStp" Visibility="Collapsed" Orientation="Horizontal" Grid.Column="4" Grid.Row="1" Margin="30,10,0,0" Grid.RowSpan="2" Height="30" Width="280">
  132. <TextBlock Text="Position: " VerticalAlignment="Center" Width="50"></TextBlock>
  133. <TextBox Width="220" x:Name="PositionTbx" TextChanged="PositionTbx_TextChanged"></TextBox>
  134. </StackPanel>
  135. </Grid>
  136. <StackPanel Name="ReasonPanel" Grid.Column="1" Orientation="Horizontal" Margin="15,10,0,0" VerticalAlignment="Top"
  137. Visibility="Collapsed">
  138. <TextBlock VerticalAlignment="Center" Margin="0,0,5,0">Reason</TextBlock>
  139. </StackPanel>
  140. </Grid>
  141. <Grid Grid.Row="5" Margin="25,10,0,0">
  142. <Grid.ColumnDefinitions>
  143. <ColumnDefinition Width="auto"></ColumnDefinition>
  144. <ColumnDefinition Width="auto"></ColumnDefinition>
  145. <ColumnDefinition Width="*"></ColumnDefinition>
  146. <ColumnDefinition Width="auto"></ColumnDefinition>
  147. <ColumnDefinition Width="auto"></ColumnDefinition>
  148. </Grid.ColumnDefinitions>
  149. <Button x:Name="CancelBtn" Grid.Column="3" Height="32" Width="82" Style="{StaticResource LightButtonStyle}"
  150. Background="#DFE9FF" BorderThickness="0" Click="CancelBtn_Click">Cancel</Button>
  151. <Button x:Name="ContinueBtn" Grid.Column="4" Margin="10,0,25,0" Height="32" Width="97" Style="{StaticResource ButtonStyle}" Click="ContinueBtn_Click">Next</Button>
  152. </Grid>
  153. </Grid>
  154. <Border Name="KeyboardPopup" Background="#A0000000" Visibility="Collapsed">
  155. <Grid Background="White" Width="528" Height="412">
  156. <Grid.RowDefinitions>
  157. <RowDefinition Height="auto" />
  158. <RowDefinition Height="*" />
  159. <RowDefinition Height="auto" />
  160. <RowDefinition Height="auto" />
  161. </Grid.RowDefinitions>
  162. <Button HorizontalAlignment="Right" Margin="0,8,10,0" Style="{StaticResource LightButtonStyle}" BorderThickness="0"
  163. Background="White" Width="24" Height="24" Click="KeyboardPopupClose_Click">
  164. <Button.Content>
  165. <Path Fill="#43474D" Width="16" Height="16">
  166. <Path.Data>
  167. M12.6466 13.2531L13.0001 13.6066L13.7072 12.8995L13.3537 12.546L8.7072 7.8995L13.2532 3.35352L13.6067 2.99997L12.8996
  168. 2.29286L12.5461 2.64642L8.00009 7.19239L3.45418 2.64648L3.10063 2.29292L2.39352 3.00003L2.74708 3.35358L7.29299
  169. 7.8995L2.64657 12.5459L2.29302 12.8995L3.00013 13.6066L3.35368 13.253L8.0001 8.6066L12.6466 13.2531Z
  170. </Path.Data>
  171. </Path>
  172. </Button.Content>
  173. </Button>
  174. <TextBox
  175. x:Name="KeyboardInPutTextBox" Grid.Row="1" BorderThickness="0" Background="#F2F3F5" Margin="10,0,10,0" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="45"/>
  176. <StackPanel Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Center" Orientation="Horizontal" Margin="0,10,20,10">
  177. <common:ColorPickerControl x:Name="TextColorPickerControl" Loaded="TextColorPickerControl_Loaded" ColorChanged="TextColorPickerControl_ColorChanged" TransparentBtnProperty="Collapsed"></common:ColorPickerControl>
  178. </StackPanel>
  179. <Grid Grid.Row="3" Margin="25,0,0,20" VerticalAlignment="Top">
  180. <Button Height="32" Width="82" Style="{StaticResource LightButtonStyle}" Background="#DFE9FF"
  181. BorderThickness="0" HorizontalAlignment="Left" Content="Clear" Click="KeyboardClear_Click"/>
  182. <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
  183. <Button Height="32" Width="82" Style="{StaticResource LightButtonStyle}" Background="#DFE9FF"
  184. BorderThickness="0" Content="Cancel" Click="KeyboardCancel_Click"/>
  185. <Button x:Name="SaveBtn" Margin="10,0,25,0" Height="32" Width="97" Style="{StaticResource ButtonStyle}" Content="Save" Click="KeyboardSave_Click"/>
  186. </StackPanel>
  187. </Grid>
  188. </Grid>
  189. </Border>
  190. <Border Name="CanvaDrawPopup" Background="#A0000000" Visibility="Collapsed">
  191. <Grid Background="White" Width="528" Height="412">
  192. <Grid.RowDefinitions>
  193. <RowDefinition Height="auto"></RowDefinition>
  194. <RowDefinition Height="*"></RowDefinition>
  195. <RowDefinition Height="auto"></RowDefinition>
  196. </Grid.RowDefinitions>
  197. <Button HorizontalAlignment="Right" Margin="0,8,10,0" Style="{StaticResource LightButtonStyle}" BorderThickness="0"
  198. Background="White" Width="24" Height="24" Click="CanvasPopupClose_Click">
  199. <Button.Content>
  200. <Path Fill="#43474D" Width="16" Height="16">
  201. <Path.Data>
  202. M12.6466 13.2531L13.0001 13.6066L13.7072 12.8995L13.3537 12.546L8.7072 7.8995L13.2532 3.35352L13.6067 2.99997L12.8996
  203. 2.29286L12.5461 2.64642L8.00009 7.19239L3.45418 2.64648L3.10063 2.29292L2.39352 3.00003L2.74708 3.35358L7.29299
  204. 7.8995L2.64657 12.5459L2.29302 12.8995L3.00013 13.6066L3.35368 13.253L8.0001 8.6066L12.6466 13.2531Z
  205. </Path.Data>
  206. </Path>
  207. </Button.Content>
  208. </Button>
  209. <InkCanvas Name="DrawInkCanvas" Grid.Row="1" Width="580" Height="292" Background="#F2F3F5">
  210. </InkCanvas>
  211. <Grid Grid.Row="2" Margin="25,0,0,20">
  212. <Grid.ColumnDefinitions>
  213. <ColumnDefinition Width="auto"></ColumnDefinition>
  214. <ColumnDefinition Width="*"></ColumnDefinition>
  215. <ColumnDefinition Width="auto"></ColumnDefinition>
  216. <ColumnDefinition Width="auto"></ColumnDefinition>
  217. </Grid.ColumnDefinitions>
  218. <Button Height="32" Width="82" Style="{StaticResource LightButtonStyle}" Background="#DFE9FF"
  219. BorderThickness="0" Click="CanvasClearBtn_Click">Clear</Button>
  220. <Button Grid.Column="2" Height="32" Width="82" Style="{StaticResource LightButtonStyle}" Background="#DFE9FF"
  221. BorderThickness="0" Click="CanvasPopupClose_Click">Cancel</Button>
  222. <Button Grid.Column="3" Click="CanvasPopupConfirm_Click" Margin="10,0,25,0" Height="32" Width="97" Style="{StaticResource ButtonStyle}">OK</Button>
  223. </Grid>
  224. </Grid>
  225. </Border>
  226. </Grid>
  227. </UserControl>