Skip to content

Instantly share code, notes, and snippets.

@dansiegel
Last active April 15, 2020 00:04
Show Gist options
  • Save dansiegel/6f0b1449b0aa6c6cbb1a5598d8c39c85 to your computer and use it in GitHub Desktop.
Save dansiegel/6f0b1449b0aa6c6cbb1a5598d8c39c85 to your computer and use it in GitHub Desktop.
foreach (var child in tabbedPage.Children)
{
if (child.GetType() == selectedTabType)
{
tabbedPage.CurrentPage = child;
break;
}
else if(child is NavigationPage navPage &&
(navPage.CurrentPage == selectedTabType || navPage.RootPage == selectedTabType))
{
if(tabbedPage.Children.Where(x => x.GetType() == selectedTabType).Count() > 1)
throw new AmbiguousException();
tabbedPage.CurrentPage = child;
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment