|
| 1 | +<!-- |
| 2 | + Issue 列表 |
| 3 | + --> |
| 4 | + |
| 5 | +<UserControl |
| 6 | + x:Class="Lavcode.Uwp.Controls.Issue.IssueList" |
| 7 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 8 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 9 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 10 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 11 | + xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" |
| 12 | + xmlns:octokit="using:Octokit" |
| 13 | + xmlns:ui="using:Microsoft.Toolkit.Uwp.UI" |
| 14 | + mc:Ignorable="d" |
| 15 | + d:DesignHeight="300" |
| 16 | + d:DesignWidth="400" |
| 17 | + DataContext="{x:Bind}"> |
| 18 | + |
| 19 | + <ListView ItemsSource="{x:Bind Issues,Mode=OneWay}" |
| 20 | + x:Name="lv" |
| 21 | + IsItemClickEnabled="True" |
| 22 | + ItemClick="ListView_ItemClick" |
| 23 | + SelectionMode="None" |
| 24 | + BorderThickness="0 1 0 0"> |
| 25 | + <ListView.BorderBrush> |
| 26 | + <SolidColorBrush Color="{ThemeResource SystemBaseHighColor}" Opacity="0.2"/> |
| 27 | + </ListView.BorderBrush> |
| 28 | + |
| 29 | + <ListView.ItemContainerStyle> |
| 30 | + <Style TargetType="ListViewItem"> |
| 31 | + <Setter Property="HorizontalContentAlignment" Value="Stretch" /> |
| 32 | + <Setter Property="VerticalContentAlignment" Value="Stretch" /> |
| 33 | + <Setter Property="BorderThickness" Value="0 0 0 1" /> |
| 34 | + <Setter Property="BorderBrush"> |
| 35 | + <Setter.Value> |
| 36 | + <SolidColorBrush Color="{ThemeResource SystemBaseHighColor}" Opacity="0.2"/> |
| 37 | + </Setter.Value> |
| 38 | + </Setter> |
| 39 | + <Setter Property="Background" Value="Transparent" /> |
| 40 | + <Setter Property="Padding" Value="20 12" /> |
| 41 | + <Setter Property="ui:FrameworkElementExtensions.Cursor" Value="Hand" /> |
| 42 | + </Style> |
| 43 | + </ListView.ItemContainerStyle> |
| 44 | + |
| 45 | + <ListView.ItemTemplate> |
| 46 | + <DataTemplate x:DataType="octokit:Issue"> |
| 47 | + <StackPanel> |
| 48 | + <Grid> |
| 49 | + <Grid.ColumnDefinitions> |
| 50 | + <ColumnDefinition Width="auto"/> |
| 51 | + <ColumnDefinition Width="auto"/> |
| 52 | + <ColumnDefinition Width="auto"/> |
| 53 | + <ColumnDefinition Width="*"/> |
| 54 | + <ColumnDefinition Width="auto"/> |
| 55 | + </Grid.ColumnDefinitions> |
| 56 | + |
| 57 | + <Button Style="{StaticResource LightButtonStyle}" Padding="0" HorizontalAlignment="Left" Click="AuthorButton_Click"> |
| 58 | + <StackPanel Orientation="Horizontal"> |
| 59 | + <Border VerticalAlignment="Center" |
| 60 | + Width="24" |
| 61 | + Height="24" |
| 62 | + CornerRadius="12" |
| 63 | + Margin="0 0 10 0"> |
| 64 | + <Image Source="{x:Bind User.AvatarUrl}"/> |
| 65 | + </Border> |
| 66 | + <TextBlock Text="{x:Bind User.Login}" |
| 67 | + VerticalAlignment="Center"/> |
| 68 | + </StackPanel> |
| 69 | + </Button> |
| 70 | + |
| 71 | + <TextBlock Grid.Column="1" Text="回复:" VerticalAlignment="Center" Margin="20 0 0 0" Opacity="0.7"/> |
| 72 | + <TextBlock Grid.Column="2" Text="{x:Bind Comments}" VerticalAlignment="Center" Opacity="0.7"/> |
| 73 | + <TextBlock Grid.Column="3" Text="{x:Bind Title}" FontSize="15" FontWeight="Bold" Margin="20 0 0 0" VerticalAlignment="Center" TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"/> |
| 74 | + |
| 75 | + <TextBlock Grid.Column="4" HorizontalAlignment="Right" Opacity="0.7" VerticalAlignment="Center" |
| 76 | + Text="{x:Bind UpdatedAt,Converter={StaticResource DateFormatConverter},ConverterParameter=yyyy-MM-dd HH:mm:ssL}"/> |
| 77 | + </Grid> |
| 78 | + <controls:MarkdownTextBlock x:Name="MarkdownText" |
| 79 | + Margin="0 10 0 0" |
| 80 | + Text="{x:Bind Body}" |
| 81 | + Background="Transparent" |
| 82 | + Visibility="{x:Bind Body,Converter={StaticResource IsStrEmptyConverter},ConverterParameter=T}" |
| 83 | + LinkClicked="MarkdownText_LinkClicked"/> |
| 84 | + </StackPanel> |
| 85 | + </DataTemplate> |
| 86 | + </ListView.ItemTemplate> |
| 87 | + </ListView> |
| 88 | +</UserControl> |
0 commit comments