7 Pages and navigation
This chapter covers:
- How to break your app up into pages using the
ContentPage
base class - How to use the navigation paradigms supported by .NET MAUI to navigate between different pages in your app
- Using Shell to simplify organising the pages in your app
- Passing data between pages when navigating
So far, we’ve built a handful of apps, all using a single page. This has worked well for the sample apps we’ve been building and works equally well for several commercial apps in the real world. But often, you need more than one page, for example to distinguish different areas of an app or logically group functionality. This becomes especially necessary with non-trivial apps when they grow too much to cram everything into a single screen.
In this chapter we’ll look at navigation paradigms and the different ways that .NET MAUI supports providing multiple pages in your apps and navigating between them.
7.1 ContentPage
ContentPage
is the most important Page type, in that the other Page types are just containers that provide different navigation paradigms that offer a way to present a ContentPage
.