ContentEditControl.xaml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <UserControl x:Class="Compdfkit_Tools.PDFControl.ContentEditControl"
  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. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Loaded="UserControl_Loaded"
  10. Unloaded="UserControl_UnLoaded">
  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. <RoutedUICommand x:Key="Undo" Text="Undo"></RoutedUICommand>
  19. <RoutedUICommand x:Key="Redo" Text="Redo"></RoutedUICommand>
  20. </ResourceDictionary>
  21. </UserControl.Resources>
  22. <UserControl.InputBindings>
  23. <KeyBinding Key="Z" Modifiers="Control" Command="{StaticResource Undo}"/>
  24. <KeyBinding Key="Y" Modifiers="Control" Command="{StaticResource Redo}"/>
  25. </UserControl.InputBindings>
  26. <UserControl.CommandBindings>
  27. <CommandBinding Command="{StaticResource Undo}" Executed="CommandBinding_Executed_Undo"/>
  28. <CommandBinding Command="{StaticResource Redo}" Executed="CommandBinding_Executed_Redo"/>
  29. </UserControl.CommandBindings>
  30. <Grid x:Name="BodyGrid">
  31. <Grid.RowDefinitions>
  32. <RowDefinition Height="auto"></RowDefinition>
  33. <RowDefinition Height="*"></RowDefinition>
  34. </Grid.RowDefinitions>
  35. <Grid.ColumnDefinitions>
  36. <ColumnDefinition Width="0"></ColumnDefinition>
  37. <ColumnDefinition Width="0"></ColumnDefinition>
  38. <ColumnDefinition Width="*"></ColumnDefinition>
  39. <ColumnDefinition Width="auto"></ColumnDefinition>
  40. </Grid.ColumnDefinitions>
  41. <Border x:Name="ToolBarContainer" Height="45" Visibility="Visible" BorderThickness="1" BorderBrush="#1A000000" Background="#F2F3F5" Grid.ColumnSpan="4">
  42. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  43. <ToggleButton Style="{StaticResource ToggleButtonStyle}" Name="PDFTextEditButton" BorderThickness="0" Padding="10,5,10,5" Click="PDFTextEditButton_Click" Width="99" Height="40">
  44. <StackPanel Orientation="Horizontal">
  45. <Path Fill="#273C62" VerticalAlignment="Center">
  46. <Path.Data>
  47. M1.25 0H0.5V0.75V13.25V14H1.25H17.75H18.5V13.25V7H17V12.5H2V1.5H12.5V0H1.25ZM11.5 5V2.5H3.5V5H5V4H6.75V10H6V11.5H9V10H8.25V4H10V5H11.5ZM15.75
  48. 3.75H13.5V2.25H15.75V0H17.25V2.25H19.5V3.75H17.25V6H15.75V3.75Z
  49. </Path.Data>
  50. </Path>
  51. <TextBlock FontSize="12" VerticalAlignment="Center" Margin="8,0,0,0">Text</TextBlock>
  52. </StackPanel>
  53. <ToggleButton.ToolTip>
  54. <ToolTip Content="Text"></ToolTip>
  55. </ToggleButton.ToolTip>
  56. </ToggleButton>
  57. <ToggleButton Style="{StaticResource ToggleButtonStyle}" Name="PDFImageEditButton" BorderThickness="0" Padding="10,5,10,5" Margin="10,0,0,0" Click="PDFImageEditButton_Click">
  58. <StackPanel Orientation="Horizontal">
  59. <Path Fill="#273C62" VerticalAlignment="Center">
  60. <Path.Data>
  61. M1.5 0H0.75V0.75V13.25V14H1.5H18H18.75V13.25V7H17.25V12.5H17.2147L11.8718 7.81776L9.56428 10.25L5.29496 6.75L2.25 9.95948V1.5H12.75V0H1.5ZM13.5 5.25C13.5
  62. 6.07843 12.8284 6.75 12 6.75C11.1716 6.75 10.5 6.07843 10.5 5.25C10.5 4.42157 11.1716 3.75 12 3.75C12.8284 3.75 13.5 4.42157 13.5 5.25ZM15.75
  63. 3.75H13.5V2.25H15.75V0H17.25V2.25H19.5V3.75H17.25V6H15.75V3.75Z
  64. </Path.Data>
  65. </Path>
  66. <TextBlock FontSize="12" VerticalAlignment="Center" Margin="8,0,0,0">Picture</TextBlock>
  67. </StackPanel>
  68. <ToggleButton.ToolTip>
  69. <ToolTip Content="Image"></ToolTip>
  70. </ToggleButton.ToolTip>
  71. </ToggleButton>
  72. <Line Height="40" Stroke="#D5D6D8" StrokeThickness="2" X1="0" Y1="10" X2="0" Y2="30" Margin="8,0,8,0" />
  73. <Button Name="UndoBtn" Style="{StaticResource LightButtonStyle}" BorderThickness="0" Width="40" Height="40" IsEnabled="{Binding CanUndo,Mode=OneWay}" Click="UndoBtn_Click"
  74. Background="Transparent">
  75. <Path x:Name="UndoPath" IsEnabled="{Binding CanUndo,Mode=OneWay}">
  76. <Path.Style>
  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.Style>
  88. <Path.Data>
  89. 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
  90. 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
  91. 5.30443 12.4079 3.40164 10.0607 3.40164H3.37132L5.7123 1.06066L4.65164 0L1.03033 3.62131Z
  92. </Path.Data>
  93. </Path>
  94. <Button.ToolTip>
  95. <ToolTip Content="Undo"></ToolTip>
  96. </Button.ToolTip>
  97. </Button>
  98. <Button Style="{StaticResource LightButtonStyle}" BorderThickness="0" Width="40" Height="40" Margin="10,0,0,0" IsEnabled="{Binding CanRedo,Mode=OneWay}" Click="RedoBtn_Click"
  99. Background="Transparent">
  100. <Path IsEnabled="{Binding CanRedo,Mode=OneWay}">
  101. <Path.Resources>
  102. <Style TargetType="Path">
  103. <Style.Triggers>
  104. <Trigger Property="IsEnabled" Value="False">
  105. <Setter Property="Fill" Value="LightGray"/>
  106. </Trigger>
  107. <Trigger Property="IsEnabled" Value="True">
  108. <Setter Property="Fill" Value="#43474D"/>
  109. </Trigger>
  110. </Style.Triggers>
  111. </Style>
  112. </Path.Resources>
  113. <Path.Data>
  114. 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
  115. 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
  116. 7.65164C0.499887 5.30443 2.40268 3.40164 4.74989 3.40164H11.4392L9.09825 1.06066L10.1589 0L13.7802 3.62131Z
  117. </Path.Data>
  118. </Path>
  119. <Button.ToolTip>
  120. <ToolTip Content="Undo"></ToolTip>
  121. </Button.ToolTip>
  122. </Button>
  123. </StackPanel>
  124. </Border>
  125. <Border Grid.Row="1" Visibility="Collapsed" x:Name="BotaContainer"></Border>
  126. <GridSplitter Grid.Row="1" Name="Splitter" Grid.Column="1" Width="15" ResizeBehavior="PreviousAndNext" Visibility="Collapsed">
  127. <GridSplitter.Template>
  128. <ControlTemplate TargetType="{x:Type GridSplitter}">
  129. <Border BorderThickness="{TemplateBinding Border.BorderThickness}"
  130. BorderBrush="{TemplateBinding Border.BorderBrush}"
  131. Background="{TemplateBinding Panel.Background}" >
  132. <Path Fill="Gray" VerticalAlignment="Center">
  133. <Path.Data>
  134. M15 3.75H1V2.25H15V3.75ZM15 8.75H1V7.25H15V8.75ZM1 13.75H15V12.25H1V13.75Z
  135. </Path.Data>
  136. </Path>
  137. </Border>
  138. </ControlTemplate>
  139. </GridSplitter.Template>
  140. </GridSplitter>
  141. <Border x:Name="PDFGrid" Background="#CECECE" Grid.Row="1" Grid.Column="2"></Border>
  142. <Border Grid.Column="3" Name="PropertyContainer" Grid.Row="1" Visibility="Collapsed" ></Border>
  143. <cpdfcommon:PageNumberControl Grid.Column="2" Grid.Row="1" x:Name="FloatPageTool" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="0,0,0,20"></cpdfcommon:PageNumberControl>
  144. </Grid>
  145. </UserControl>