-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
App crash on button click in CollectionView Item #17707
Comments
The error is
So it's trying to pass in the View Model itself and not the parameter. It actually throws when the app first runs before you click on it when it's initializing during "CanExecute" if you enable showing all exceptions. Trying it in MAUI net7.0, it does work. It throws in net8.0. The big issue I see debugging this is that you're using two CommunityToolkit libraries, C# Markup and MVVM (For AsyncCommand, Relay, etc). While the same versions of those work with net7.0, I'm not sure if those have any influence into this and if they could be part of the problem you're having. It could be the binding API in C# Markup has a problem, or the AsyncCommand from MVVM is at fault? Or MAUI itself is passing in the wrong parameter. It's hard to tell based on how this is written. If you could rewrite your code to only use pure MAUI APIs and can reproduce the issue (you don't have to use XAML, it can still be done in C#), that would help a lot. |
Hi @HobDev. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
same! |
@nor0x I see you're also using the CommunityToolkit. Does it repro without that? |
Hi @HobDev. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
@HobDev can you test nightly? https://github.com/dotnet/maui/wiki/Nightly-Builds |
@PureWeen I added https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet8/nuget/v3/index.json in the Package Sources and Package Source Mapping of the Visual Studio 17.8.0 Preview 2.0. What should I do next to work with the nightly builds. |
@drasticactions I can confirm that that removing CommunityToolkit.Mvvm code resolves the issue. Can this issue be moved to the communitytoolkit repo. While testing the code without CommunityToolkit.Mvvm and CommunityToolkit.Maui.Markup I catch another two bugs in the CollectionView which are reported here and here. |
will check that today 👍 EDIT: |
This issue was moved to xamarin/XamarinCommunityToolkit#1989 |
Description
There are two buttons in a CollectionView ItemTemplate. Starangely the app crashes on clicking the first button. But strangely the app does not crash on clicking the second button.
Steps to Reproduce
Run the reproduction app. Try Clicking on the buttons in one of the CollectionView items.
Link to public reproduction project repository
https://github.com/HobDev/DotNet8MauiBugs/tree/CollectionViewDataIssue
Version with bug
8.0.0-rc.1.9171
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
7.0.92
Affected platforms
Windows
Affected platform versions
Windows SDK 10.0.19041.0
Did you find any workaround?
NO
Relevant log output
No response
The text was updated successfully, but these errors were encountered: