AnnotationControl.xaml 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <UserControl x:Class="ComPDFKit.Controls.PDFControl.AnnotationControl"
  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. mc:Ignorable="d"
  7. xmlns:cpdftools="clr-namespace:ComPDFKit.Controls.PDFControl"
  8. xmlns:cpdfcommon="clr-namespace:ComPDFKit.Controls.Common"
  9. Loaded="UserControl_Loaded"
  10. Unloaded="UserControl_Unloaded"
  11. d:DesignHeight="720" d:DesignWidth="1080">
  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. <RoutedUICommand x:Key="Highlight" Text="Highlight"></RoutedUICommand>
  22. <RoutedUICommand x:Key="Underline" Text="Underline"></RoutedUICommand>
  23. <RoutedUICommand x:Key="Strikeout" Text="Strikeout"></RoutedUICommand>
  24. <RoutedUICommand x:Key="Squiggly" Text="Squiggly"></RoutedUICommand>
  25. </ResourceDictionary>
  26. </UserControl.Resources>
  27. <UserControl.InputBindings>
  28. <KeyBinding Key="Z" Modifiers="Control" Command="{StaticResource Undo}"/>
  29. <KeyBinding Key="Y" Modifiers="Control" Command="{StaticResource Redo}"/>
  30. <KeyBinding Key="H" Modifiers="Control+Alt" Command="{StaticResource Highlight}"></KeyBinding>
  31. <KeyBinding Key="U" Modifiers="Control+Alt" Command="{StaticResource Underline}"></KeyBinding>
  32. <KeyBinding Key="Q" Modifiers="Control+Alt" Command="{StaticResource Squiggly}"></KeyBinding>
  33. <KeyBinding Key="S" Modifiers="Control+Alt" Command="{StaticResource Strikeout}"></KeyBinding>
  34. </UserControl.InputBindings>
  35. <UserControl.CommandBindings>
  36. <CommandBinding Command="{StaticResource Undo}" Executed="CommandBinding_Executed_Undo"/>
  37. <CommandBinding Command="{StaticResource Redo}" Executed="CommandBinding_Executed_Redo"/>
  38. <CommandBinding Command="{StaticResource Highlight}" Executed="CommandBinding_Executed_Highlight"></CommandBinding>
  39. <CommandBinding Command="{StaticResource Underline}" Executed="CommandBinding_Executed_Underline"></CommandBinding>
  40. <CommandBinding Command="{StaticResource Strikeout}" Executed="CommandBinding_Executed_Strikeout"></CommandBinding>
  41. <CommandBinding Command="{StaticResource Squiggly}" Executed="CommandBinding_Executed_Squiggly"></CommandBinding>
  42. </UserControl.CommandBindings>
  43. <Grid Name="BodyGrid">
  44. <Grid.RowDefinitions>
  45. <RowDefinition Height="auto"/>
  46. <RowDefinition Height="*"/>
  47. </Grid.RowDefinitions>
  48. <Grid.ColumnDefinitions>
  49. <ColumnDefinition Width="0"></ColumnDefinition>
  50. <ColumnDefinition Width="0"></ColumnDefinition>
  51. <ColumnDefinition Width="*"></ColumnDefinition>
  52. <ColumnDefinition Width="auto"></ColumnDefinition>
  53. </Grid.ColumnDefinitions>
  54. <Border x:Name="ToolBarContainer" Height="45" Visibility="Visible" BorderThickness="1" BorderBrush="#1A000000" Background="#F2F3F5" Grid.ColumnSpan="4">
  55. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  56. <cpdftools:CPDFAnnotationBarControl x:Name="AnnotationBarControl" Loaded="AnnotationBarControl_Loaded" Unloaded="AnnotationBarControl_Unloaded" Height="44"/>
  57. <Line Height="40" Stroke="#D5D6D8" StrokeThickness="2" X1="0" Y1="10" X2="0" Y2="30" Margin="8,0,8,0" />
  58. <Button Name="UndoBtn" Style="{StaticResource LightButtonStyle}" BorderThickness="0" Width="40" Height="40" IsEnabled="{Binding CanUndo,Mode=OneWay}" Click="UndoButton_Click"
  59. Background="Transparent">
  60. <Path x:Name="UndoPath" IsEnabled="{Binding CanUndo,Mode=OneWay}">
  61. <Path.Style>
  62. <Style TargetType="Path">
  63. <Style.Triggers>
  64. <Trigger Property="IsEnabled" Value="False">
  65. <Setter Property="Fill" Value="LightGray"/>
  66. </Trigger>
  67. <Trigger Property="IsEnabled" Value="True">
  68. <Setter Property="Fill" Value="#43474D"/>
  69. </Trigger>
  70. </Style.Triggers>
  71. </Style>
  72. </Path.Style>
  73. <Path.Data>
  74. 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
  75. 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
  76. 5.30443 12.4079 3.40164 10.0607 3.40164H3.37132L5.7123 1.06066L4.65164 0L1.03033 3.62131Z
  77. </Path.Data>
  78. </Path>
  79. </Button>
  80. <Button x:Name="RedoBtn" Style="{StaticResource LightButtonStyle}" BorderThickness="0" Width="40" Height="40" Margin="10,0,0,0" IsEnabled="{Binding CanRedo,Mode=OneWay}" Click="RedoButton_Click"
  81. Background="Transparent">
  82. <Path IsEnabled="{Binding CanRedo,Mode=OneWay}">
  83. <Path.Resources>
  84. <Style TargetType="Path">
  85. <Style.Triggers>
  86. <Trigger Property="IsEnabled" Value="False">
  87. <Setter Property="Fill" Value="LightGray"/>
  88. </Trigger>
  89. <Trigger Property="IsEnabled" Value="True">
  90. <Setter Property="Fill" Value="#43474D"/>
  91. </Trigger>
  92. </Style.Triggers>
  93. </Style>
  94. </Path.Resources>
  95. <Path.Data>
  96. 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
  97. 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
  98. 7.65164C0.499887 5.30443 2.40268 3.40164 4.74989 3.40164H11.4392L9.09825 1.06066L10.1589 0L13.7802 3.62131Z
  99. </Path.Data>
  100. </Path>
  101. </Button>
  102. </StackPanel>
  103. </Border>
  104. <Border Grid.Row="1" Visibility="Collapsed" Name="BotaContainer">
  105. </Border>
  106. <GridSplitter Grid.Row="1" Name="Splitter" Grid.Column="1" Width="15" ResizeBehavior="PreviousAndNext" Visibility="Collapsed">
  107. <GridSplitter.Template>
  108. <ControlTemplate TargetType="{x:Type GridSplitter}">
  109. <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
  110. BorderBrush="{TemplateBinding Border.BorderBrush}"
  111. Background="{TemplateBinding Panel.Background}" >
  112. <Path Fill="Gray" VerticalAlignment="Center">
  113. <Path.Data>
  114. M15 3.75H1V2.25H15V3.75ZM15 8.75H1V7.25H15V8.75ZM1 13.75H15V12.25H1V13.75Z
  115. </Path.Data>
  116. </Path>
  117. </Border>
  118. </ControlTemplate>
  119. </GridSplitter.Template>
  120. </GridSplitter>
  121. <Border x:Name="PDFGrid" Background="#CECECE" Grid.Row="1" Grid.Column="2"></Border>
  122. <Border Grid.Column="3" Name="PropertyContainer" Grid.Row="1" Visibility="Collapsed" ></Border>
  123. <cpdfcommon:PageNumberControl Grid.Column="2" Grid.Row="1" x:Name="FloatPageTool" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20"></cpdfcommon:PageNumberControl>
  124. </Grid>
  125. </UserControl>