-
Notifications
You must be signed in to change notification settings - Fork 802
Open
Labels
bugSomething isn't workingSomething isn't workingneeds-triageIssue needs to be triaged by the area ownersIssue needs to be triaged by the area owners
Description
Describe the bug
When a ListView has the ItemsPanel explicitly configured then the configured ItemTemplateSelector is not honoured.
This means that we cannot add spacing, orientation etc. to a list with more than one item template.
Steps to reproduce the bug
<Grid ColumnDefinitions="*,*" RowDefinitions="Auto,*">
<TextBlock Grid.Row="0" Grid.Column="0" Text="Works"/>
<Border Grid.Row="1" Grid.Column="0" Background="Yellow">
<ListView x:Name="GoodList" ItemsSource="{x:Bind MyItems}" ItemTemplateSelector="{StaticResource MyTemplateSelector}"/>
</Border>
<TextBlock Grid.Row="0" Grid.Column="1" Text="Does not work"/>
<Border Grid.Row="1" Grid.Column="1" Background="Pink">
<ListView x:Name="BadList" ItemsSource="{x:Bind MyItems}" ItemTemplateSelector="{StaticResource MyTemplateSelector}">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel />
</ItemsPanelTemplate>
</ListView.ItemsPanel>
</ListView>
</Border>
</Grid>
ListView named GoodList applies the template selector. ListView named BadList does not.
Expected behavior
Both lists in the repro should look the same.
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.6.5: 1.6.250205002
Windows version
Windows 11 (24H2): Build 26100
Additional context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingneeds-triageIssue needs to be triaged by the area ownersIssue needs to be triaged by the area owners
