ToolsBarContent.xaml 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <UserControl
  2. x:Class="PDF_Office.Views.Tools.ToolsBarContent"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:prism="http://prismlibrary.com/"
  7. xmlns:tools="clr-namespace:PDF_Office.ViewModels.Tools" xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  8. prism:ViewModelLocator.AutoWireViewModel="True">
  9. <UserControl.Resources>
  10. <convert:InvertBoolConvert x:Key="InvertBoolConvert" />
  11. </UserControl.Resources>
  12. <Border
  13. x:Name="ToolsBorder"
  14. Height="40"
  15. BorderBrush="#1A000000"
  16. BorderThickness="0,1,0,1" >
  17. <Grid Height="40" HorizontalAlignment="Center" >
  18. <Grid VerticalAlignment="Center">
  19. <StackPanel Orientation="Horizontal" UseLayoutRounding="False">
  20. <Button Command="{Binding CompressCommand}" Style="{StaticResource InsideBarBtnStyle}">
  21. <StackPanel Orientation="Horizontal" Margin=" 4,0,4,0">
  22. <StackPanel Margin="0,0,4,0">
  23. <Grid>
  24. <Path Data="M16 19H4C3.44772 19 3 18.5523 3 18V2C3 1.44772 3.44772 1 4 1H11.8671C12.1563 1 12.4315 1.12527 12.6214 1.34348L16.7543 6.09195C16.9127 6.27398 17 6.50715 17 6.74847V18C17 18.5523 16.5523 19 16 19Z" Stroke="#273C62" StrokeThickness="2"></Path>
  25. <Path Data="M8 2H6V4H8V6H6V8H8V10H6V12V15C6 15.5523 6.44772 16 7 16H9C9.55228 16 10 15.5523 10 15V12H8V10H10V8H8V6H10V4H8V2Z" Fill="#94989C"></Path>
  26. </Grid>
  27. </StackPanel>
  28. <TextBlock VerticalAlignment="Center" Text="压缩" />
  29. </StackPanel>
  30. </Button>
  31. <Button Command="{Binding MergeCommand}" Style="{StaticResource InsideBarBtnStyle}">
  32. <StackPanel Orientation="Horizontal" Margin=" 4,0,4,0">
  33. <StackPanel Margin="0,0,4,0">
  34. <Grid>
  35. <Path Data="M2 2C0.89543 2 0 2.89543 0 4V16C0 17.1046 0.89543 18 2 18H7C8.10457 18 9 17.1046 9 16V13.5H7V16H2V4L7 4V6.5H9V4C9 2.89543 8.10457 2 7 2H2ZM13 2C11.8954 2 11 2.89543 11 4V6.5H13V4H18V16H13V13.5H11V16C11 17.1046 11.8954 18 13 18H18C19.1046 18 20 17.1046 20 16V4C20 2.89543 19.1046 2 18 2H13Z" Fill="#273C62"></Path>
  36. <Path Data="M5.29295 7.87868L6.41427 9L3 9V11L6.41427 11L5.29295 12.1213L6.70716 13.5355L9.53559 10.7071L10 10.2427L10.4644 10.7071L13.2928 13.5355L14.707 12.1213L13.5857 11L17 11V9L13.5857 9L14.707 7.87868L13.2928 6.46446L10.4644 9.29289L10 9.7573L9.53559 9.29289L6.70716 6.46446L5.29295 7.87868Z" Fill="#94989C"></Path>
  37. </Grid>
  38. </StackPanel>
  39. <TextBlock VerticalAlignment="Center" Text="合并" />
  40. </StackPanel>
  41. </Button>
  42. <Button Name="SecurityButtonMore" Style="{StaticResource InsideBarBtnStyle}" IsEnabled="{Binding ElementName=SecurityMenuMore, Path=IsOpen, Converter={StaticResource InvertBoolConvert}}" Click="SecurityButtonMore_Click" Initialized="SecurityButtonMore_Initialized">
  43. <StackPanel Orientation="Horizontal">
  44. <StackPanel Margin=" 4,0,4,0">
  45. <Grid>
  46. <Path Data="M2.50001 3.22655L2.50001 2.79201L10 1.02731L17.5 2.79201V2.80177V2.81579V2.82991V2.84413V2.85846V2.8729V2.88745V2.90209V2.91685V2.93171V2.94667V2.96173V2.9769V2.99217V3.00755V3.02302V3.0386V3.05428V3.07006V3.08594V3.10192V3.118V3.13418V3.15046V3.16683V3.18331V3.19988V3.21655V3.23332V3.25018V3.26714V3.2842V3.30135V3.3186V3.33594V3.35338V3.37091V3.38853V3.40625V3.42406V3.44196V3.45996V3.47805V3.49623V3.51449V3.53285V3.55131V3.56985V3.58848V3.60719V3.626V3.6449V3.66388V3.68295V3.70211V3.72136V3.74069V3.76011V3.77961V3.7992V3.81887V3.83863V3.85848V3.8784V3.89841V3.9185V3.93868V3.95894V3.97928V3.9997V4.0202V4.04079V4.06145V4.08219V4.10302V4.12392V4.1449V4.16596V4.1871V4.20831V4.22961V4.25098V4.27242V4.29395V4.31554V4.33722V4.35897V4.38079V4.40269V4.42466V4.44671V4.46882V4.49102V4.51328V4.53562V4.55802V4.5805V4.60305V4.62567V4.64836V4.67112V4.69395V4.71685V4.73982V4.76285V4.78595V4.80912V4.83236V4.85567V4.87904V4.90247V4.92597V4.94954V4.97317V4.99687V5.02063V5.04445V5.06834V5.09229V5.1163V5.14038V5.16452V5.18871V5.21297V5.23729V5.26167V5.28611V5.31061V5.33517V5.35979V5.38446V5.40919V5.43399V5.45883V5.48374V5.5087V5.53372V5.55879V5.58392V5.6091V5.63434V5.65963V5.68498V5.71038V5.73583V5.76133V5.78689V5.8125V5.83816V5.86387V5.88963V5.91545V5.94131V5.96722V5.99318V6.01919V6.04525V6.07136V6.09751V6.12372V6.14996V6.17626V6.2026V6.22899V6.25542V6.2819V6.30842V6.33499V6.3616V6.38825V6.41495V6.44169V6.46847V6.4953V6.52216V6.54907V6.57602V6.60301V6.63004V6.6571V6.68421V6.71136V6.73854V6.76577V6.79303V6.82033V6.84766V6.87504V6.90244V6.92989V6.95737V6.98489V7.01244V7.04002V7.06764V7.09529V7.12298V7.15069V7.17845V7.20623V7.23404V7.26189V7.28977V7.31767V7.34561V7.37358V7.40158V7.4296V7.45766V7.48574V7.51385V7.54199V7.57016V7.59835V7.62657V7.65482V7.68309V7.71138V7.7397V7.76805V7.79642V7.82481V7.85323V7.88167V7.91013V7.93862V7.96712V7.99565V8.0242V8.05277V8.08136V8.10997V8.1386V8.16725V8.19592V8.2246V8.25331V8.28203V8.31077V8.33953V8.3683V8.39709V8.42589V8.45471V8.48355V8.5124V8.54126V8.57014V8.59903V8.62793V8.65685V8.68578V8.71472V8.74368V8.77264V8.80162V8.8306V8.8596V8.8886V8.91762V8.94664V8.97567V9.00471V9.03376V9.06282V9.09188V9.12095V9.15003V9.17911V9.20819V9.23729V9.26638V9.29549V9.32459V9.3537V9.38281V9.41193V9.44104V9.47017V9.49929V9.52841V9.55753V9.58666V9.61578V9.64491V9.67403V9.70315V9.73227V9.76139V9.79051V9.81963V9.84874V9.87785V9.90695V9.93606V9.96515V9.99425V10.0233V10.0524V10.0815V10.1106V10.1396V10.1687V10.1977V10.2268V10.2558V10.2848V10.3138V10.3428V10.3718V10.4008V10.4298V10.4588V10.4877V10.5167V10.5456V10.5745V10.6034V10.6323V10.6612V10.6901V10.7189V10.7477V10.7766V10.8054V10.8342V10.8629V10.8917V10.9204V10.9492V10.9779V11.0065V11.0352V11.0639V11.0925V11.1211V11.1497V11.1783V11.2068V11.2354V11.2639V11.2923V11.3208V11.3493V11.3777V11.4061V11.4344V11.4628V11.4911V11.5194V11.5477V11.5759V11.6041V11.6323V11.6605V11.6886V11.7168V11.7448V11.7729V11.8009V11.8289V11.8569V11.8848V11.9127V11.9406V11.9685V11.9963V12.0241V12.0518V12.0795V12.1072V12.1349V12.1625V12.1901V12.2176V12.2452V12.2726V12.3001V12.3275V12.3549V12.3822V12.4095V12.4368V12.464V12.4912V12.5183V12.5455V12.5725V12.5996V12.6265V12.6535V12.6804V12.7073V12.7341V12.7609V12.7876V12.8143V12.841V12.8676V12.8942V12.9207V12.9472V12.9736V13C17.5 13.5369 17.1807 14.1959 16.451 14.955C15.7396 15.695 14.7594 16.4028 13.7312 17.0267C12.7108 17.6459 11.684 18.1581 10.9085 18.5167C10.5349 18.6894 10.2222 18.8253 10 18.9191C9.77783 18.8253 9.46513 18.6894 9.09151 18.5167C8.31597 18.1581 7.28917 17.6459 6.26873 17.0267C5.24056 16.4028 4.26037 15.695 3.549 14.955C2.81927 14.1959 2.49998 13.5369 2.5 13L2.50004 6.18749L2.50001 3.22655Z" Stroke="#273C62" StrokeThickness="2"></Path>
  47. <Path Data="M9 10V13H11V10H14V8H11V5H9V8H6V10H9Z" Fill="#94989C"></Path>
  48. </Grid>
  49. </StackPanel>
  50. <TextBlock VerticalAlignment="Center" Text="安全" />
  51. <Path
  52. Width="12"
  53. Height="12"
  54. Margin="4,0"
  55. Data="M6.5 10L11.5 4H1.5L6.5 10Z"
  56. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  57. </StackPanel>
  58. <Button.ContextMenu>
  59. <ContextMenu Name="SecurityMenuMore" Placement="Bottom">
  60. <MenuItem Header="Set Passwords" Command="{Binding SetPasswordCommand}"/>
  61. <MenuItem Header="Remove Security" Command="{Binding CancelPasswordCommand}" />
  62. </ContextMenu>
  63. </Button.ContextMenu>
  64. </Button>
  65. <Button Style="{StaticResource InsideBarBtnStyle}" Visibility="Collapsed">
  66. <StackPanel Margin="12,0,12,0" Orientation="Horizontal">
  67. <StackPanel Margin="0,0,8,0">
  68. <Border
  69. Width="30"
  70. Height="30"
  71. Background="LightSeaGreen" />
  72. </StackPanel>
  73. <TextBlock VerticalAlignment="Center" Text="文件对比" />
  74. </StackPanel>
  75. </Button>
  76. <Rectangle Width="1" Height="16" Fill="{StaticResource color.sys.layout.divider}" Margin="12,0,12,0"></Rectangle>
  77. <Button
  78. Name="RedactionContent"
  79. Command="{Binding SetEditToolsCommand}"
  80. CommandParameter="{Binding ElementName=RedactionContent}"
  81. Style="{StaticResource InsideBarBtnStyle}" Visibility="Collapsed">
  82. <StackPanel Margin="12,0,12,0" Orientation="Horizontal">
  83. <StackPanel Margin="0,0,8,0">
  84. <Border
  85. Width="30"
  86. Height="30"
  87. Background="LightSeaGreen" />
  88. </StackPanel>
  89. <TextBlock VerticalAlignment="Center" Text="密文" />
  90. <Path
  91. HorizontalAlignment="Right"
  92. VerticalAlignment="Center"
  93. Data="M0 0L4 4L8 0H0Z"
  94. Fill="Black">
  95. <Path.RenderTransform>
  96. <TranslateTransform X="8" />
  97. </Path.RenderTransform>
  98. </Path>
  99. </StackPanel>
  100. </Button>
  101. <Button
  102. x:Name="WatermarkContent"
  103. Command="{Binding SetEditToolsCommand}"
  104. CommandParameter="{Binding ElementName=WatermarkContent}"
  105. Style="{StaticResource InsideBarBtnStyle}" Visibility="Collapsed">
  106. <StackPanel Margin="12,0,12,0" Orientation="Horizontal">
  107. <StackPanel Margin="0,0,8,0">
  108. <Border
  109. Width="30"
  110. Height="30"
  111. Background="LightSeaGreen" />
  112. </StackPanel>
  113. <TextBlock VerticalAlignment="Center" Text="水印" />
  114. <Path
  115. HorizontalAlignment="Right"
  116. VerticalAlignment="Center"
  117. Data="M0 0L4 4L8 0H0Z"
  118. Fill="Black">
  119. <Path.RenderTransform>
  120. <TranslateTransform X="8" />
  121. </Path.RenderTransform>
  122. </Path>
  123. </StackPanel>
  124. </Button>
  125. <Button
  126. Name="BackgroundContent"
  127. Command="{Binding SetEditToolsCommand}"
  128. CommandParameter="{Binding ElementName=BackgroundContent}"
  129. Style="{StaticResource InsideBarBtnStyle}" Visibility="Collapsed">
  130. <StackPanel Margin="12,0,12,0" Orientation="Horizontal">
  131. <StackPanel Margin="0,0,8,0">
  132. <Border
  133. Width="30"
  134. Height="30"
  135. Background="LightSeaGreen" />
  136. </StackPanel>
  137. <TextBlock VerticalAlignment="Center" Text="背景" />
  138. <Path
  139. HorizontalAlignment="Right"
  140. VerticalAlignment="Center"
  141. Data="M0 0L4 4L8 0H0Z"
  142. Fill="Black">
  143. <Path.RenderTransform>
  144. <TranslateTransform X="8" />
  145. </Path.RenderTransform>
  146. </Path>
  147. </StackPanel>
  148. </Button>
  149. <Button
  150. Name="HeaderFooterContent"
  151. Command="{Binding SetEditToolsCommand}"
  152. CommandParameter="{Binding ElementName=HeaderFooterContent}"
  153. Style="{StaticResource InsideBarBtnStyle}" Visibility="Collapsed">
  154. <StackPanel Margin="12,0,12,0" Orientation="Horizontal">
  155. <StackPanel Margin="0,0,8,0">
  156. <Border
  157. Width="30"
  158. Height="30"
  159. Background="LightSeaGreen" />
  160. </StackPanel>
  161. <TextBlock VerticalAlignment="Center" Text="页眉页脚" />
  162. <Path
  163. HorizontalAlignment="Right"
  164. VerticalAlignment="Center"
  165. Data="M0 0L4 4L8 0H0Z"
  166. Fill="Black">
  167. <Path.RenderTransform>
  168. <TranslateTransform X="8" />
  169. </Path.RenderTransform>
  170. </Path>
  171. </StackPanel>
  172. </Button>
  173. <Button
  174. Name="BatesContent"
  175. Command="{Binding SetEditToolsCommand}"
  176. CommandParameter="{Binding ElementName=BatesContent}"
  177. Style="{StaticResource InsideBarBtnStyle}" Visibility="Collapsed">
  178. <StackPanel Margin="12,0,12,0" Orientation="Horizontal">
  179. <StackPanel Margin="0,0,8,0">
  180. <Border
  181. Width="30"
  182. Height="30"
  183. Background="LightSeaGreen" />
  184. </StackPanel>
  185. <TextBlock VerticalAlignment="Center" Text="贝茨码" />
  186. <Path
  187. HorizontalAlignment="Right"
  188. VerticalAlignment="Center"
  189. Data="M0 0L4 4L8 0H0Z"
  190. Fill="Black">
  191. <Path.RenderTransform>
  192. <TranslateTransform X="8" />
  193. </Path.RenderTransform>
  194. </Path>
  195. </StackPanel>
  196. </Button>
  197. <Button Style="{StaticResource InsideBarBtnStyle}" Visibility="Visible" IsEnabled="{Binding ElementName=SecurityMenuMore, Path=IsOpen, Converter={StaticResource InvertBoolConvert}}" Click="CropPageMore_Click" Initialized="CropPageMore_Initialized" Name="CropPageMenuMore">
  198. <StackPanel Orientation="Horizontal" Margin="4,0,4,0">
  199. <Path Data="M13 16L5 16C4.44771 16 4 15.5523 4 15V7L4 2V0H2L2 2H0V4H2L2 15C2 16.6569 3.34315 18 5 18L16 18V20H18V18H20V16H18H16H13ZM16 14V5C16 4.44771 15.5523 4 15 4H6V2H15C16.6569 2 18 3.34315 18 5V14H16Z" Fill="#273C62"></Path>
  200. <TextBlock VerticalAlignment="Center" Text="裁剪" />
  201. <Path
  202. Width="12"
  203. Height="12"
  204. Margin="4,0"
  205. Data="M6.5 10L11.5 4H1.5L6.5 10Z"
  206. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  207. </StackPanel>
  208. <Button.ContextMenu>
  209. <ContextMenu Name="CropPageMenu" Placement="Bottom">
  210. <MenuItem Header="Crop Current Page - White Margins" Command="{Binding CropCurrentPageWMCommand}"/>
  211. <MenuItem Header="Crop All Pages - White Margins" Command="{Binding CropAllPagesWMCommand}" />
  212. </ContextMenu>
  213. </Button.ContextMenu>
  214. </Button>
  215. </StackPanel>
  216. </Grid>
  217. </Grid>
  218. </Border>
  219. </UserControl>