-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Bug] ShellItem.Items.Clear() crashes when the ShellItem has bottom tabs #6878
Comments
Do you have a sample where the problem happens?, could you attach it?. Thanks in advance! |
https://github.com/SFSteve/Xamarin-Demos/tree/master/Xaminals If you run that then go to the Random page from the flyout menu, you'll get the error. |
If it helps, here is another test app to demonstrate the issue. The crash happens at AppShell.xaml.cs line 29. |
EditAdding an exception is probably not the best solution for this Edit overMost likely the fix for this will be to just throw an exception that Clear isn't supported for Shell If you clear all the items then Shell has no idea what to display. It's like setting the MainPage on the app to NULL We have work being done for an IsVisible property which will be the way to change visibility of items. For now I would just add what you are wanting to add then remove what you are wanting to remove |
An IsVisible flag would be ideal and solve the actual issue we're having, so it's good to know there's one on the way. |
closed by #8215 |
Hi, This is still broken in IOS, any plans on when this will be fixed? even when the Tab has multiple ShellItems when I try to Remove the first item "Items.RemoveAt(0);" it still crashes. |
Description
When using shell, if you want to programmatically clear and redraw the bottom tabs on a shell page, you can't use Items.Clear to get rid of all the existing ones because it crashes. Investigation suggests that this is because it's trying to set properties on a tab that is no longer there.
Steps to Reproduce
Expected Behavior
The tabs are cleared and you're free to create new ones
Actual Behavior
Exception and crash
Basic Information
The text was updated successfully, but these errors were encountered: