diff --git a/WinUIGallery/ControlPages/ListViewPage.xaml b/WinUIGallery/ControlPages/ListViewPage.xaml index e3a17f176..b7ea0080f 100644 --- a/WinUIGallery/ControlPages/ListViewPage.xaml +++ b/WinUIGallery/ControlPages/ListViewPage.xaml @@ -409,34 +409,33 @@ sent or received, and those values are bound in the DataTemplate.--> BorderThickness="1" BorderBrush="{ThemeResource SystemControlForegroundBaseMediumLowBrush}"> -<!-- Data Template Used: --> <!-- The data template is bound to a custom-created data type called CustomDataObject. --> <!-- The full code for the class can be found in this page's source code, but its attributes are referenced/bound below. --> +<ListView.ItemTemplate> + <DataTemplate x:DataType="local1:CustomDataObject"> + <Grid Margin="0,12,0,12" AutomationProperties.Name="{x:Bind Title}"> + <Grid.ColumnDefinitions> + <ColumnDefinition Width="Auto" MinWidth="150"/> + <ColumnDefinition Width="*" /> + </Grid.ColumnDefinitions> + <Image Source="{x:Bind ImageLocation}" MaxHeight="100" Stretch="Fill"/> -<DataTemplate x:DataType="local1:CustomDataObject"> - <Grid Margin="0,12,0,12" AutomationProperties.Name="{x:Bind Title}"> - <Grid.ColumnDefinitions> - <ColumnDefinition Width="Auto" MinWidth="150"/> - <ColumnDefinition Width="*" /> - </Grid.ColumnDefinitions> - <Image Source="{x:Bind ImageLocation}" MaxHeight="100" Stretch="Fill"/> - - <StackPanel Margin="12,0,0,0" Grid.Column="1" > - <TextBlock Text="{x:Bind Title}" FontSize="14" FontWeight="SemiBold" Style="{ThemeResource BaseTextBlockStyle}" - HorizontalAlignment="Left" Margin="0,0,0,6" LineHeight="20"/> - <TextBlock Text="{x:Bind Description}" FontFamily="Segoe UI" FontWeight="Normal" Style="{ThemeResource BodyTextBlockStyle}" - TextTrimming="CharacterEllipsis" Width="350" MaxLines="1"/> - <StackPanel Orientation="Horizontal"> - <TextBlock Text="{x:Bind Views}" HorizontalAlignment="Left" Style="{ThemeResource CaptionTextBlockStyle}" Margin="0,0,0,0"/> - <TextBlock Text=" Views " HorizontalAlignment="Left" Style="{ThemeResource CaptionTextBlockStyle}"/> - <TextBlock Text=" ⋅ " Style="{ThemeResource CaptionTextBlockStyle}" - HorizontalAlignment="Left"/> - <TextBlock Text="{x:Bind Likes}" HorizontalAlignment="Left" Style="{ThemeResource CaptionTextBlockStyle}" Margin="5,0,0,0"/> - <TextBlock Text=" Likes" HorizontalAlignment="Left" Style="{ThemeResource CaptionTextBlockStyle}"/> + <StackPanel Margin="12,0,0,0" Grid.Column="1" > + <TextBlock Text="{x:Bind Title}" FontSize="14" FontWeight="SemiBold" Style="{ThemeResource BaseTextBlockStyle}" + HorizontalAlignment="Left" Margin="0,0,0,6" LineHeight="20"/> + <TextBlock Text="{x:Bind Description}" FontFamily="Segoe UI" FontWeight="Normal" Style="{ThemeResource BodyTextBlockStyle}" + TextTrimming="CharacterEllipsis" Width="350" TextWrapping="NoWrap"/> + <StackPanel Orientation="Horizontal"> + <TextBlock Text="{x:Bind Views}" Style="{ThemeResource CaptionTextBlockStyle}" Margin="0"/> + <TextBlock Text=" Views " Style="{ThemeResource CaptionTextBlockStyle}"/> + <TextBlock Text=" &#x22C5; " Style="{ThemeResource CaptionTextBlockStyle}"/> + <TextBlock Text="{x:Bind Likes}" Style="{ThemeResource CaptionTextBlockStyle}" Margin="5,0,0,0"/> + <TextBlock Text=" Likes" Style="{ThemeResource CaptionTextBlockStyle}"/> + </StackPanel> </StackPanel> - </StackPanel> - </Grid> -</DataTemplate> + </Grid> + </DataTemplate> +</ListView.ItemTemplate>