HomeToolIControl.xaml 18 KB

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