PromotionContent.xaml 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <UserControl
  2. x:Class="PDF_Master.Views.HomePanel.PromotionContent"
  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_Master.Views.HomePanel"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. d:DesignHeight="450"
  9. d:DesignWidth="800"
  10. Background="{StaticResource color.sys.layout.mg}"
  11. SizeChanged="UserControl_SizeChanged"
  12. mc:Ignorable="d">
  13. <UserControl.Resources>
  14. <ResourceDictionary>
  15. <ResourceDictionary.MergedDictionaries>
  16. <ResourceDictionary Source="../../Styles/ListViewStyle.xaml" />
  17. <ResourceDictionary Source="../../Styles/ExpanderStyle.xaml" />
  18. </ResourceDictionary.MergedDictionaries>
  19. <DataTemplate x:Key="PromotionDataTemplate">
  20. <StackPanel
  21. Height="32"
  22. Background="Transparent"
  23. Cursor="Hand"
  24. Orientation="Horizontal">
  25. <Image
  26. Width="16"
  27. Height="16"
  28. Margin="0,0,10,0"
  29. Source="{Binding ImagePath}"
  30. RenderOptions.BitmapScalingMode="HighQuality"
  31. UseLayoutRounding="True"/>
  32. <TextBlock
  33. VerticalAlignment="Center"
  34. FontSize="14"
  35. Foreground="{StaticResource color.sys.text.neutral.lv2}"
  36. Text="{Binding Content}" />
  37. </StackPanel>
  38. </DataTemplate>
  39. </ResourceDictionary>
  40. </UserControl.Resources>
  41. <ScrollViewer VerticalScrollBarVisibility="Auto">
  42. <Grid>
  43. <Grid.RowDefinitions>
  44. <RowDefinition Height="*" />
  45. <RowDefinition Height="auto" />
  46. </Grid.RowDefinitions>
  47. <StackPanel>
  48. <Expander
  49. x:Name="PDFProSeriesExpander"
  50. Margin="20,20,0,0"
  51. IsExpanded="True"
  52. Style="{StaticResource PromotionExpanderStyle}">
  53. <Expander.Header>
  54. <Grid
  55. Name="GridHeader"
  56. Height="32"
  57. HorizontalAlignment="Center">
  58. <TextBlock VerticalAlignment="Center" Text="PDF Pro Series" />
  59. </Grid>
  60. </Expander.Header>
  61. <Border CornerRadius="4">
  62. <Grid Name="GroupPDFProSeries">
  63. <ListView
  64. x:Name="PDFProListview"
  65. MinWidth="0"
  66. HorizontalAlignment="Stretch"
  67. Background="Transparent"
  68. BorderThickness="0"
  69. ItemTemplate="{StaticResource PromotionDataTemplate}">
  70. <ListView.ItemContainerStyle>
  71. <Style BasedOn="{StaticResource EmptyListViewItem}" TargetType="{x:Type ListViewItem}">
  72. <Style.Triggers>
  73. <Trigger Property="IsMouseOver" Value="True">
  74. <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  75. </Trigger>
  76. </Style.Triggers>
  77. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="FrameworkElement_PreviewMouseLeftButtonDown" />
  78. <Setter Property="AllowDrop" Value="True" />
  79. </Style>
  80. </ListView.ItemContainerStyle>
  81. </ListView>
  82. </Grid>
  83. </Border>
  84. </Expander>
  85. <Expander
  86. x:Name="OthersExpander"
  87. Margin="20,8,0,0"
  88. IsExpanded="True"
  89. Style="{StaticResource PromotionExpanderStyle}">
  90. <Expander.Header>
  91. <Grid
  92. Name="GridHeaderOthers"
  93. Height="32"
  94. HorizontalAlignment="Center">
  95. <TextBlock VerticalAlignment="Center" Text="Others" />
  96. </Grid>
  97. </Expander.Header>
  98. <Border CornerRadius="4">
  99. <Grid Name="GridGroupOthers">
  100. <ListView
  101. x:Name="OthersListview"
  102. MinWidth="0"
  103. HorizontalAlignment="Stretch"
  104. Background="Transparent"
  105. BorderThickness="0"
  106. ItemTemplate="{StaticResource PromotionDataTemplate}">
  107. <ListView.ItemContainerStyle>
  108. <Style BasedOn="{StaticResource EmptyListViewItem}" TargetType="{x:Type ListViewItem}">
  109. <Style.Triggers>
  110. <Trigger Property="IsMouseOver" Value="True">
  111. <Setter Property="Background" Value="{StaticResource color.item-state.hov.bg}" />
  112. </Trigger>
  113. </Style.Triggers>
  114. <EventSetter Event="PreviewMouseLeftButtonDown" Handler="FrameworkElement_PreviewMouseLeftButtonDown" />
  115. <Setter Property="AllowDrop" Value="True" />
  116. </Style>
  117. </ListView.ItemContainerStyle>
  118. </ListView>
  119. </Grid>
  120. </Border>
  121. </Expander>
  122. </StackPanel>
  123. <Image
  124. x:Name="ImgeActivity"
  125. Grid.Row="1"
  126. Width="184"
  127. Height="243"
  128. Margin="0,30"
  129. VerticalAlignment="Bottom"
  130. PreviewMouseLeftButtonDown="ImgeActivity_PreviewMouseLeftButtonDown" />
  131. </Grid>
  132. </ScrollViewer>
  133. </UserControl>