-
Notifications
You must be signed in to change notification settings - Fork 123
Description
Description
Hello.
I'm porting a UWP application to .NET 9 and I'm running into issues with CollectionViewSource when working with grouped collections.
I use a custom grouped observable collection. It has its own Grouping<TKey, TItem> type with a Key property and a Values property (which contains the items in that group).
The porting process is stuck because of problems with my custom collection.
I created a minimal reproducible example with two variants:
- My custom grouped observable collection (shows groups by DateTime + view model class or DateTime values)
- Manually created grouped collection (like in issue Bug: ListView doesn't render its items when using CollectionViewSource & NativeAot #2001, also using DateTime + view model or DateTime value)
When the app runs with both variants present — all groups and items are displayed correctly.
But when I comment out the creation of the manual grouped collection (from issue #2001) — only the group headers are shown in my custom collection; the items inside the groups disappear.
Right column display DateTime(group key and values). Left column display DateTime(header), view model in values.

Commented:
Why my custom collection stop working?
Archive with sources: TestNet9.zip
Steps To Reproduce
- Launch the application using the archived build. → Expected: all groups and their items are displayed correctly.
- Close the application.
- Open
MainPage.xaml.csand comment out lines 36 through 57 (the manual grouped collection creation code). - Rebuild and run again. → Actual: only group headers appear; items within groups are not rendered.
Expected Behavior
Items from my custom collection display without issues. And i don't need another two collections.
Version Info
Microsoft.Windows.CsWinRT 2.3.0-prerelease.251115.2(add as PackageReference)
CommunityToolkit.Mvvm 8.4.0
Microsoft Visual Studio Community 2022
Version 17.14.27 (February 2026)
Additional Context
No response