QuickToolsContent.xaml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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:pDFTools="clr-namespace:PDF_Office.Views.HomePanel.PDFTools"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. Loaded="UserControl_Loaded"
  14. mc:Ignorable="d">
  15. <UserControl.Resources>
  16. <ResourceDictionary>
  17. <ResourceDictionary.MergedDictionaries>
  18. <ResourceDictionary Source="../../../Styles/CustomListItemStyle.xaml"/>
  19. </ResourceDictionary.MergedDictionaries>
  20. <converter:BoolToVisible x:Key="BoolToVisibilityConverter" />
  21. <Style x:Key="LabelSty"
  22. TargetType="{x:Type Label}">
  23. <Setter Property="Padding"
  24. Value="10,5" />
  25. <Setter Property="Background"
  26. Value="CadetBlue" />
  27. <Setter Property="Foreground"
  28. Value="White" />
  29. </Style>
  30. <DataTemplate x:Key="DataTemplate">
  31. <pDFTools:PDFToolItem x:Name="data"/>
  32. </DataTemplate>
  33. <ItemsPanelTemplate x:Key="ListItemsPanelTemplate">
  34. <WrapPanel AllowDrop="True"
  35. Orientation="Horizontal" />
  36. </ItemsPanelTemplate>
  37. <Style x:Key="QuickToolsListBoxItemStyle" BasedOn="{StaticResource ListBoxItemStyle}"
  38. TargetType="{x:Type customControl:ListItemQuickTool}">
  39. <EventSetter Event="PreviewMouseLeftButtonUp"
  40. Handler="QuickTools_Click"/>
  41. </Style>
  42. </ResourceDictionary>
  43. </UserControl.Resources>
  44. <Grid Grid.ColumnSpan="2" Margin="0,0,20,0">
  45. <Grid.RowDefinitions>
  46. <RowDefinition Height="Auto"/>
  47. <RowDefinition Height="*"/>
  48. </Grid.RowDefinitions>
  49. <TextBlock
  50. x:Name="TxbQuickToolsTitle"
  51. Margin="0,0,0,16"
  52. FontSize="24"
  53. FontWeight="SemiBold"
  54. Text="Quick Tools" />
  55. <StackPanel
  56. x:Name="PnlToolsUIBtns" Grid.ColumnSpan="2"
  57. Grid.Column="0"
  58. Margin="0,0,12,0"
  59. HorizontalAlignment="Right"
  60. VerticalAlignment="Top"
  61. Orientation="Horizontal"
  62. Visibility="Visible">
  63. <Button
  64. x:Name="BtnTools"
  65. Width="68"
  66. Height="28"
  67. Margin="0,0,0,0"
  68. Content="Tools"
  69. Click="BtnTools_Click"
  70. >
  71. </Button>
  72. <customControl:CustomIconToggleBtn x:Name="BtnExptend" Click="BtnExptend_Click"
  73. Style="{StaticResource ToggleBtnViewModeStyle}"
  74. >
  75. <TextBlock Text="展开"/>
  76. </customControl:CustomIconToggleBtn>
  77. <Button
  78. x:Name="BtnMore"
  79. Width="28"
  80. Height="28"
  81. Margin="12,0,0,0"
  82. Background="#FFFFFF" BorderThickness="0" Content="..."
  83. Click="BtnMore_Click"
  84. >
  85. </Button>
  86. </StackPanel>
  87. <Grid
  88. x:Name="GridAllTools"
  89. Grid.Row="1" Height="270"
  90. SizeChanged="GridAllTools_SizeChanged">
  91. <customControl:ListBoxEx x:Name="ListBoxToolBars" HorizontalAlignment="Stretch" MinWidth="540"
  92. Grid.Row="3"
  93. AllowDrop="True"
  94. BorderThickness="0" Background="Transparent"
  95. SizeChanged="ListBoxShortCuts_SizeChanged"
  96. ItemContainerStyle="{StaticResource QuickToolsListBoxItemStyle}"
  97. ItemTemplate="{StaticResource DataTemplate}"
  98. ItemsPanel="{StaticResource ListItemsPanelTemplate}"
  99. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  100. SelectionMode="Single" />
  101. </Grid>
  102. </Grid>
  103. </UserControl>