PDFToolsContent.xaml 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <UserControl x:Class="PDF_Office.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_Office.Views.HomePanel.PDFTools"
  7. xmlns:customControl="clr-namespace:PDF_Office.CustomControl"
  8. xmlns:converter="clr-namespace:PDF_Office.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. <StackPanel
  59. x:Name="PnlToolsUIBtns" Grid.ColumnSpan="2"
  60. Grid.Column="0"
  61. Margin="0,0,12,0"
  62. HorizontalAlignment="Right"
  63. VerticalAlignment="Top"
  64. Orientation="Horizontal"
  65. Visibility="Visible">
  66. <Button
  67. x:Name="BtnCustom"
  68. Width="68"
  69. Height="28"
  70. Margin="0,0,0,0"
  71. Background="#FFFFFF"
  72. Content="Custom"
  73. Click="BtnTools_Click"
  74. >
  75. </Button>
  76. <Button
  77. x:Name="BtnMore"
  78. Width="28"
  79. Height="28"
  80. Margin="12,0,0,0"
  81. Background="#FFFFFF" BorderThickness="0" Content="..."
  82. Command="{Binding OpenMenuCommand}" CommandParameter="{Binding ElementName=BtnMore}"
  83. >
  84. </Button>
  85. </StackPanel>
  86. </Grid>
  87. <TextBlock Text="首页快捷工具" Margin="0,16,0,0" FontSize="14" FontFamily="PingFang SC"/>
  88. </StackPanel>
  89. <Label Name="label1" Visibility="Collapsed"
  90. Grid.Row="0"
  91. AllowDrop="True"
  92. Content="快捷工具"
  93. DragOver="ListBoxShortCuts_DragOver"
  94. Drop="ListBoxShortCuts_Drop"
  95. FontSize="20"
  96. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  97. Style="{StaticResource LabelSty}" />
  98. <customControl:ListBoxEx x:Name="ListShortCuts" HorizontalAlignment="Stretch" Margin="0,8,0,0" MinWidth="540"
  99. Grid.Row="1"
  100. AllowDrop="True"
  101. BorderThickness="0"
  102. SizeChanged="ListBoxShortCuts_SizeChanged"
  103. DragOver="ListBoxShortCuts_DragOver"
  104. Drop="ListBoxShortCuts_Drop"
  105. ItemContainerStyle="{StaticResource ListBoxItemStyle}"
  106. ItemTemplate="{StaticResource DataTemplate}"
  107. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  108. PreviewMouseMove="ListBoxShortCuts_PreviewMouseMove"
  109. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  110. SelectionMode="Extended"
  111. Visibility="{Binding IsExpendTools,Converter={StaticResource InvertBoolToVisibleConvert}}"
  112. />
  113. <customControl:ListBoxEx x:Name="ListShortCutsExpend" HorizontalAlignment="Stretch" Margin="0,8,0,0" MinWidth="540"
  114. Grid.Row="1"
  115. AllowDrop="True"
  116. BorderThickness="0"
  117. SizeChanged="ListBoxShortCuts_SizeChanged"
  118. DragOver="ListBoxShortCuts_DragOver"
  119. Drop="ListBoxShortCuts_Drop"
  120. ItemContainerStyle="{StaticResource ListBoxItemStyle}"
  121. ItemTemplate="{StaticResource ExpendDataTemplate}"
  122. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  123. PreviewMouseMove="ListBoxShortCuts_PreviewMouseMove"
  124. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  125. SelectionMode="Extended"
  126. Visibility="{Binding IsExpendTools,Converter={StaticResource BoolToVisibilityConverter}}"
  127. />
  128. <StackPanel Grid.Row="2" Margin="0,16,0,16" AllowDrop="True"
  129. DragOver="ListBoxShortCuts_DragOver"
  130. Drop="ListBoxShortCuts_Drop"
  131. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  132. >
  133. <TextBlock Text="更多工具" FontSize="14" FontFamily="PingFang SC"/>
  134. </StackPanel>
  135. <Label Grid.Row="2" Visibility="Collapsed"
  136. AllowDrop="True"
  137. Content="更多工具"
  138. DragOver="ListBoxShortCuts_DragOver"
  139. Drop="ListBoxShortCuts_Drop"
  140. FontSize="20"
  141. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  142. Style="{StaticResource LabelSty}" />
  143. <customControl:ListBoxEx x:Name="ListMoreCuts" HorizontalAlignment="Stretch" MinWidth="540"
  144. Grid.Row="3"
  145. AllowDrop="True"
  146. BorderThickness="0"
  147. SizeChanged="ListBoxMoreCuts_SizeChanged"
  148. DragOver="ListBoxShortCuts_DragOver"
  149. ItemContainerStyle="{StaticResource MoreListBoxItemStyle}"
  150. ItemTemplate="{StaticResource DataTemplate}"
  151. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  152. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  153. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  154. SelectionMode="Extended"
  155. Visibility="{Binding IsExpendTools,Converter={StaticResource InvertBoolToVisibleConvert}}"
  156. />
  157. <customControl:ListBoxEx x:Name="ListMoreCutsExpend" HorizontalAlignment="Stretch" MinWidth="540"
  158. Grid.Row="3"
  159. AllowDrop="True"
  160. BorderThickness="0"
  161. SizeChanged="ListBoxMoreCuts_SizeChanged"
  162. DragOver="ListBoxShortCuts_DragOver"
  163. ItemContainerStyle="{StaticResource MoreListBoxItemStyle}"
  164. ItemTemplate="{StaticResource ExpendDataTemplate}"
  165. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  166. PreviewMouseMove="ListBoxMoreCuts_PreviewMouseMove"
  167. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  168. SelectionMode="Extended"
  169. Visibility="{Binding IsExpendTools,Converter={StaticResource BoolToVisibilityConverter}}"
  170. />
  171. <Image x:Name="sourceImage"
  172. Grid.RowSpan="4"
  173. Width="260"
  174. Height="80"
  175. HorizontalAlignment="Left"
  176. VerticalAlignment="Top"
  177. AllowDrop="True"
  178. IsHitTestVisible="False" />
  179. <Grid>
  180. <Image x:Name="moveImage"
  181. Grid.RowSpan="4"
  182. Width="260"
  183. Height="80"
  184. HorizontalAlignment="Left"
  185. VerticalAlignment="Top"
  186. IsHitTestVisible="False"
  187. Visibility="Hidden">
  188. <Image.RenderTransform>
  189. <TranslateTransform x:Name="tt"
  190. X="0"
  191. Y="0" />
  192. </Image.RenderTransform>
  193. </Image>
  194. </Grid>
  195. </Grid>
  196. </UserControl>