Skip to content

Reordering GridView items causes crashes with AOT compilation #1685

@lhak

Description

@lhak

Describe the bug

Using a GridView with the ItemsSource set to a class derived from ObservableCollection<Item> causes a crash when items are reordered due to an InvalidCastException. A workaround it to add code according to the documentation (https://github.com/manodasanW/WinUI-Gallery/blob/16ed717700b929dcb6591d32a4f10cd8b102aa07/WinUIGallery/VtableInitialization.cs#L24-L53) with typeName set to System.Collections.Specialized.SingleItemReadOnlyList.

Expected behavior

Should work without additional code

Version Info

CsWinRT 2.1.0-prerelease.240722.1
WindowsSDK 10.0.22621.37-preview

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    AOTbugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions