Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
55
Property change events throw ObjectDisposedException when returning to a page in Xamarin Forms Shell
posted

I've created a default Xamarin Forms flyout app in Visual Studio - ie it's using XF Shell.

I've put an Infragistics.XF.Scheduler.XamScheduler on the AboutPage and hooked up the AppointmentItemsSource to "{Binding Appointments}" which is a property I've added to the AboutViewModel.

In the OnAppearing method of the page I try to call Appointments.Clear

The page works when the app is first run, but if I navigate to the Browse page then back to the About then I get the following:

System.ObjectDisposedException
Message=Cannot access a disposed object.
Object name: 'Infragistics.Controls.Scheduler.SchedulerView'.

and the app crashes.

It seems that scheduler hasn't unhooked from the INPC events when it was Disposed. 

Am I missing something or are the Infragistics controls incompatible with the Xamarin Forms Shell?

  • 34430
    Offline posted

    Hello Simon,

    I have been investigating into the behavior you are seeing, and I have reproduced it. I’m not completely convinced at the moment that this is something that is specific to the Xamarin.Forms Shell, but rather a tabbed view in general in Xamarin, as you are correct in that it appears to happen with property-changed related properties. This still needs more testing to be sure, though.

    I have been trying to devise a workaround to this by unhooking and re-hooking the data source, but unfortunately, I cannot seem to avoid this exception. This behavior is unexpected, and as such, I have asked our engineering teams to examine the behavior further. To ensure it receives attention, I have logged it in our internal tracking systems with a development ID of 272883 and I have created a private support case for you, which I will be linking this issue to. This case has an ID of CAS-212231-F6G6B8 and you can access it here: https://www.infragistics.com/my-account/support-activity.

    Please let me know if you have any other questions or concerns on this matter.