QuickToolsContent.xaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <UserControl
  2. x:Class="PDF_Master.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:controls="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel"
  6. xmlns:converter="clr-namespace:PDF_Master.DataConvert"
  7. xmlns:customControl="clr-namespace:PDF_Master.CustomControl"
  8. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  9. xmlns:local="clr-namespace:PDF_Master.Views.HomePanel"
  10. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  11. xmlns:pDFTools="clr-namespace:PDF_Master.Views.HomePanel.PDFTools"
  12. xmlns:pdftools="clr-namespace:PDF_Master.ViewModels.HomePanel.PDFTools"
  13. xmlns:prism="http://prismlibrary.com/"
  14. d:DataContext="{d:DesignInstance Type=pdftools:QuickToolsContentViewModel}"
  15. d:DesignWidth="800"
  16. prism:ViewModelLocator.AutoWireViewModel="True"
  17. Loaded="UserControl_Loaded"
  18. mc:Ignorable="d">
  19. <UserControl.Resources>
  20. <ResourceDictionary>
  21. <ResourceDictionary.MergedDictionaries>
  22. <ResourceDictionary Source="../../../Styles/CustomListItemStyle.xaml" />
  23. </ResourceDictionary.MergedDictionaries>
  24. <converter:BoolToVisible x:Key="BoolToVisibilityConverter" />
  25. <converter:InvertBoolToVisibleConvert x:Key="InvertBoolToVisibleConvert" />
  26. <Style x:Key="LabelSty" TargetType="{x:Type Label}">
  27. <Setter Property="Padding" Value="10,5" />
  28. <Setter Property="Background" Value="CadetBlue" />
  29. <Setter Property="Foreground" Value="White" />
  30. </Style>
  31. <DataTemplate x:Key="DataTemplate">
  32. <pDFTools:PDFToolItem x:Name="data" Cursor="Hand" />
  33. </DataTemplate>
  34. <DataTemplate x:Key="ExpendDataTemplate">
  35. <pDFTools:PDFToolExpendItem x:Name="Expenddata" Cursor="Hand" />
  36. </DataTemplate>
  37. <ItemsPanelTemplate x:Key="ListItemsPanelTemplate">
  38. <WrapPanel />
  39. </ItemsPanelTemplate>
  40. <Style
  41. x:Key="QuickToolsListBoxItemStyle"
  42. BasedOn="{StaticResource ListBoxItemStyle}"
  43. TargetType="{x:Type customControl:ListItemQuickTool}">
  44. <EventSetter Event="PreviewMouseLeftButtonUp" Handler="QuickTools_Click" />
  45. <Setter Property="Width" Value="223" />
  46. <Setter Property="Margin" Value="8,0" />
  47. </Style>
  48. </ResourceDictionary>
  49. </UserControl.Resources>
  50. <Grid Grid.ColumnSpan="2">
  51. <Grid.RowDefinitions>
  52. <RowDefinition Height="32" />
  53. <RowDefinition Height="*" />
  54. </Grid.RowDefinitions>
  55. <TextBlock
  56. x:Name="TxbQuickToolsTitle"
  57. Margin="0,2"
  58. FontFamily="Segoe UI"
  59. FontSize="20"
  60. FontWeight="SemiBold"
  61. LineHeight="28"
  62. Text="{Binding T_Title}" />
  63. <StackPanel
  64. x:Name="PnlToolsUIBtns"
  65. Grid.Column="0"
  66. Grid.ColumnSpan="2"
  67. HorizontalAlignment="Right"
  68. VerticalAlignment="Center"
  69. Orientation="Horizontal"
  70. Visibility="Visible">
  71. <Button
  72. x:Name="BtnTools"
  73. Width="68"
  74. Height="28"
  75. Command="{Binding ShowToolCommand}"
  76. Content="Tools"
  77. Visibility="Collapsed" />
  78. <Button
  79. x:Name="BtnMore"
  80. Width="32"
  81. Height="32"
  82. Command="{Binding OpenMenuCommand}"
  83. CommandParameter="{Binding ElementName=BtnMore}"
  84. Style="{StaticResource btn.sec}">
  85. <Path
  86. Width="32"
  87. Height="32"
  88. HorizontalAlignment="Center"
  89. VerticalAlignment="Center"
  90. Data="M12 16C12 16.8284 11.3284 17.5 10.5 17.5C9.67157 17.5 9 16.8284 9 16C9 15.1716 9.67157 14.5 10.5 14.5C11.3284 14.5 12 15.1716 12 16ZM17.3999 16C17.3999 16.8284 16.7283 17.5 15.8999 17.5C15.0715 17.5 14.3999 16.8284 14.3999 16C14.3999 15.1716 15.0715 14.5 15.8999 14.5C16.7283 14.5 17.3999 15.1716 17.3999 16ZM21.5 17.5C22.3284 17.5 23 16.8284 23 16C23 15.1716 22.3284 14.5 21.5 14.5C20.6716 14.5 20 15.1716 20 16C20 16.8284 20.6716 17.5 21.5 17.5Z"
  91. Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
  92. </Button>
  93. </StackPanel>
  94. <Grid
  95. x:Name="GridAllTools"
  96. Grid.Row="1"
  97. Height="152"
  98. Margin="0,16,0,0"
  99. SizeChanged="GridAllTools_SizeChanged">
  100. <customControl:ListBoxEx
  101. x:Name="ListBoxExpendToolBars"
  102. Grid.Row="3"
  103. MinWidth="200"
  104. Padding="-8,0,-8,0"
  105. HorizontalAlignment="Stretch"
  106. AllowDrop="True"
  107. Background="Transparent"
  108. BorderThickness="0"
  109. ItemContainerStyle="{StaticResource QuickToolsListBoxItemStyle}"
  110. ItemTemplate="{StaticResource ExpendDataTemplate}"
  111. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  112. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  113. ScrollViewer.VerticalScrollBarVisibility="Auto"
  114. SelectionMode="Single"
  115. Visibility="{Binding IsExpendTools, Converter={StaticResource BoolToVisibilityConverter}}" />
  116. <customControl:ListBoxEx
  117. x:Name="ListBoxToolBars"
  118. Grid.Row="3"
  119. MinWidth="200"
  120. Padding="-8,0,-8,0"
  121. AllowDrop="True"
  122. Background="Transparent"
  123. BorderThickness="0"
  124. ItemContainerStyle="{StaticResource QuickToolsListBoxItemStyle}"
  125. ItemTemplate="{StaticResource DataTemplate}"
  126. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  127. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  128. ScrollViewer.VerticalScrollBarVisibility="Auto"
  129. SelectionMode="Single"
  130. Visibility="{Binding IsExpendTools, Converter={StaticResource InvertBoolToVisibleConvert}}" />
  131. </Grid>
  132. </Grid>
  133. </UserControl>