FeaturesListControl.xaml 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <UserControl x:Class="ComPDFKit.Controls.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.Controls.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.Resources>
  72. <Style TargetType="ListBoxItem">
  73. <Setter Property="HorizontalContentAlignment" Value="Center" />
  74. <Setter Property="VerticalContentAlignment" Value="Center" />
  75. </Style>
  76. </ListBox.Resources>
  77. <ListBox.ItemContainerStyle>
  78. <Style TargetType="ListBoxItem">
  79. <Setter Property="Margin" Value="{Binding ItemMargin}" />
  80. <Setter Property="HorizontalContentAlignment" Value="Center" />
  81. <Setter Property="VerticalContentAlignment" Value="Center" />
  82. <Setter Property="Template">
  83. <Setter.Value>
  84. <ControlTemplate TargetType="ListBoxItem">
  85. <ContentPresenter />
  86. </ControlTemplate>
  87. </Setter.Value>
  88. </Setter>
  89. </Style>
  90. </ListBox.ItemContainerStyle>
  91. <ListBox.ItemsPanel>
  92. <ItemsPanelTemplate>
  93. <WrapPanel Width="{Binding ElementName=FeaturesListBox, Path=ActualWidth}"></WrapPanel>
  94. </ItemsPanelTemplate>
  95. </ListBox.ItemsPanel>
  96. <ListBox.ItemTemplate>
  97. <DataTemplate>
  98. <Border Width="{Binding ItemWidth}" Height="{Binding ItemHeight}" Style="{StaticResource ItemBorderStyle}">
  99. <Grid Margin="16,20,16,0">
  100. <Grid.ColumnDefinitions>
  101. <ColumnDefinition Width="33"></ColumnDefinition>
  102. <ColumnDefinition></ColumnDefinition>
  103. </Grid.ColumnDefinitions>
  104. <ContentControl Grid.Column="0" Content="{Binding IconCanvas}" />
  105. <Grid Grid.Column="1">
  106. <Grid.RowDefinitions>
  107. <RowDefinition Height="auto"></RowDefinition>
  108. <RowDefinition></RowDefinition>
  109. </Grid.RowDefinitions>
  110. <TextBlock FontSize="14" Margin="0,0,0,5" Foreground="#1a1a1a" FontWeight="Bold" Text="{Binding TitleText}"/>
  111. <TextBlock Grid.Row="1" FontSize="12" Foreground="#666666" Text="{Binding DescriptionText}" TextWrapping="Wrap" TextTrimming="CharacterEllipsis"/>
  112. </Grid>
  113. </Grid>
  114. </Border>
  115. </DataTemplate>
  116. </ListBox.ItemTemplate>
  117. </ListBox>
  118. <Grid Grid.Row="1">
  119. <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
  120. <Button Name="PrePageBtn" Style="{StaticResource PageButtonStyle}" Height="40" Width="40" Click="PrePageBtn_Click">
  121. <Path Data="M5.79777 12L6.5 11.2733L1.40446 6L6.5 0.726727L5.79777 0L0 6L5.79777 12Z" Fill="#001A4E"></Path>
  122. </Button>
  123. <TextBlock Text="{Binding CurrentIndex}" FontFamily="Microsoft YaHei" VerticalAlignment="Center" FontWeight="DemiBold" FontSize="18" Margin="5,0,5,0"></TextBlock>
  124. <TextBlock Text="/" FontFamily="Microsoft YaHei" VerticalAlignment="Center" FontWeight="DemiBold" FontSize="18" ></TextBlock>
  125. <TextBlock Text="{Binding TotalIndex}" FontFamily="Microsoft YaHei" VerticalAlignment="Center" FontWeight="DemiBold" FontSize="18" Margin="5,0,5,0"></TextBlock>
  126. <Button x:Name="NextPageBtn" Style="{StaticResource PageButtonStyle}" Height="40" Width="40" Click="NextPageBtn_Click">
  127. <Path Data="M0.702232 12L0 11.2733L5.09554 6L0 0.726727L0.702232 0L6.5 6L0.702232 12Z" Fill="#001A4E"></Path>
  128. </Button>
  129. </StackPanel>
  130. </Grid>
  131. </Grid>
  132. </Grid>
  133. </UserControl>