QuickToolsContent.xaml 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <UserControl
  2. x:Class="PDF_Office.Views.HomePanel.PDFTools.QuickToolsContent"
  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:local="clr-namespace:PDF_Office.Views.HomePanel"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
  9. xmlns:Converter="clr-namespace:PDF_Office.DataConvert"
  10. xmlns:homePanel="clr-namespace:PDF_Office.Views.HomePanel"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. mc:Ignorable="d">
  14. <UserControl.Resources>
  15. <Style x:Key="LabelSty"
  16. TargetType="{x:Type Label}">
  17. <Setter Property="Padding"
  18. Value="10,5" />
  19. <Setter Property="Background"
  20. Value="CadetBlue" />
  21. <Setter Property="Foreground"
  22. Value="White" />
  23. </Style>
  24. <Style x:Key="FocusVisual">
  25. <Setter Property="Control.Template">
  26. <Setter.Value>
  27. <ControlTemplate>
  28. <Rectangle Margin="0"
  29. SnapsToDevicePixels="true"
  30. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  31. StrokeDashArray="1 2"
  32. StrokeThickness="0" />
  33. </ControlTemplate>
  34. </Setter.Value>
  35. </Setter>
  36. </Style>
  37. <!-- set SelectedBackgroundColor to Transparent when you do not need the background in selected items -->
  38. <Color x:Key="SelectedBackgroundColor">LightBlue</Color>
  39. <Color x:Key="SelectedUnfocusedColor">AliceBlue</Color>
  40. <!-- set the MouseOverColor to Transparent when you do not need the effect in the unselected items -->
  41. <Color x:Key="MouseOverColor">LightBlue</Color>
  42. <SolidColorBrush x:Key="Item.MouseOver.Background"
  43. Color="LightBlue" />
  44. <SolidColorBrush x:Key="Item.MouseOver.Border"
  45. Color="LightBlue" />
  46. <SolidColorBrush x:Key="Item.SelectedInactive.Background"
  47. Color="AliceBlue" />
  48. <SolidColorBrush x:Key="Item.SelectedInactive.Border"
  49. Color="AliceBlue" />
  50. <SolidColorBrush x:Key="Item.SelectedActive.Background"
  51. Color="Beige" />
  52. <SolidColorBrush x:Key="Item.SelectedActive.Border"
  53. Color="Beige" />
  54. <Style x:Key="ListBoxItemStyle"
  55. TargetType="{x:Type customControl:ListItemQuickTool}">
  56. <Setter Property="SnapsToDevicePixels"
  57. Value="True" />
  58. <Setter Property="FocusVisualStyle"
  59. Value="{x:Null}" />
  60. <!-- 导致模块闪烁,并且时有时无
  61. <EventSetter Event="DragLeave"
  62. Handler="MyListBoxItem_DragLeave">
  63. </EventSetter>-->
  64. <Setter Property="Template">
  65. <Setter.Value>
  66. <ControlTemplate TargetType="{x:Type customControl:ListItemQuickTool}">
  67. <!--Width="230" Margin="50,20,0,10"-->
  68. <Border x:Name="Border"
  69. Margin="0,0,0,30"
  70. Background="AliceBlue"
  71. SnapsToDevicePixels="true">
  72. <ContentPresenter />
  73. </Border>
  74. <ControlTemplate.Triggers>
  75. <MultiTrigger>
  76. <MultiTrigger.Conditions>
  77. <Condition Property="IsOverModular"
  78. Value="True" />
  79. </MultiTrigger.Conditions>
  80. <Setter TargetName="Border"
  81. Property="Background"
  82. Value="{StaticResource Item.MouseOver.Background}" />
  83. <Setter TargetName="Border"
  84. Property="BorderBrush"
  85. Value="{StaticResource Item.MouseOver.Border}" />
  86. </MultiTrigger>
  87. <!--<MultiTrigger>
  88. <MultiTrigger.Conditions>
  89. -->
  90. <!--<Condition Property="DragLeave"
  91. Value="True" />-->
  92. <!--
  93. <Condition Property="IsFilePicked"
  94. Value="False" />
  95. </MultiTrigger.Conditions>
  96. <Setter TargetName="Border"
  97. Property="Background"
  98. Value="AliceBlue" />
  99. <Setter TargetName="Border"
  100. Property="BorderBrush"
  101. Value="AliceBlue" />
  102. </MultiTrigger>-->
  103. <!--<MultiTrigger>
  104. <MultiTrigger.Conditions>
  105. <Condition Property="IsMouseOver"
  106. Value="True" />
  107. </MultiTrigger.Conditions>
  108. <Setter TargetName="Border"
  109. Property="Background"
  110. Value="{StaticResource Item.MouseOver.Background}" />
  111. <Setter TargetName="Border"
  112. Property="BorderBrush"
  113. Value="{StaticResource Item.MouseOver.Border}" />
  114. </MultiTrigger>-->
  115. <!--<MultiTrigger>
  116. <MultiTrigger.Conditions>
  117. <Condition Property="Selector.IsSelectionActive"
  118. Value="False" />
  119. <Condition Property="IsSelected"
  120. Value="True" />
  121. </MultiTrigger.Conditions>
  122. <Setter TargetName="Border"
  123. Property="Background"
  124. Value="{StaticResource Item.SelectedInactive.Background}" />
  125. <Setter TargetName="Border"
  126. Property="BorderBrush"
  127. Value="{StaticResource Item.SelectedInactive.Border}" />
  128. </MultiTrigger>
  129. <MultiTrigger>
  130. <MultiTrigger.Conditions>
  131. <Condition Property="Selector.IsSelectionActive"
  132. Value="True" />
  133. <Condition Property="IsSelected"
  134. Value="True" />
  135. </MultiTrigger.Conditions>
  136. <Setter TargetName="Border"
  137. Property="Background"
  138. Value="{StaticResource Item.SelectedActive.Background}" />
  139. <Setter TargetName="Border"
  140. Property="BorderBrush"
  141. Value="{StaticResource Item.SelectedActive.Border}" />
  142. </MultiTrigger>
  143. <Trigger Property="IsEnabled"
  144. Value="False">
  145. <Setter TargetName="Border"
  146. Property="TextElement.Foreground"
  147. Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  148. </Trigger>-->
  149. </ControlTemplate.Triggers>
  150. </ControlTemplate>
  151. </Setter.Value>
  152. </Setter>
  153. <Style.Triggers />
  154. </Style>
  155. <Style x:Key="MoreListBoxItemStyle"
  156. TargetType="{x:Type customControl:ListItemQuickTool}">
  157. <Setter Property="SnapsToDevicePixels"
  158. Value="True" />
  159. <Setter Property="Template">
  160. <Setter.Value>
  161. <ControlTemplate TargetType="{x:Type customControl:ListItemQuickTool}">
  162. <Border x:Name="Border" Margin="0,0,0,0"
  163. Background="LightGray"
  164. SnapsToDevicePixels="False">
  165. <ContentPresenter />
  166. </Border>
  167. <ControlTemplate.Triggers>
  168. <MultiTrigger>
  169. <MultiTrigger.Conditions>
  170. <Condition Property="IsSelected"
  171. Value="true" />
  172. </MultiTrigger.Conditions>
  173. <MultiTrigger.Setters>
  174. <Setter TargetName="Border"
  175. Property="Background"
  176. Value="LightGoldenrodYellow" />
  177. </MultiTrigger.Setters>
  178. </MultiTrigger>
  179. </ControlTemplate.Triggers>
  180. </ControlTemplate>
  181. </Setter.Value>
  182. </Setter>
  183. </Style>
  184. <Converter:BoolToVisible x:Key="BoolToVisibilityConverter" />
  185. <DataTemplate x:Key="DataTemplate">
  186. <homePanel:HomeToolItem x:Name="data"/>
  187. </DataTemplate>
  188. <ItemsPanelTemplate x:Key="ListItemsPanelTemplate">
  189. <WrapPanel AllowDrop="True"
  190. Orientation="Horizontal" />
  191. </ItemsPanelTemplate>
  192. </UserControl.Resources>
  193. <Grid Grid.ColumnSpan="2" Margin="0,0,20,0">
  194. <Grid.RowDefinitions>
  195. <RowDefinition Height="Auto"/>
  196. <RowDefinition Height="*"/>
  197. </Grid.RowDefinitions>
  198. <TextBlock
  199. x:Name="TxbQuickToolsTitle"
  200. Margin="0,0,0,16"
  201. FontSize="24"
  202. FontWeight="SemiBold"
  203. Text="Quick Tools" />
  204. <StackPanel
  205. x:Name="PnlToolsUIBtns" Grid.ColumnSpan="2"
  206. Grid.Column="0"
  207. Margin="0,0,12,0"
  208. HorizontalAlignment="Right"
  209. VerticalAlignment="Top"
  210. Orientation="Horizontal"
  211. Visibility="Visible">
  212. <Button
  213. x:Name="BtnTools"
  214. Width="68"
  215. Height="28"
  216. Margin="0,0,0,0"
  217. Background="#FFFFFF"
  218. Content="Tools"
  219. Click="BtnTools_Click"
  220. >
  221. </Button>
  222. <Button
  223. x:Name="BtnMore"
  224. Width="28"
  225. Height="28"
  226. Margin="12,0,0,0"
  227. Background="#FFFFFF" BorderThickness="0" Content="..."
  228. Click="BtnMore_Click"
  229. >
  230. </Button>
  231. </StackPanel>
  232. <Grid
  233. x:Name="GridAllTools"
  234. Grid.Row="1" Height="270"
  235. SizeChanged="GridAllTools_SizeChanged">
  236. <customControl:ListBoxEx x:Name="ListBoxToolBars" HorizontalAlignment="Stretch" MinWidth="540"
  237. Grid.Row="3"
  238. AllowDrop="True"
  239. BorderThickness="0"
  240. SizeChanged="ListBoxShortCuts_SizeChanged"
  241. ItemContainerStyle="{StaticResource MoreListBoxItemStyle}"
  242. ItemTemplate="{StaticResource DataTemplate}"
  243. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  244. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  245. SelectionMode="Single" />
  246. <!--<WrapPanel Visibility="Collapsed"
  247. x:Name="Pnlwrap"
  248. MinWidth="230"
  249. HorizontalAlignment="Left"
  250. IsEnabled="True">
  251. <local:HomeToolItem x:Name="ToolItemBatch"
  252. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  253. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  254. ToolInfo="Batch convert, compress, secure, watermark PDFs."
  255. ToolTitile="Batch" />
  256. <local:HomeToolItem x:Name="ToolItemOCR"
  257. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  258. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  259. ToolInfo="Convert PDFs to Word/ HTML/ TXT/ JPEG/ PNG files."
  260. ToolTitile="OCR" />
  261. <local:HomeToolItem x:Name="ToolItemConvertPDF"
  262. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  263. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  264. ToolInfo="Protect PDFs with image/ text watermarks from plagiarism."
  265. ToolTitile="Convert PDF" />
  266. <local:HomeToolItem x:Name="ToolItemImageToPDF"
  267. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  268. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  269. ToolInfo="Protect PDFs with image/ text watermarks from plagiarism."
  270. ToolTitile="Image To PDF" />
  271. <local:HomeToolItem x:Name="ToolItemMergePDF"
  272. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  273. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  274. ToolInfo="Protect PDFs with image/ text watermarks from plagiarism."
  275. ToolTitile="Merge PDF"
  276. />
  277. <local:HomeToolItem x:Name="ToolItemCompressPDF"
  278. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  279. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  280. ToolInfo="Convert JPEG/ JPG/ PNG/ TIFF/ BMP/ PSD files to PDFs."
  281. ToolTitile="Compress PDF" />
  282. <local:HomeToolItem x:Name="ToolItemSecurity"
  283. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  284. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  285. ToolInfo="Convert PDFs to Word, Fonts formatting get converted."
  286. ToolTitile="Security" />
  287. <local:HomeToolItem x:Name="ToolItem1"
  288. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  289. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  290. ToolInfo="QuickTools_ToolMergeInfo"
  291. ToolTitile="QuickTools_ToolMerge" />
  292. <local:HomeToolItem x:Name="ToolItem2"
  293. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  294. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  295. ToolInfo="Protect PDFs with image/ text watermarks from plagiarism."
  296. ToolTitile="Compare PDF" />
  297. <local:HomeToolItem x:Name="ToolItem3"
  298. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  299. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  300. ToolInfo="Protect PDFs with image/ text watermarks from plagiarism."
  301. ToolTitile="QuickTools_ToolImageToPDF"
  302. Visibility="Collapsed" />
  303. <local:HomeToolItem x:Name="ToolItem4"
  304. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  305. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  306. ToolInfo="QuickTools_ToolSecurityInfo"
  307. ToolTitile="QuickTools_ToolSecurity"
  308. Visibility="Collapsed" />
  309. <local:HomeToolItem x:Name="ToolItem5"
  310. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  311. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  312. ToolInfo="QuickTools_ToolWatermarkInfo"
  313. ToolTitile="QuickTools_ToolWatermark"
  314. Visibility="Visible" />
  315. <local:HomeToolItem x:Name="ToolItem6"
  316. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  317. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  318. ToolInfo="QuickTools_ToolHeaderFooterInfo"
  319. ToolTitile="QuickTools_ToolHeaderFooter"
  320. Visibility="Visible" />
  321. <local:HomeToolItem x:Name="ToolItem7"
  322. IconHoverPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  323. IconPath="pack://application:,,,/Resources/QuickToolIcon/Batch.png"
  324. ToolInfo="QuickTools_ToolBatesInfo"
  325. ToolTitile="QuickTools_ToolBates"
  326. Visibility="Visible" />
  327. </WrapPanel>-->
  328. </Grid>
  329. </Grid>
  330. </UserControl>