diff --git a/aspnetcore/blazor/hybrid/routing.md b/aspnetcore/blazor/hybrid/routing.md index 2495cf40957c..43caa65d9e2b 100644 --- a/aspnetcore/blazor/hybrid/routing.md +++ b/aspnetcore/blazor/hybrid/routing.md @@ -13,6 +13,8 @@ zone_pivot_groups: blazor-hybrid-frameworks This article explains how to manage request routing and navigation in Blazor Hybrid apps. +## URI request routing behavior + Default URI request routing behavior: * A link is *internal* if the host name and scheme match between the app's origin URI and the request URI. When the host names and schemes don't match or if the link sets `target="_blank"`, the link is considered *external*. @@ -35,13 +37,11 @@ The -* WPF: -* Windows Forms: - -## Namespace +* .NET MAUI: +* WPF: +* Windows Forms: -The namespace is required for the examples in this article: +The namespace is required for the following examples: ```csharp using Microsoft.AspNetCore.Components.WebView; @@ -109,3 +109,118 @@ blazorWebView.UrlLoading += ``` :::zone-end + +:::zone pivot="maui" + +## Navigation among pages and Razor components + +This section explains how to navigate among .NET MAUI content pages and Razor components. + +The .NET MAUI Blazor hybrid project template isn't a [Shell-based app](/dotnet/maui/fundamentals/shell/), so the [URI-based navigation for Shell-based apps](/dotnet/maui/fundamentals/shell/navigation) isn't suitable for a project based on the project template. The examples in this section use a to perform modeless or modal navigation. + +In the following example: + +* The namespace of the app is `MauiBlazor`, which matches the suggested project name of the tutorial. +* A is placed in a new folder added to the app named `Views`. + +In `App.xaml.cs`, create the `MainPage` as a by making the following change: + +```diff +- MainPage = new MainPage(); ++ MainPage = new NavigationPage(new MainPage()); +``` + +`Views/NavigationExample.xaml`: + +```xaml + + +