DigitalSignatureControl.xaml 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <UserControl x:Class="Compdfkit_Tools.PDFControl.DigitalSignatureControl"
  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:cpdfcommon="clr-namespace:Compdfkit_Tools.Common"
  7. xmlns:cpdftools="clr-namespace:Compdfkit_Tools.PDFControl"
  8. Loaded="UserControl_Loaded"
  9. Unloaded="UserControl_Unloaded"
  10. mc:Ignorable="d"
  11. d:DesignHeight="450" d:DesignWidth="800">
  12. <UserControl.Resources>
  13. <ResourceDictionary>
  14. <ResourceDictionary.MergedDictionaries>
  15. <ResourceDictionary Source="../../Asset/Styles/ToggleButtonStyle.xaml"></ResourceDictionary>
  16. <ResourceDictionary Source="../../Asset/Styles/ButtonStyle.xaml"></ResourceDictionary>
  17. <ResourceDictionary Source="../../Asset/Styles/ComboBoxStyle.xaml"></ResourceDictionary>
  18. </ResourceDictionary.MergedDictionaries>
  19. <RoutedUICommand x:Key="Undo" Text="Undo"></RoutedUICommand>
  20. <RoutedUICommand x:Key="Redo" Text="Redo"></RoutedUICommand>
  21. </ResourceDictionary>
  22. </UserControl.Resources>
  23. <UserControl.InputBindings>
  24. <KeyBinding Key="Z" Modifiers="Control" Command="{StaticResource Undo}"/>
  25. <KeyBinding Key="Y" Modifiers="Control" Command="{StaticResource Redo}"/>
  26. </UserControl.InputBindings>
  27. <UserControl.CommandBindings>
  28. <CommandBinding Command="{StaticResource Undo}" Executed="CommandBinding_Executed_Undo"/>
  29. <CommandBinding Command="{StaticResource Redo}" Executed="CommandBinding_Executed_Redo"/>
  30. </UserControl.CommandBindings>
  31. <Grid x:Name="BodyGrid">
  32. <Grid.RowDefinitions>
  33. <RowDefinition Height="auto"></RowDefinition>
  34. <RowDefinition Height="auto"></RowDefinition>
  35. <RowDefinition Height="*"></RowDefinition>
  36. </Grid.RowDefinitions>
  37. <Grid.ColumnDefinitions>
  38. <ColumnDefinition Width="0"></ColumnDefinition>
  39. <ColumnDefinition Width="0"></ColumnDefinition>
  40. <ColumnDefinition Width="*"></ColumnDefinition>
  41. <ColumnDefinition Width="auto"></ColumnDefinition>
  42. </Grid.ColumnDefinitions>
  43. <Border x:Name="ToolBarContainer" Height="45" Visibility="Visible" BorderThickness="1" BorderBrush="#1A000000" Background="#F2F3F5" Grid.ColumnSpan="4">
  44. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  45. <StackPanel Orientation="Horizontal">
  46. <cpdfcommon:CPDFDigitalSignatureBarControl x:Name="DigitalSignatureBarControl" Height="44"/>
  47. <Line Height="40" Stroke="#D5D6D8" StrokeThickness="2" X1="0" Y1="10" X2="0" Y2="30" Margin="8,0,8,0" />
  48. <Button Name="UndoBtn" Style="{StaticResource LightButtonStyle}" BorderThickness="0" Width="40" Height="40" IsEnabled="{Binding CanUndo,Mode=OneWay}" Click="UndoButton_Click"
  49. Background="Transparent">
  50. <Path x:Name="UndoPath" IsEnabled="{Binding CanUndo,Mode=OneWay}">
  51. <Path.Style>
  52. <Style TargetType="Path">
  53. <Style.Triggers>
  54. <Trigger Property="IsEnabled" Value="False">
  55. <Setter Property="Fill" Value="LightGray"/>
  56. </Trigger>
  57. <Trigger Property="IsEnabled" Value="True">
  58. <Setter Property="Fill" Value="#43474D"/>
  59. </Trigger>
  60. </Style.Triggers>
  61. </Style>
  62. </Path.Style>
  63. <Path.Data>
  64. M1.03033 3.62131L0.5 4.15164L1.03033 4.68197L4.65164 8.30328L5.7123 7.24261L3.37132 4.90164H10.0607C11.5794 4.90164 12.8107 6.13285 12.8107
  65. 7.65164C12.8107 9.17042 11.5794 10.4016 10.0607 10.4016H2.56066V11.9016H10.0607C12.4079 11.9016 14.3107 9.99885 14.3107 7.65164C14.3107
  66. 5.30443 12.4079 3.40164 10.0607 3.40164H3.37132L5.7123 1.06066L4.65164 0L1.03033 3.62131Z
  67. </Path.Data>
  68. </Path>
  69. <Button.ToolTip>
  70. <ToolTip Content="Undo"></ToolTip>
  71. </Button.ToolTip>
  72. </Button>
  73. <Button Style="{StaticResource LightButtonStyle}" BorderThickness="0" Width="40" Height="40" Margin="10,0,0,0" IsEnabled="{Binding CanRedo,Mode=OneWay}" Click="RedoButton_Click"
  74. Background="Transparent">
  75. <Path IsEnabled="{Binding CanRedo,Mode=OneWay}">
  76. <Path.Resources>
  77. <Style TargetType="Path">
  78. <Style.Triggers>
  79. <Trigger Property="IsEnabled" Value="False">
  80. <Setter Property="Fill" Value="LightGray"/>
  81. </Trigger>
  82. <Trigger Property="IsEnabled" Value="True">
  83. <Setter Property="Fill" Value="#43474D"/>
  84. </Trigger>
  85. </Style.Triggers>
  86. </Style>
  87. </Path.Resources>
  88. <Path.Data>
  89. M13.7802 3.62131L14.3105 4.15164L13.7802 4.68197L10.1589 8.30328L9.09825 7.24261L11.4392 4.90164H4.74989C3.2311 4.90164 1.99989 6.13285
  90. 1.99989 7.65164C1.99989 9.17042 3.2311 10.4016 4.74989 10.4016H12.2499V11.9016H4.74989C2.40268 11.9016 0.499887 9.99885 0.499887
  91. 7.65164C0.499887 5.30443 2.40268 3.40164 4.74989 3.40164H11.4392L9.09825 1.06066L10.1589 0L13.7802 3.62131Z
  92. </Path.Data>
  93. </Path>
  94. <Button.ToolTip>
  95. <ToolTip Content="Redo"></ToolTip>
  96. </Button.ToolTip>
  97. </Button>
  98. </StackPanel>
  99. </StackPanel>
  100. </Border>
  101. <Border Grid.Column="2" Grid.Row="1" x:Name="SignatureStatusBorder" Visibility="Collapsed"></Border>
  102. <Border Grid.Row="2" Visibility="Collapsed" Name="BotaContainer"></Border>
  103. <GridSplitter Grid.Row="2" Name="Splitter" Grid.Column="1" Width="15" ResizeBehavior="PreviousAndNext" Visibility="Collapsed">
  104. <GridSplitter.Template>
  105. <ControlTemplate TargetType="{x:Type GridSplitter}">
  106. <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
  107. BorderBrush="{TemplateBinding Border.BorderBrush}"
  108. Background="{TemplateBinding Panel.Background}" >
  109. <Path Fill="Gray" VerticalAlignment="Center">
  110. <Path.Data>
  111. M15 3.75H1V2.25H15V3.75ZM15 8.75H1V7.25H15V8.75ZM1 13.75H15V12.25H1V13.75Z
  112. </Path.Data>
  113. </Path>
  114. </Border>
  115. </ControlTemplate>
  116. </GridSplitter.Template>
  117. </GridSplitter>
  118. <Border x:Name="PDFGrid" Background="#CECECE" Grid.Row="2" Grid.Column="2"></Border>
  119. <Border x:Name="PropertyContainer" Grid.Column="3" Grid.Row="2" Visibility="Collapsed"></Border>
  120. <cpdfcommon:PageNumberControl x:Name="FloatPageTool" Grid.Column="2" Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20"></cpdfcommon:PageNumberControl>
  121. </Grid>
  122. </UserControl>