We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SegmentControl Crashes app when using Shell Flyout with error Cannot access a disposed object

Hi Guys,

     I think I got a problem with the SegmentControl, when using the control on a App with the standard Shell Flyout menus, going to a different view and then returning to a view with the SegmentControl, the app crashes with the error "Cannot access a disposed object. Object name: 'SfSegmentedControl'."
The same problem does not happen if instead of using the Flyout menu I use the TabBar.

To replicate the problem:
1. Create a new Xamarin Shell App (I am using Visual Studio for Mac 2019);
2. Add the nuget package Xamarin.Forms.Buttons;
3. Add License and SfSegmentControl Initialization;
4. On the ItemsPage.xaml, insert a SfSegmentControl inside the first StackLayout with some Collection Items;
5. Run the app (with Shell still using TabBar) - App runs, and switching between Browse, About and back to Browse, the Segment control is still operational;
6. On the AppShell.xaml, comment out the TabBar, and add 2 FloyoutItems to the same views;
7. Run the app again - This time, switching between Browse to About and back to Browse, the Segment control is not formatted correctly and trying to tap on a Segment crashes the App.

I am attaching a zip with the App created as mentioned above.

Thank you in advance.

Attachment: SfSegmentTester_2389f7fc.zip

1 Reply

HM Hemalatha Marikumar Syncfusion Team November 8, 2019 01:39 PM UTC

Hi Claiton, 
Greetings from Syncfusion. 
The reported issue has been reproduced on our side. We are currently validating the issue to find the exact root cause. Please check with the incident under your account for further updates. 
Hemalatha M. 

Live Chat Icon For mobile
Up arrow icon