| MAUI-Shell-Routing | ContentPage-vs-Page | |
FlyoutPage in .NET MAUI |
In .NET MAUI, a FlyoutPage is a type of page that provides a master-detail navigation pattern, commonly used for apps with a side menu (often called a hamburger menu). It allows you to have:
The container that holds both the Flyout and Detail pages.
Typically a ContentPage or a Shell section that contains navigation options.
The main content page that changes based on user selection.
//C#
public class MainPage : FlyoutPage
{
public MainPage()
{
Flyout = new MenuPage(); // The side menu
Detail = new NavigationPage(new HomePage()); // The main content
}
}
Flyout: Usually a list of navigation items.
Detail: Wrapped in a NavigationPage to allow navigation within the main content area.
This page compares Shell and FlyoutPage in .NET MAUI, highlighting their key differences, advantages, and recommended use cases.
Shell: A modern navigation container that simplifies app structure with built-in features like Flyout menus, tabs, and URI-based routing.
FlyoutPage: A traditional master-detail pattern providing a side menu (hamburger menu) and a detail content area.
| Aspect | Shell | FlyoutPage |
|---|---|---|
| Navigation Style | URI-based, declarative, supports tabs and flyout | Manual navigation stack, master-detail pattern |
| Complexity | Lower (built-in features reduce boilerplate) | Higher (requires manual setup for navigation) |
| Recommended Use Cases | Apps with multiple sections, deep linking, tabs | Apps needing full control over layout and behavior |
| Performance | Optimized for cross-platform navigation | Good, but less optimized for complex scenarios |
| Flexibility | Limited customization (but easier to use) | Highly customizable layout and behavior |
| MAUI-Shell-Routing | ContentPage-vs-Page | |