Navigation
Multiple pages are generated as part of the overall view. Five multi-page navigation models are shown in the AllControls sample:
NavigationPage using push/pop
NavigationPage Toolbar
TabbedPage
CarouselPage
MasterDetail
NavigationPage using push/pop
The basic principles of implementing push/pop navigation are as follows:
Keep some information in your model indicating the page stack (e.g. a list of page identifiers or page models)
Return the current visual page stack in the
pagesproperty ofNavigationPage.Set
HasNavigationBarandHasBackButtonon each sub-page according to your desireDispatch messages in order to navigate, where the corresponding
updateadjusts the page stack in the model
let view model dispatch =
View.NavigationPage(pages=
[ for page in model.PageStack do
match page with
| "Home" ->
yield View.ContentPage(...).HasNavigationBar(true).HasBackButton(true)
| "PageA" ->
yield View.ContentPage(...).HasNavigationBar(true).HasBackButton(true)
| "PageB" ->
yield View.ContentPage(...).HasNavigationBar(true).HasBackButton(true)
])NavigationPage Toolbar
A toolbar can be added to a navigation page using .ToolbarItems([ ... ]) as follows:
Example: Modal pages by pushing an extra page
A modal page can be achieved by yielding an additional page in the NavigationPage. For example, here is an “About” page example:
TabbedPage navigation
Return a TabbedPage from your view:
CarouselPage navigation
Return a CarouselPage from your view:
MasterDetail Page navigation
Return a FlyoutPage from your view:
Last updated