Description
This is a re-opening of #22104 I'm not sure why it was closed because it is still broken in .NET 9 and still broken in .NET 10. I've updated the reproduction project to .net 10 with the latest controls package and it still displays the incorrect behaviour on Windows.
The visual states are not functioning correctly when inside at a CollectionView's DataTemplate on Windows.
If VisualState setters are defined then firstly the elements are not displayed correctly on initial render and then the visual state isn't changed when an item is selected.
This happens only on Windows, it is working correctly on iOS, MacCatalyst and Android.
Android

Windows

Steps to Reproduce
- Clone the attached project
- Run the solution on MacCatalyst
- Observe the Items are initially rendered correctly
- Click the Select Next button and observe the items being selected correctly with a Red background
- Do the same on iOS and observe it working correctly
- Do the same on Android and observe it working correctly
- Run the solution on Windows
- Observe the items not getting rendered correctly initially and also not when items are selected
Link to public reproduction project repository
https://bitbucket.org/KeithBoynton/collection-view-selection-highlight/src/master/
Version with bug
10.0.30
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows
Did you find any workaround?
No
Relevant log output
Description
This is a re-opening of #22104 I'm not sure why it was closed because it is still broken in .NET 9 and still broken in .NET 10. I've updated the reproduction project to .net 10 with the latest controls package and it still displays the incorrect behaviour on Windows.
The visual states are not functioning correctly when inside at a CollectionView's DataTemplate on Windows.
If VisualState setters are defined then firstly the elements are not displayed correctly on initial render and then the visual state isn't changed when an item is selected.
This happens only on Windows, it is working correctly on iOS, MacCatalyst and Android.
Android
Windows
Steps to Reproduce
Link to public reproduction project repository
https://bitbucket.org/KeithBoynton/collection-view-selection-highlight/src/master/
Version with bug
10.0.30
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
Windows
Affected platform versions
Windows
Did you find any workaround?
No
Relevant log output