Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected type for enumerator with CollectionViewSource #1733

Closed
Foda opened this issue Sep 4, 2024 · 0 comments · Fixed by #1735
Closed

Unexpected type for enumerator with CollectionViewSource #1733

Foda opened this issue Sep 4, 2024 · 0 comments · Fixed by #1735
Labels
bug Something isn't working
Milestone

Comments

@Foda
Copy link
Member

Foda commented Sep 4, 2024

Describe the bug
WinAppSDK 1.6.240821007-preview2 crashes (Unexpected type for enumerator) when iterating over ListView.Items if the ListView.ItemsSource is set via CollectionViewSource.

To Reproduce

Sample to reproduce the crash:

var items = new List<string>
{
    "Item 1",
    "Item 2"
};

var source = new CollectionViewSource()
{
    Source = items
};
TheList.ItemsSource = source.View;

...

// Invoked via a button or something
foreach (var item in TheList.Items)
{
    // Crash
}

TheList is a simple ListView control.

Expected behavior
It shouldn't crash/throw an exception

Version Info

  • TargetFramework: net8.0-windows10.0.22621.0
  • TargetPlatformMinVersion: 10.0.17763.0
  • WindowsSdkPackageVersion: 10.0.22621.38
  • Microsoft.WindowsAppSDK package version: 1.6.240821007-preview2

Additional context
This is blocking WinAppSDK 1.6 version bump for .NET MAUI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants