Welcome to the Xamarin.Forms feedback portal. We’re happy you’re here! If you have feedback on how to improve the Xamarin.Forms, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
The SfDataForm seems not to unsubscribe/deregister from PropertyChange event from the assigned DataObject when the surrounding ContentPage gets destroyed.
This bug sometimes appears, sometimes not. It depends on the timeing and load of the GarbageCollector.
Make sure you enabled "Use the concurrent garbage collector" in the project settings.
Reproduction:
- Create a ViewModel with a simple OnPropertyChange mechanism.
- Create a simple ContentPage with a SfDataForm in it which has a binding to the above ViewModel
- Allocate and Push the ContentPage to the NavigationStack -> ViewModel gets a change event handler registered to the DataForm
- Pop the ContentPage and Allocate and Push a new ContentPage again -> Now 2 change event handlers are registered on the ViewModel
- Wait a few seconds to let the garbage collector doing it's job
- Edit something in a field of the SfDataForm -> You get a NullReference exception in the PropertyChanged handler caused by an already disposed object