Repository navigation
Description
Describe the bug
ListViewExtensions.AlternateColor doesn't work when the ListView declares Items with an item type of ListViewItem.
In our sample gallery under ./components/Extensions/samples/ListViewExtensionsAlternateColorSample.xaml, we use x:String with Items:
<ListView ui:ListViewExtensions.AlternateColor="Silver">
<ListView.Items>
<x:String>One</x:String>
<x:String>Two</x:String>
<x:String>Three</x:String>
<x:String>Four</x:String>
<x:String>Five</x:String>
<x:String>Six</x:String>
<x:String>Seven</x:String>
<x:String>Eight</x:String>
<x:String>Nine</x:String>
<x:String>Ten</x:String>
</ListView.Items>
</ListView>This works as expected, but if you swap out x:String for ListViewItem then the AlternateColor extension stops working:
<ListView ui:ListViewExtensions.AlternateColor="Silver">
<ListView.Items>
<ListViewItem Content="One" />
<ListViewItem Content="Two" />
<ListViewItem Content="Three" />
<ListViewItem Content="Four" />
<ListViewItem Content="Five" />
<ListViewItem Content="Six" />
<ListViewItem Content="Seven" />
<ListViewItem Content="Eight" />
<ListViewItem Content="Nine" />
<ListViewItem Content="Ten" />
</ListView.Items>
</ListView>Full repro can be found here:
ListViewExtensionsAlternateColorItemsBug.zip
Steps to reproduce
See above.
Expected behavior
Using ListViewItem should work just the same as using x:String with no difference in alternate color behavior.
Screenshots
Code Platform
- UWP
- WinAppSDK / WinUI 3
- Web Assembly (WASM)
- Android
- iOS
- MacOS
- Linux / GTK
Windows Build Number
- Windows 10 1809 (Build 17763)
- Windows 10 1903 (Build 18362)
- Windows 10 1909 (Build 18363)
- Windows 10 2004 (Build 19041)
- Windows 10 20H2 (Build 19042)
- Windows 10 21H1 (Build 19043)
- Windows 10 21H2 (Build 19044)
- Windows 10 22H2 (Build 19045)
- Windows 11 21H2 (Build 22000)
- Other (specify)
Other Windows Build number
Windows 11 24H2, Build 26100
App minimum and target SDK version
- Windows 10, version 1809 (Build 17763)
- Windows 10, version 1903 (Build 18362)
- Windows 10, version 1909 (Build 18363)
- Windows 10, version 2004 (Build 19041)
- Windows 10, version 2104 (Build 20348)
- Windows 11, version 22H2 (Build 22000)
- Other (specify)
Other SDK version
No response
Visual Studio Version
No response
Visual Studio Build Number
No response
Device form factor
No response
Additional context
Originally reported by @0x5bfa in the #community-toolkit channel of the Windows App Community discord server.
Help us help you
Yes, I'd like to be assigned to work on this item.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fields✅ Done
Activity
Avid29 commentedon Dec 19, 2025
I'm not going to make an issue for it right now, but looking at this made me think - Why not add an
AlternateStyleproperty?Also, this is a breaking change, but the
AlternateColoris a brush applied to the container background. It should be called theAlternateBackground.