DocItemListViewControl.xaml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191
  1. <UserControl
  2. x:Class="PDF_Office.Views.HomePanel.RecentFiles.DocItemListViewControl"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:convert="clr-namespace:PDF_Office.DataConvert"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:PDF_Office.Views.HomePanel"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. x:Name="usercontrol"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. MouseEnter="UserControl_MouseEnter"
  13. MouseLeave="UserControl_MouseLeave"
  14. MouseMove="UserControl_MouseMove"
  15. mc:Ignorable="d">
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. <ResourceDictionary Source="../../../Styles/ButtonStyle.xaml" />
  20. </ResourceDictionary.MergedDictionaries>
  21. <convert:BoolToVisible x:Key="BoolToVisibleConvert" />
  22. <convert:DateTimeToStringConvert x:Key="DateTimeToStringConvert" />
  23. <convert:FilePathToSizeConvert x:Key="FilePathToSizeConvert" />
  24. <convert:RecentFileDateTimeToStringConvert x:Key="RecentFileDateTimeToStringConvert" />
  25. </ResourceDictionary>
  26. </UserControl.Resources>
  27. <Grid
  28. Height="72"
  29. HorizontalAlignment="Stretch"
  30. DataContext="{Binding}"
  31. Loaded="Grid_Loaded"
  32. ToolTip="{Binding FilePath}">
  33. <Grid.Background>
  34. <SolidColorBrush Opacity="0.01" Color="White" />
  35. </Grid.Background>
  36. <Grid
  37. x:Name="FileInfoGrid"
  38. Margin="6,6,6,6"
  39. HorizontalAlignment="Stretch">
  40. <Grid.ColumnDefinitions>
  41. <ColumnDefinition Width="4.5*" MinWidth="0" />
  42. <ColumnDefinition Width="3*" />
  43. <ColumnDefinition Width="2*" />
  44. <ColumnDefinition Width="100" />
  45. </Grid.ColumnDefinitions>
  46. <Grid>
  47. <Grid.ColumnDefinitions>
  48. <ColumnDefinition Width="Auto" />
  49. <ColumnDefinition />
  50. </Grid.ColumnDefinitions>
  51. <Border
  52. Margin="10,0"
  53. BorderBrush="{StaticResource color.item-state.sel.border.lv3}"
  54. BorderThickness="1">
  55. <Image
  56. x:Name="CoverImage"
  57. Width="40"
  58. Height="60"
  59. RenderOptions.BitmapScalingMode="HighQuality"
  60. UseLayoutRounding="True" />
  61. </Border>
  62. <StackPanel Grid.Column="1" Margin="8,8,0,8">
  63. <StackPanel Grid.Column="1" Orientation="Horizontal">
  64. <Rectangle
  65. Name="RecNewMark"
  66. Width="4"
  67. Height="4"
  68. Margin="4,0"
  69. Fill="{StaticResource color.btn.cta.bg.norm}"
  70. RadiusX="4"
  71. RadiusY="4"
  72. Visibility="Collapsed" />
  73. <TextBlock
  74. x:Name="FileName"
  75. HorizontalAlignment="Stretch"
  76. VerticalAlignment="Center"
  77. FontSize="14"
  78. Foreground="{StaticResource color.sys.text.neutral.lv1}"
  79. Text="{Binding FileName}"
  80. TextTrimming="WordEllipsis" />
  81. </StackPanel>
  82. <TextBlock
  83. Margin="0,4,0,0"
  84. FontSize="14"
  85. Foreground="{StaticResource color.sys.text.neutral.lv3}"
  86. Text="PDF" />
  87. </StackPanel>
  88. </Grid>
  89. <Grid
  90. Grid.Column="1"
  91. HorizontalAlignment="Stretch"
  92. VerticalAlignment="Stretch" />
  93. <TextBlock
  94. x:Name="lastOpenTime"
  95. Grid.Column="1"
  96. HorizontalAlignment="Center"
  97. VerticalAlignment="Center"
  98. FontSize="14"
  99. Foreground="#94989C"
  100. Text="{Binding LastOpenTime, Converter={StaticResource RecentFileDateTimeToStringConvert}}"
  101. TextTrimming="WordEllipsis" />
  102. <TextBlock
  103. Grid.Column="2"
  104. HorizontalAlignment="Center"
  105. VerticalAlignment="Center"
  106. FontSize="14"
  107. Foreground="#94989C"
  108. Text="{Binding FilePath, Converter={StaticResource FilePathToSizeConvert}}" />
  109. <StackPanel
  110. x:Name="BtnPanel"
  111. Grid.Column="3"
  112. Margin="0,0,12,0"
  113. HorizontalAlignment="Right"
  114. Orientation="Horizontal">
  115. <Grid
  116. x:Name="DeleteGrid"
  117. Height="40"
  118. HorizontalAlignment="Right"
  119. Background="Transparent"
  120. Visibility="{Binding ElementName=usercontrol, Path=IsHoverState, Mode=OneWay, Converter={StaticResource BoolToVisibleConvert}}">
  121. <Button
  122. x:Name="DeleteButton"
  123. Width="40"
  124. Height="40"
  125. HorizontalAlignment="Right"
  126. VerticalContentAlignment="Center"
  127. Click="DeleteButton_Click"
  128. Style="{StaticResource OnlyContentBtn}">
  129. <Grid RenderTransformOrigin="0.5 0.5">
  130. <Path Data="M8.69231 8L12.5 4.19231L11.8077 3.5L8 7.30769L4.19231 3.5L3.5 4.19231L7.30769 8L3.5 11.8077L4.19231 12.5L8 8.69231L11.8077 12.5L12.5 11.8077L8.69231 8Z" Fill="Black" />
  131. </Grid>
  132. </Button>
  133. </Grid>
  134. <Grid
  135. x:Name="MoreGrid"
  136. Height="40"
  137. HorizontalAlignment="Right"
  138. Background="Transparent">
  139. <Button
  140. x:Name="MoreButton"
  141. Width="40"
  142. Height="40"
  143. HorizontalAlignment="Right"
  144. VerticalContentAlignment="Center"
  145. Click="MoreButton_Click"
  146. Initialized="MoreButton_Initialized"
  147. Style="{StaticResource OnlyContentBtn}">
  148. <Path Data="M2,7 C2.140625,7 2.27083333,7.02604167 2.390625,7.078125 C2.51041667,7.13020833 2.61588542,7.20182292 2.70703125,7.29296875 C2.79817708,7.38411458 2.86979167,7.48958333 2.921875,7.609375 C2.97395833,7.72916667 3,7.859375 3,8 C3,8.140625 2.97395833,8.27083333 2.921875,8.390625 C2.86979167,8.51041667 2.79817708,8.61588542 2.70703125,8.70703125 C2.61588542,8.79817708 2.51041667,8.86979167 2.390625,8.921875 C2.27083333,8.97395833 2.140625,9 2,9 C1.859375,9 1.72916667,8.97395833 1.609375,8.921875 C1.48958333,8.86979167 1.38411458,8.79817708 1.29296875,8.70703125 C1.20182292,8.61588542 1.13020833,8.51041667 1.078125,8.390625 C1.02604167,8.27083333 1,8.140625 1,8 C1,7.859375 1.02604167,7.72916667 1.078125,7.609375 C1.13020833,7.48958333 1.20182292,7.38411458 1.29296875,7.29296875 C1.38411458,7.20182292 1.48958333,7.13020833 1.609375,7.078125 C1.72916667,7.02604167 1.859375,7 2,7 Z M8,7 C8.140625,7 8.27083333,7.02604167 8.390625,7.078125 C8.51041667,7.13020833 8.61588542,7.20182292 8.70703125,7.29296875 C8.79817708,7.38411458 8.86979167,7.48958333 8.921875,7.609375 C8.97395833,7.72916667 9,7.859375 9,8 C9,8.140625 8.97395833,8.27083333 8.921875,8.390625 C8.86979167,8.51041667 8.79817708,8.61588542 8.70703125,8.70703125 C8.61588542,8.79817708 8.51041667,8.86979167 8.390625,8.921875 C8.27083333,8.97395833 8.140625,9 8,9 C7.859375,9 7.72916667,8.97395833 7.609375,8.921875 C7.48958333,8.86979167 7.38411458,8.79817708 7.29296875,8.70703125 C7.20182292,8.61588542 7.13020833,8.51041667 7.078125,8.390625 C7.02604167,8.27083333 7,8.140625 7,8 C7,7.859375 7.02604167,7.72916667 7.078125,7.609375 C7.13020833,7.48958333 7.20182292,7.38411458 7.29296875,7.29296875 C7.38411458,7.20182292 7.48958333,7.13020833 7.609375,7.078125 C7.72916667,7.02604167 7.859375,7 8,7 Z M14,7 C14.140625,7 14.2708333,7.02604167 14.390625,7.078125 C14.5104167,7.13020833 14.6158854,7.20182292 14.7070313,7.29296875 C14.7981771,7.38411458 14.8697917,7.48958333 14.921875,7.609375 C14.9739583,7.72916667 15,7.859375 15,8 C15,8.140625 14.9739583,8.27083333 14.921875,8.390625 C14.8697917,8.51041667 14.7981771,8.61588542 14.7070313,8.70703125 C14.6158854,8.79817708 14.5104167,8.86979167 14.390625,8.921875 C14.2708333,8.97395833 14.140625,9 14,9 C13.859375,9 13.7291667,8.97395833 13.609375,8.921875 C13.4895833,8.86979167 13.3841146,8.79817708 13.2929688,8.70703125 C13.2018229,8.61588542 13.1302083,8.51041667 13.078125,8.390625 C13.0260417,8.27083333 13,8.140625 13,8 C13,7.859375 13.0260417,7.72916667 13.078125,7.609375 C13.1302083,7.48958333 13.2018229,7.38411458 13.2929688,7.29296875 C13.3841146,7.20182292 13.4895833,7.13020833 13.609375,7.078125 C13.7291667,7.02604167 13.859375,7 14,7 Z" Fill="#616469">
  149. <Path.RenderTransform>
  150. <TransformGroup>
  151. <TranslateTransform Y="-3" />
  152. </TransformGroup>
  153. </Path.RenderTransform>
  154. </Path>
  155. <Button.ContextMenu>
  156. <ContextMenu x:Name="MenuMore" Loaded="MenuMore_Loaded">
  157. <ContextMenu.ItemContainerStyle>
  158. <Style TargetType="MenuItem">
  159. <Setter Property="VerticalContentAlignment" Value="Center" />
  160. <Setter Property="Padding" Value="0,7,0,7" />
  161. </Style>
  162. </ContextMenu.ItemContainerStyle>
  163. <MenuItem
  164. Name="MenuOpenFile"
  165. Click="MenuOpenFile_Click"
  166. Header="打开文件" />
  167. <MenuItem
  168. Name="MenuDelete"
  169. Click="MenuDelete_Click"
  170. Header="从最近列表删除" />
  171. </ContextMenu>
  172. </Button.ContextMenu>
  173. </Button>
  174. </Grid>
  175. </StackPanel>
  176. </Grid>
  177. </Grid>
  178. </UserControl>