PDFToolsContent.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. <UserControl x:Class="PDF_Master.Views.HomePanel.PDFTools.PDFToolsContent"
  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:local="clr-namespace:PDF_Master.Views.HomePanel.PDFTools"
  7. xmlns:customControl="clr-namespace:PDF_Master.CustomControl"
  8. xmlns:converter="clr-namespace:PDF_Master.DataConvert"
  9. xmlns:prism ="http://prismlibrary.com/"
  10. prism:ViewModelLocator.AutoWireViewModel="True"
  11. Background="White" MinWidth="540" MinHeight="460"
  12. mc:Ignorable="d" Loaded="Page_Loaded"
  13. d:DesignHeight="450" d:DesignWidth="800"
  14. >
  15. <UserControl.Resources>
  16. <ResourceDictionary>
  17. <ResourceDictionary.MergedDictionaries>
  18. <ResourceDictionary Source="../../../Styles/CustomListItemStyle.xaml"/>
  19. <ResourceDictionary Source="../../../Styles/CustomBtnStyle.xaml"/>
  20. </ResourceDictionary.MergedDictionaries>
  21. <converter:BoolToVisible x:Key="BoolToVisibilityConverter" />
  22. <converter:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert"/>
  23. <Style x:Key="LabelSty"
  24. TargetType="{x:Type Label}">
  25. <Setter Property="Padding"
  26. Value="10,5" />
  27. <Setter Property="Background"
  28. Value="CadetBlue" />
  29. <Setter Property="Foreground"
  30. Value="White" />
  31. </Style>
  32. <DataTemplate x:Key="DataTemplate">
  33. <local:PDFToolItem x:Name="data"/>
  34. </DataTemplate>
  35. <DataTemplate x:Key="ExpendDataTemplate">
  36. <local:PDFToolExpendItem x:Name="Expendata"/>
  37. </DataTemplate>
  38. <ItemsPanelTemplate x:Key="ListItemsPanelTemplate">
  39. <WrapPanel AllowDrop="True"
  40. Orientation="Horizontal" />
  41. </ItemsPanelTemplate>
  42. </ResourceDictionary>
  43. </UserControl.Resources>
  44. <Grid x:Name="Grid" Margin="70,51,0,0">
  45. <Grid.RowDefinitions>
  46. <RowDefinition Height="auto" />
  47. <RowDefinition Height="auto" MinHeight="200" />
  48. <RowDefinition Height="auto" />
  49. <RowDefinition Height="*" />
  50. </Grid.RowDefinitions>
  51. <StackPanel AllowDrop="True"
  52. DragOver="ListBoxShortCuts_DragOver"
  53. Drop="ListBoxShortCuts_Drop"
  54. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  55. >
  56. <Grid>
  57. <TextBlock Text="PDF 工具" FontSize="16" FontFamily="PingFang SC"/>
  58. <Button HorizontalAlignment="Center" Background="Red" Content="清空缓存数据" ToolTip="还在优化中,如果工具排序错乱,或个数不对,可以点击此按钮,回到会设计图最初的布局" Click="Button_Click"/>
  59. <StackPanel
  60. x:Name="PnlToolsUIBtns" Grid.ColumnSpan="2"
  61. Grid.Column="0"
  62. Margin="0,0,12,0"
  63. HorizontalAlignment="Right"
  64. VerticalAlignment="Top"
  65. Orientation="Horizontal"
  66. Visibility="{Binding IsDropTools,Converter={StaticResource InvertBoolToVisibleConvert}}">
  67. <Button
  68. x:Name="BtnCustom" Tag="Custom"
  69. Width="68"
  70. Height="28"
  71. Margin="0,0,0,0"
  72. Background="#FFFFFF"
  73. Content="Custom"
  74. Command="{Binding CustomCommand}"
  75. CommandParameter="{Binding ElementName=BtnCustom,Path=Tag}"
  76. Click="BtnTools_Click"
  77. >
  78. </Button>
  79. <Button
  80. x:Name="BtnMore"
  81. Width="28"
  82. Height="28"
  83. Margin="12,0,0,0"
  84. Background="#FFFFFF" BorderThickness="0" Content="..."
  85. Command="{Binding OpenMenuCommand}" CommandParameter="{Binding ElementName=BtnMore}"
  86. >
  87. </Button>
  88. </StackPanel>
  89. <StackPanel
  90. x:Name="PnlDropToolsUIBtns" Grid.ColumnSpan="2"
  91. Grid.Column="0"
  92. Margin="0,0,12,0"
  93. HorizontalAlignment="Right"
  94. VerticalAlignment="Top"
  95. Orientation="Horizontal"
  96. Visibility="{Binding IsDropTools,Converter={StaticResource BoolToVisibilityConverter}}">
  97. <Button
  98. x:Name="BtnCancel" Tag="Cancel"
  99. Width="68"
  100. Height="28"
  101. Margin="0,0,0,0"
  102. Background="#FFFFFF"
  103. Content="Cancel"
  104. CommandParameter="{Binding ElementName=BtnCustom,Path=Tag}"
  105. Click="BtnTools_Click"
  106. >
  107. </Button>
  108. <Button Tag="Apply"
  109. x:Name="BtnApply"
  110. Width="28"
  111. Height="28"
  112. Margin="12,0,0,0"
  113. Background="#FFFFFF" BorderThickness="0" Content="Apply"
  114. Command="{Binding OpenMenuCommand}" CommandParameter="{Binding ElementName=BtnMore}"
  115. >
  116. </Button>
  117. </StackPanel>
  118. </Grid>
  119. <TextBlock Text="首页快捷工具" Margin="0,16,0,0" FontSize="14" FontFamily="PingFang SC"/>
  120. </StackPanel>
  121. <Label Name="label1" Visibility="Collapsed"
  122. Grid.Row="0"
  123. AllowDrop="True"
  124. Content="快捷工具"
  125. DragOver="ListBoxShortCuts_DragOver"
  126. Drop="ListBoxShortCuts_Drop"
  127. FontSize="20"
  128. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  129. Style="{StaticResource LabelSty}" />
  130. <customControl:ListBoxEx x:Name="ListShortCuts" HorizontalAlignment="Stretch" Margin="0,8,0,0" MinWidth="540"
  131. Grid.Row="1"
  132. AllowDrop="True"
  133. BorderThickness="0"
  134. SizeChanged="ListBoxShortCuts_SizeChanged"
  135. DragOver="ListBoxShortCuts_DragOver"
  136. Drop="ListBoxShortCuts_Drop"
  137. ItemContainerStyle="{StaticResource ListBoxItemStyle}"
  138. ItemTemplate="{StaticResource DataTemplate}"
  139. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  140. PreviewMouseMove="ListBoxShortCuts_PreviewMouseMove"
  141. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  142. SelectionMode="Extended"
  143. Visibility="{Binding IsExpendTools,Converter={StaticResource InvertBoolToVisibleConvert}}"
  144. />
  145. <customControl:ListBoxEx x:Name="ListShortCutsExpend" HorizontalAlignment="Stretch" Margin="0,8,0,0" MinWidth="540"
  146. Grid.Row="1"
  147. AllowDrop="True"
  148. BorderThickness="0"
  149. SizeChanged="ListBoxShortCuts_SizeChanged"
  150. DragOver="ListBoxShortCuts_DragOver"
  151. Drop="ListBoxShortCuts_Drop"
  152. ItemContainerStyle="{StaticResource ListBoxItemStyle}"
  153. ItemTemplate="{StaticResource ExpendDataTemplate}"
  154. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  155. PreviewMouseMove="ListBoxShortCuts_PreviewMouseMove"
  156. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  157. SelectionMode="Extended"
  158. Visibility="{Binding IsExpendTools,Converter={StaticResource BoolToVisibilityConverter}}"
  159. />
  160. <StackPanel Grid.Row="2" Margin="0,16,0,16" AllowDrop="True"
  161. DragOver="ListBoxShortCuts_DragOver"
  162. Drop="ListBoxShortCuts_Drop"
  163. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  164. >
  165. <TextBlock Text="更多工具" FontSize="14" FontFamily="PingFang SC"/>
  166. </StackPanel>
  167. <Label Grid.Row="2" Visibility="Collapsed"
  168. AllowDrop="True"
  169. Content="更多工具"
  170. DragOver="ListBoxShortCuts_DragOver"
  171. Drop="ListBoxShortCuts_Drop"
  172. FontSize="20"
  173. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  174. Style="{StaticResource LabelSty}" />
  175. <customControl:ListBoxEx x:Name="ListMoreCuts" HorizontalAlignment="Stretch" MinWidth="540"
  176. Grid.Row="3"
  177. AllowDrop="True"
  178. BorderThickness="0"
  179. SizeChanged="ListBoxMoreCuts_SizeChanged"
  180. DragOver="ListBoxShortCuts_DragOver"
  181. ItemContainerStyle="{StaticResource MoreListBoxItemStyle}"
  182. ItemTemplate="{StaticResource DataTemplate}"
  183. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  184. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  185. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  186. SelectionMode="Extended"
  187. Visibility="{Binding IsExpendTools,Converter={StaticResource InvertBoolToVisibleConvert}}"
  188. />
  189. <customControl:ListBoxEx x:Name="ListMoreCutsExpend" HorizontalAlignment="Stretch" MinWidth="540"
  190. Grid.Row="3"
  191. AllowDrop="True"
  192. BorderThickness="0"
  193. SizeChanged="ListBoxMoreCuts_SizeChanged"
  194. DragOver="ListBoxShortCuts_DragOver"
  195. ItemContainerStyle="{StaticResource MoreListBoxItemStyle}"
  196. ItemTemplate="{StaticResource ExpendDataTemplate}"
  197. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  198. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  199. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  200. SelectionMode="Extended"
  201. Visibility="{Binding IsExpendTools,Converter={StaticResource BoolToVisibilityConverter}}"
  202. />
  203. <Image x:Name="sourceImage"
  204. Grid.RowSpan="4"
  205. Width="260"
  206. Height="80"
  207. HorizontalAlignment="Left"
  208. VerticalAlignment="Top"
  209. AllowDrop="True"
  210. IsHitTestVisible="False" />
  211. <Grid>
  212. <Image x:Name="moveImage"
  213. Grid.RowSpan="4"
  214. Width="260"
  215. Height="80"
  216. HorizontalAlignment="Left"
  217. VerticalAlignment="Top"
  218. IsHitTestVisible="False"
  219. Visibility="Hidden">
  220. <Image.RenderTransform>
  221. <TranslateTransform x:Name="tt"
  222. X="0"
  223. Y="0" />
  224. </Image.RenderTransform>
  225. </Image>
  226. </Grid>
  227. </Grid>
  228. </UserControl>