Jeff Bowyer
Jeff Bowyer

Reputation: 41

Xamarin Forms: How to do multiple pages within multiple pages (nested)?

I've been searching for an answer to this for months. I have an app that will go from a login page (mainpage) to a 6-button menu page (menupage). Each of the 6 items on the menu page will then go to a 3 or 4 menu item page of it's own. I know that you are only supposed to put content pages as children of a navigation page, so I think that's out as a possible solution for the initial menupage. Can you nest tabbed pages (although that style is not what I'm looking for)?

All of the examples I've found online seem to address only one main page and a sub-page kind of hierarchy (parent - child). I'm looking for something that will support 3 levels and maybe even more (parent - child - grandchild, etc.).

Am I over-complicating this? Any advice on this would be welcomed.

Upvotes: 0

Views: 1716

Answers (2)

Nick Kovalsky
Nick Kovalsky

Reputation: 6492

If i understand you question correctly you could just use a master-detail page with 6 items, each of items being a tabbed page with sub-pages.

If the question was "how to include sub-pages into a page using a custom method", then take a look at: https://github.com/twintechs/TwinTechsFormsLib when you build the sample they have a custom page container for nesting pages insidem the only limitation is child pages can't be navigation ones.

Upvotes: 0

Steve Chadbourne
Steve Chadbourne

Reputation: 6953

I would recommend keeping your login page and your menu page in separate "stacks" i.e. change App.Current.MainPage when you swap between them.

As for the hierarchy, I can't see an issue. When you show menupage put it in a navigation page then just push the sub pages. You can have as many levels as you want.

Upvotes: 0

Related Questions