FeaturesListControl.xaml 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <UserControl x:Class="Compdfkit_Tools.PDFControl.FeaturesListControl"
  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:Compdfkit_Tools.PDFControl"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800"
  9. Loaded="UserControl_Loaded"
  10. Unloaded="UserControl_Unloaded">
  11. <UserControl.Resources>
  12. <Style TargetType="Button" x:Key="PageButtonStyle">
  13. <Setter Property="Padding" Value="0"/>
  14. <Setter Property="BorderThickness" Value="0"/>
  15. <Setter Property="Margin" Value="0"/>
  16. <Setter Property="Template">
  17. <Setter.Value>
  18. <ControlTemplate TargetType="{x:Type Button}">
  19. <Border x:Name="border"
  20. Background="Transparent"
  21. BorderThickness="0"
  22. SnapsToDevicePixels="True"
  23. Height="{TemplateBinding Height}"
  24. Width="{TemplateBinding Width}">
  25. <ContentPresenter HorizontalAlignment="Center"
  26. VerticalAlignment="Center"
  27. Content="{TemplateBinding Content}"></ContentPresenter>
  28. </Border>
  29. <ControlTemplate.Triggers>
  30. <Trigger Property="IsMouseOver" Value="True">
  31. <Setter TargetName="border" Property="Background" Value="#1A000000"></Setter>
  32. </Trigger>
  33. <Trigger Property="IsPressed" Value="True">
  34. <Setter TargetName="border" Property="Background" Value="#2A000000"></Setter>
  35. </Trigger>
  36. </ControlTemplate.Triggers>
  37. </ControlTemplate>
  38. </Setter.Value>
  39. </Setter>
  40. </Style>
  41. <Style TargetType="ListBox" x:Key="WrapListBoxStyle">
  42. <Setter Property="BorderThickness" Value="0" />
  43. <Setter Property="BorderBrush" Value="Transparent" />
  44. <Setter Property="Background" Value="Transparent" />
  45. <Setter Property="Padding" Value="0" />
  46. </Style>
  47. <Style x:Key="ItemBorderStyle" TargetType="Border">
  48. <Setter Property="CornerRadius" Value="5" />
  49. <Setter Property="BorderThickness" Value="1" />
  50. <Setter Property="BorderBrush" Value="Transparent"></Setter>
  51. <Setter Property="Background" Value="#ffffff"></Setter>
  52. <Style.Triggers>
  53. <Trigger Property="IsMouseOver" Value="True">
  54. <Setter Property="BorderBrush" Value="#6495ed"></Setter>
  55. </Trigger>
  56. </Style.Triggers>
  57. </Style>
  58. </UserControl.Resources>
  59. <Grid Margin="0, 0, 0,0">
  60. <Grid.RowDefinitions>
  61. <RowDefinition Height="40"></RowDefinition>
  62. <RowDefinition></RowDefinition>
  63. </Grid.RowDefinitions>
  64. <TextBlock x:Name="FeaturesListTxb" Foreground="#001A4E" FontFamily="Microsoft YaHei" FontSize="24" LineHeight="32" FontWeight="Medium"></TextBlock>
  65. <Grid x:Name="ListGd" Grid.Row="1" SizeChanged="ListGd_SizeChanged">
  66. <Grid.RowDefinitions>
  67. <RowDefinition></RowDefinition>
  68. <RowDefinition Height="auto"></RowDefinition>
  69. </Grid.RowDefinitions>
  70. <ListBox x:Name="FeaturesListBox" Style="{StaticResource WrapListBoxStyle}" ItemsSource="{Binding PageItems}" ScrollViewer.HorizontalScrollBarVisibility="Disabled" SelectionMode="Single" >
  71. <ListBox.ItemContainerStyle>
  72. <Style TargetType="ListBoxItem">
  73. <Setter Property="Margin" Value="{Binding ItemMargin}" />
  74. <Setter Property="Template">
  75. <Setter.Value>
  76. <ControlTemplate TargetType="ListBoxItem">
  77. <ContentPresenter />
  78. </ControlTemplate>
  79. </Setter.Value>
  80. </Setter>
  81. </Style>
  82. </ListBox.ItemContainerStyle>
  83. <ListBox.ItemsPanel>
  84. <ItemsPanelTemplate>
  85. <WrapPanel Width="{Binding ElementName=FeaturesListBox, Path=ActualWidth}"></WrapPanel>
  86. </ItemsPanelTemplate>
  87. </ListBox.ItemsPanel>
  88. <ListBox.ItemTemplate>
  89. <DataTemplate>
  90. <Border Width="{Binding ItemWidth}" Height="{Binding ItemHeight}" Style="{StaticResource ItemBorderStyle}">
  91. <Grid Margin="16,20,16,0">
  92. <Grid.ColumnDefinitions>
  93. <ColumnDefinition Width="33"></ColumnDefinition>
  94. <ColumnDefinition></ColumnDefinition>
  95. </Grid.ColumnDefinitions>
  96. <ContentControl Grid.Column="0" Content="{Binding IconCanvas}" />
  97. <Grid Grid.Column="1">
  98. <Grid.RowDefinitions>
  99. <RowDefinition Height="auto"></RowDefinition>
  100. <RowDefinition></RowDefinition>
  101. </Grid.RowDefinitions>
  102. <TextBlock FontSize="14" Margin="0,0,0,5" Foreground="#1a1a1a" FontWeight="Bold" Text="{Binding TitleText}"/>
  103. <TextBlock Grid.Row="1" FontSize="12" Foreground="#666666" Text="{Binding DescriptionText}" TextWrapping="Wrap" TextTrimming="CharacterEllipsis"/>
  104. </Grid>
  105. </Grid>
  106. </Border>
  107. </DataTemplate>
  108. </ListBox.ItemTemplate>
  109. </ListBox>
  110. <Grid Grid.Row="1">
  111. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  112. <Button Name="PrePageBtn" Style="{StaticResource PageButtonStyle}" Height="40" Width="40" Click="PrePageBtn_Click">
  113. <Path Data="M5.79777 12L6.5 11.2733L1.40446 6L6.5 0.726727L5.79777 0L0 6L5.79777 12Z" Fill="#001A4E"></Path>
  114. </Button>
  115. <TextBlock Text="{Binding CurrentIndex}" FontFamily="Microsoft YaHei" VerticalAlignment="Center" FontWeight="DemiBold" FontSize="18" Margin="5,0,5,0"></TextBlock>
  116. <TextBlock Text="/" FontFamily="Microsoft YaHei" VerticalAlignment="Center" FontWeight="DemiBold" FontSize="18" ></TextBlock>
  117. <TextBlock Text="{Binding TotalIndex}" FontFamily="Microsoft YaHei" VerticalAlignment="Center" FontWeight="DemiBold" FontSize="18" Margin="5,0,5,0"></TextBlock>
  118. <Button x:Name="NextPageBtn" Style="{StaticResource PageButtonStyle}" Height="40" Width="40" Click="NextPageBtn_Click">
  119. <Path Data="M0.702232 12L0 11.2733L5.09554 6L0 0.726727L0.702232 0L6.5 6L0.702232 12Z" Fill="#001A4E"></Path>
  120. </Button>
  121. </StackPanel>
  122. </Grid>
  123. </Grid>
  124. </Grid>
  125. </UserControl>