microsoft / microsoft/microsoft-ui-xaml

ListView does not use ItemTemplateSelector when ItemsPanel is configured

Open
#10,376 0 comments 0 reactions 0 assignees View on GitHub
bug needs-triage
Dominant language
C++
Stars
8.4k
Forks
942
Avg merge
2d 7h
Merged PRs (30d)
105

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














ListView named *GoodList* applies the template selector. ListView named *BadList* does not.

### Expected behavior

Both lists in the repro should look the same.

### Screenshots

![Image](https://github.com/user-attachments/assets/a35f81c6-ba96-41fa-b02e-453fae41b5e5)

### 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_

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the GoodList and BadList XAML shown in the report, then trace the ListView handling of ItemsPanel and ItemTemplateSelector. The work is done when an explicitly configured ItemsPanel still honors the ItemTemplateSelector and both lists render the same way.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.