Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InvertedListView example not working #1068

Closed
jarlbrak opened this issue Sep 2, 2022 · 1 comment
Closed

InvertedListView example not working #1068

jarlbrak opened this issue Sep 2, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@jarlbrak
Copy link

jarlbrak commented Sep 2, 2022

Which version of the app?

WinUI 3 Gallery

Description

Following the example in the latest version of Windows App SDK does not produce the same results as in the WinUI3 Gallery App.

Screenshots

XAML code as provided in the example produces this:

<DataTemplate x:Key="MessageViewTemplate" x:DataType="local1:Message">
    <Grid Height="Auto" Margin="4" HorizontalAlignment="{x:Bind MsgAlignment}">
        <StackPanel MinHeight="75" Width="350" Padding="10, 0, 0, 10" Background="{x:Bind BgColor}" CornerRadius="{StaticResource ControlCornerRadius}">
            <TextBlock Text="{x:Bind MsgText}" Padding="0, 10, 0, 0" FontSize="20" Foreground="{ThemeResource SystemControlForegroundAltHighBrush}"/>
            <TextBlock Text="{x:Bind MsgDateTime}" Padding="0, 0, 0, 10" FontSize="15" Foreground="{ThemeResource SystemControlForegroundAltMediumHighBrush}"/>
        </StackPanel>
    </Grid>
</DataTemplate>

image

XAML code corrected (not a direct replacement, for my implementation):

<DataTemplate x:Key="MessageViewTemplate" x:DataType="models:StatusMessage">
    <Grid Height="Auto" Margin="4" Width="350">
        <StackPanel MinHeight="60" MinWidth="150" Padding="10, 0, 0, 10" Background="{x:Bind Background, Mode=OneWay}" CornerRadius="10" HorizontalAlignment="{x:Bind Alignment, Mode=OneWay}">
            <TextBlock Text="{x:Bind MessageText, Mode=OneWay}" Padding="0, 10, 0, 0" FontSize="16" Foreground="{ThemeResource SystemControlForegroundAltHighBrush}"/>
            <TextBlock Text="{x:Bind MessageTime, Mode=OneWay}" Padding="0, 0, 0, 10" FontSize="10" Foreground="{ThemeResource SystemControlForegroundAltMediumHighBrush}"/>
        </StackPanel>
    </Grid>
</DataTemplate>

image

Issues corrected:

  1. HorizontalAlignment was set on the grid instead of the stackpanel
  2. Width was set on the stackpanel instead of the grid

Not sure how the app works as intended but I could not produce the same results in the latest Windows App SDK version.

Windows version

November 2021 Update/21H2 (19044)

Additional context

No response

@jarlbrak jarlbrak added the bug Something isn't working label Sep 2, 2022
@marcelwgn
Copy link
Collaborator

Thank you for your feedback! I'm afraid though, this is not a bug since the XAML Code shown in the gallery is the same as the code that is powering the sample you are seeing there. The only thing that was out of date were the colors which will be adjusted by #1383. Hence I'll close this issue, if you feel this is an issue, feel free to reopen this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants