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

CollectionView Faults With InvalidOperationException on Windows #26038

Open
david-maw opened this issue Nov 21, 2024 · 0 comments
Open

CollectionView Faults With InvalidOperationException on Windows #26038

david-maw opened this issue Nov 21, 2024 · 0 comments
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView high It doesn't work at all, crashes or has a big impact. p/2 Work that is important, but is currently not scheduled for release platform/windows 🪟 t/bug Something isn't working
Milestone

Comments

@david-maw
Copy link

Description

In trying to write a repro for a bug I created a simple CollectionView app. It works fine on Android but on Windows selecting an item by way of setting a property bound to CollectionView.SelectedItem (with Mode=TwoWay) faults with an InvalidOperationException with the message "Unexpected type for enumerator".

Steps to Reproduce

Clone the repository, build and run the app on Windows, you should see:
Image

Click on the "Select First Item" button and it will fault.

In contrast, if you build and run it on Android and click on the "Select First Item" button it will simply select the first item.

Alternatively, if you first click on of the buttons labelled 'Button' the app will catch and ignore the exception, but the item will not be selected although the property will be updated. The values of the SelectedPerson Property and of CollectionView.SelectedItem are both displayed by the app. It's not clear to me whether this is the same problem or a different one, so I didn't raise a separate incident.

One other observation. If you run the app on Android you'll see this:

Image

Note that OnCollectionViewScrolled has been called, allowing the app to see initial values. This initial call is helpful and does not happen on Windows.

Link to public reproduction project repository

https://github.com/david-maw/SimpleCollectionView-Exception.git

Version with bug

9.0.10 SR1

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 11

Did you find any workaround?

No response

Relevant log output

@david-maw david-maw added the t/bug Something isn't working label Nov 21, 2024
@samhouts samhouts added platform/windows 🪟 area-controls-collectionview CollectionView, CarouselView, IndicatorView labels Nov 21, 2024
@PureWeen PureWeen added p/2 Work that is important, but is currently not scheduled for release high It doesn't work at all, crashes or has a big impact. labels Nov 21, 2024
@PureWeen PureWeen added this to the Backlog milestone Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-controls-collectionview CollectionView, CarouselView, IndicatorView high It doesn't work at all, crashes or has a big impact. p/2 Work that is important, but is currently not scheduled for release platform/windows 🪟 t/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants