Closed muffadal53 closed 3 weeks ago
Hi I'm an AI powered bot that finds similar issues based off the issue title.
Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!
ObservableCollection
and ContentView
(#21860), similarity score: 0.82Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Hi @muffadal53. 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.
@muffadal53 Using that version of MAUI, I could not reproduce your crash on iOS or Mac Catalyst. If you create a sample with what you're trying to implement, we can see exactly what the cause of your issue is. Thanks!
@drasticactions : I have updated the steps for reproducing the issue, unfortunately I don't have iOS sample to share as it is happening in my real production application. Can you please try with updated steps an see if you are able to reproduce this isssue. The steps are as mentioned below:
Create a Collection View with IsVisible property to "IsStringNotNullOrEmptyConverter" in a Content Page.
Create and Initialize the Observable collection in ViewModel.
Bind this to the collection view which is inside Grid in UI.
Now, based on TextChanged event of Entry field in the UI, in code behind file of the Content Page invoke the ICommand on viewModel say "ValueChanged".
In the "ValueChanged" command method in the ViewModel, create new list of object say Employee object and just after creating this list, call clear on the observable collection of Employees and add the list items of Employee in for loop.
Notice the app crashes on iOS with stack trace mentioned in Decription and Relevant log output section.
This issue has been automatically marked as stale because it has been marked as requiring author feedback to reproduce the issue but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment. If it is closed, feel free to comment when you are able to provide the additional information and we will re-investigate.
Description
If we have a view model with an ObservableCollection bound to a CollectionView. From the view model, we perform a Clear and then Add, it will crash out on iOS with "SIGABRT: Arg_NullReferenceException".
This happens on ".NET 8.0.300" with "Microsoft.Maui.Controls" version "8.0.40" and "Microsoft.Maui.Controls.Compatibility" with same version "8.0.40".
Below is the stack trace form the crash log:
Steps to Reproduce
Please provide fix for this issue as it is urent for our project release. This happens on ".NET SDK 8.0.300" with "Microsoft.Maui.Controls" version "8.0.40" and "Microsoft.Maui.Controls.Compatibility" with same version "8.0.40".
Link to public reproduction project repository
N/A
Version with bug
8.0.40 SR5
Is this a regression from previous behavior?
Not sure, did not test other versions
Last version that worked well
Unknown/Other
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
N/A
Relevant log output