RecentFilesControl.xaml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <UserControl x:Class="ComPDFKit.Controls.PDFControl.RecentFilesControl"
  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. xmlns:common="clr-namespace:ComPDFKit.Controls.Common"
  8. mc:Ignorable="d"
  9. d:DesignHeight="450" d:DesignWidth="800">
  10. <UserControl.Resources>
  11. <Style TargetType="ListBox" x:Key="HistoryListBoxStyle">
  12. <Setter Property="BorderThickness" Value="0" />
  13. <Setter Property="BorderBrush" Value="Transparent" />
  14. <Setter Property="Padding" Value="0" />
  15. </Style>
  16. <DrawingImage x:Key="FileIcon">
  17. <DrawingImage.Drawing>
  18. <DrawingGroup>
  19. <GeometryDrawing Brush="#FFFF494F">
  20. <GeometryDrawing.Geometry>
  21. <PathGeometry FillRule="EvenOdd" Figures="M0,2.5C0,1.3954,0.8954,0.5,2,0.5L15.3431,0.5C16.404,0.5,17.4214,0.9214,18.1716,1.6716L24.8284,8.3284C25.5786,9.0786,26,10.096,26,11.1569L26,30.5C26,31.6046,25.1046,32.5,24,32.5L2,32.5C0.8954,32.5,0,31.6046,0,30.5L0,2.5z" />
  22. </GeometryDrawing.Geometry>
  23. </GeometryDrawing>
  24. <DrawingGroup>
  25. <GeometryDrawing>
  26. <GeometryDrawing.Brush>
  27. <SolidColorBrush Color="#FFFFFFFF" Opacity="0.3" />
  28. </GeometryDrawing.Brush>
  29. <GeometryDrawing.Geometry>
  30. <PathGeometry FillRule="EvenOdd" Figures="M21,5.5L12,5.5 12,10.5 21,10.5 21,5.5z M5,9L10,9 10,10.5 5,10.5 5,9z M5,12.5L21,12.5 21,14 5,14 5,12.5z M5,5.5L10,5.5 10,7 5,7 5,5.5z M21,16L5,16 5,17.5 21,17.5 21,16z" />
  31. </GeometryDrawing.Geometry>
  32. </GeometryDrawing>
  33. <GeometryDrawing Brush="#FFFFFFFF">
  34. <GeometryDrawing.Geometry>
  35. <PathGeometry FillRule="EvenOdd" Figures="M18.6035,23.0586L18.6035,26.5 17.4629,26.5 17.4629,23.0586 16.7676,23.0586 16.7676,22.1992 17.4629,22.1992 17.4629,21.7969C17.4629,20.9414 17.9004,20.5117 18.9395,20.5117 19.1699,20.5117 19.3613,20.5312 19.5254,20.5547L19.5254,21.3164C19.4551,21.3047 19.334,21.293 19.1855,21.293 18.7441,21.293 18.5801,21.5 18.5801,21.875L18.5801,22.1992 19.4902,22.1992 19.4902,23.0586 18.6035,23.0586z M14.7402,25.832C14.5176,26.2969 14.0605,26.5664 13.4551,26.5664 12.3809,26.5664 11.709,25.7266 11.709,24.3516L11.709,24.3438C11.709,22.9609 12.3652,22.1289 13.4551,22.1289 14.0449,22.1289 14.5254,22.418 14.7402,22.8867L14.8105,22.8867 14.8105,20.5547 15.9512,20.5547 15.9512,26.5 14.8105,26.5 14.8105,25.832 14.7402,25.832z M7.8848,27.9258L7.8848,25.8125 7.9551,25.8125C8.1738,26.2812 8.6543,26.5664 9.2441,26.5664 10.334,26.5664 10.9902,25.7344 10.9902,24.3516L10.9902,24.3438C10.9902,22.9727 10.3184,22.1289 9.2441,22.1289 8.6348,22.1289 8.1777,22.4023 7.9551,22.8633L7.8848,22.8633 7.8848,22.1992 6.7441,22.1992 6.7441,27.9258 7.8848,27.9258z M8.8535,25.6211C8.2559,25.6211,7.8731,25.1406,7.8731,24.3516L7.8731,24.3438C7.8731,23.5547 8.252,23.0742 8.8535,23.0742 9.459,23.0742 9.8301,23.5547 9.8301,24.3438L9.8301,24.3516C9.8301,25.1406,9.4551,25.6211,8.8535,25.6211z M13.8418,25.6211C13.2402,25.6211,12.8691,25.1445,12.8691,24.3516L12.8691,24.3438C12.8691,23.5586 13.2402,23.0742 13.8418,23.0742 14.4434,23.0742 14.8223,23.5586 14.8223,24.3477L14.8223,24.3555C14.8223,25.1445,14.4473,25.6211,13.8418,25.6211z" />
  36. </GeometryDrawing.Geometry>
  37. </GeometryDrawing>
  38. <DrawingGroup>
  39. <GeometryDrawing Brush="#FFFFB1B4">
  40. <GeometryDrawing.Geometry>
  41. <PathGeometry FillRule="EvenOdd" Figures="M17,0.5L26,9.5 19,9.5C17.8954,9.5,17,8.6046,17,7.5L17,0.5z" />
  42. </GeometryDrawing.Geometry>
  43. </GeometryDrawing>
  44. </DrawingGroup>
  45. </DrawingGroup>
  46. </DrawingGroup>
  47. </DrawingImage.Drawing>
  48. </DrawingImage>
  49. <Style x:Key="ItemContainerStyle" TargetType="ListViewItem">
  50. <EventSetter Event="MouseDoubleClick" Handler="ListViewItem_DoubleClick"></EventSetter>
  51. <Setter Property="HorizontalAlignment" Value="Stretch" />
  52. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  53. <Setter Property="Template">
  54. <Setter.Value>
  55. <ControlTemplate TargetType="ListViewItem">
  56. <Grid>
  57. <Border x:Name="Bd"
  58. Background="Transparent"
  59. BorderBrush="{TemplateBinding BorderBrush}"
  60. BorderThickness="{TemplateBinding BorderThickness}">
  61. <ContentPresenter/>
  62. </Border>
  63. </Grid>
  64. <ControlTemplate.Triggers>
  65. <MultiTrigger>
  66. <MultiTrigger.Conditions>
  67. <Condition Property="IsMouseOver" Value="True"/>
  68. <Condition Property="IsSelected" Value="False"/>
  69. </MultiTrigger.Conditions>
  70. <Setter TargetName="Bd" Property="Background" Value="#D3D5D9"/>
  71. </MultiTrigger>
  72. <Trigger Property="IsSelected" Value="True">
  73. <Setter TargetName="Bd" Property="Background" Value="#2A365DDB"/>
  74. </Trigger>
  75. </ControlTemplate.Triggers>
  76. </ControlTemplate>
  77. </Setter.Value>
  78. </Setter>
  79. </Style>
  80. <common:CommonResourceConverter x:Key="CommonResourceConverter" />
  81. </UserControl.Resources>
  82. <Grid Margin="0,0,20,0" Background="Transparent">
  83. <Grid.RowDefinitions>
  84. <RowDefinition Height="Auto"/>
  85. <RowDefinition Height="*"/>
  86. </Grid.RowDefinitions>
  87. <TextBlock Text="{Binding Converter={StaticResource CommonResourceConverter},ConverterParameter=Title_QuickStart}" Background="Transparent" Margin="0,0,0,25" Height="32" FontFamily="Microsoft YaHei" FontSize="24" LineHeight="32" Foreground="#001A4E" FontWeight="DemiBold"></TextBlock>
  88. <ListView Grid.Row="1" x:Name="HistoryListView" MinWidth="380"
  89. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  90. Style="{StaticResource HistoryListBoxStyle}" ItemsSource="{Binding History}"
  91. ItemContainerStyle="{StaticResource ItemContainerStyle}"
  92. d:ItemsSource="{d:SampleData ItemCount=10}" SelectionMode="Single"
  93. Background="Transparent"
  94. VirtualizingPanel.CacheLength="1"
  95. VirtualizingPanel.CacheLengthUnit="Page"
  96. VirtualizingPanel.IsVirtualizing="True"
  97. VirtualizingPanel.ScrollUnit="Pixel"
  98. VirtualizingPanel.VirtualizationMode="Standard">
  99. <ListView.ItemTemplate>
  100. <DataTemplate>
  101. <Grid Margin="0,0,20,0">
  102. <Grid.ColumnDefinitions>
  103. <ColumnDefinition Width="Auto" />
  104. <ColumnDefinition Width="4*" />
  105. <ColumnDefinition Width="2*" />
  106. <ColumnDefinition Width="*" />
  107. </Grid.ColumnDefinitions>
  108. <Image Grid.Column="0" Width="20" Height="20" Source="{StaticResource FileIcon}"/>
  109. <StackPanel Grid.Column="1" Orientation="Vertical" Margin="5">
  110. <TextBlock Text="{Binding FileName}" TextTrimming="CharacterEllipsis" Foreground="#001A4E" FontFamily="SF Pro" FontSize="16" LineHeight="21"/>
  111. <TextBlock Text="{Binding FilePath}" TextTrimming="CharacterEllipsis" Foreground="#666" FontFamily="Microsoft YaHei" FontSize="12" LineHeight="16"/>
  112. </StackPanel>
  113. <TextBlock Visibility="Hidden" Grid.Column="2" Margin="20,0,0,0" VerticalAlignment="Center" Text="{Binding OpenDate}" TextTrimming="CharacterEllipsis" Foreground="#666" FontFamily="Microsoft YaHei" FontSize="14" LineHeight="20"/>
  114. <TextBlock Grid.Column="3" Margin="20,0,0,0" VerticalAlignment="Center" Text="{Binding FileSize}" TextTrimming="CharacterEllipsis" Foreground="#666" FontFamily="Microsoft YaHei" FontSize="14" LineHeight="20"/>
  115. </Grid>
  116. </DataTemplate>
  117. </ListView.ItemTemplate>
  118. </ListView>
  119. </Grid>
  120. </UserControl>