Routeables.Maui
2.1.0
dotnet add package Routeables.Maui --version 2.1.0
NuGet\Install-Package Routeables.Maui -Version 2.1.0
<PackageReference Include="Routeables.Maui" Version="2.1.0" />
<PackageVersion Include="Routeables.Maui" Version="2.1.0" />
<PackageReference Include="Routeables.Maui" />
paket add Routeables.Maui --version 2.1.0
#r "nuget: Routeables.Maui, 2.1.0"
#:package Routeables.Maui@2.1.0
#addin nuget:?package=Routeables.Maui&version=2.1.0
#tool nuget:?package=Routeables.Maui&version=2.1.0
Routeables.Maui
The .NET MAUI host of Routeables: the setup call, a routed ContentView base, a Shell driven by the menu view model, and the region control. Targets net10.0 and the Android, iOS, Mac Catalyst and Windows frameworks (the MAUI workload is required).
dotnet add package Routeables.Maui
The package brings Routeables (routing, abstractions and the source generator): there is nothing else to add.
Set up
var builder = MauiApp.CreateBuilder();
builder.UseMauiApp<App>().UseRouteables();
An application with a menu gives its menu view model: .UseRouteables<MainViewModel>().
A view
<routeables:RouteableFor x:Class="XAnimals.Maui.Views.DogDetailView"
xmlns:routeables="clr-namespace:Routeables.Maui;assembly=Routeables.Maui" ...>
<views:AnimalDetail />
</routeables:RouteableFor>
RouteableFor maps the context to BindingContext. A zone that shows a region is <routeables:RouteableRegion Region="shell-content" />.
The menu
RouteableMenu (a ContentView) lists the entries of the menu view model, selects the current one and disables the locked ones; its binding context is the menu view model. Use it in a page of your own; RouteablesShell draws the same entries as its flyout.
The shell
RouteablesShell is a Shell whose tabs or flyout entries come from the menu view model, and it follows entries added later (modules). Shell owns the top level and Routeables the route changes inside each item: do not also use Shell.GoToAsync on those pages.
A Shell written in XAML
Keep your own Shell (flyout, tabs, routes in XAML) and let Routeables build each page from its route:
xamlShell.AttachRouteables(provider); // "cats" opens the route "/cats"
RouteableShellItems.AttachRouteables(Shell, IServiceProvider) returns an IDisposable. Each ShellContent with a Route gets the view of that route, and the router stays in step with what the user selects.
Dialogs and notifications
In the Routeables.Maui.Services namespace. UseRouteables already registers them; UseRouteablesServices takes optional factories, to call only to replace a service. For CommunityToolkit.Maui popups and snackbars call UseCommunityToolkit() from Reshapes after UseRouteables: it replaces them.
- Dialogs, content dialogs, task dialogs and notifications. Toasts are native on Windows, Android, iOS and Mac Catalyst, and an overlay on the plain
net10.0target. RouteableModalFor<TViewModel, TResult>: the base of a modal view that returns a typed result.
Dialogs and modals need an active page to appear on. Contracts: Routeables.Services.
Good to know
- Property injection understands
[RouteableParameter]and MAUI's[QueryProperty]. RouteableMauiEntryshows a validation error from anINotifyDataErrorInfocontext.- CommunityToolkit popups and snackbars: call
UseCommunityToolkit()fromReshapesafterUseRouteables, next to the usualUseMauiCommunityToolkit(). - On CI,
-p:CiBuild=truebuilds only the plainnet10.0target.
Next
Hosts guide, samples samples/XAnimals.Maui and XAnimals.MauiHybrid.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-android36.0 is compatible. net10.0-browser was computed. net10.0-ios was computed. net10.0-ios26.0 is compatible. net10.0-maccatalyst was computed. net10.0-maccatalyst26.0 is compatible. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. net10.0-windows10.0.19041 is compatible. |
-
net10.0
- Microsoft.Maui.Controls (>= 10.0.110)
- Routeables (>= 2.1.0)
- Routeables.Native (>= 2.1.0)
-
net10.0-android36.0
- Microsoft.Maui.Controls (>= 10.0.110)
- Routeables (>= 2.1.0)
- Routeables.Native (>= 2.1.0)
-
net10.0-ios26.0
- Microsoft.Maui.Controls (>= 10.0.110)
- Routeables (>= 2.1.0)
- Routeables.Native (>= 2.1.0)
-
net10.0-maccatalyst26.0
- Microsoft.Maui.Controls (>= 10.0.110)
- Routeables (>= 2.1.0)
- Routeables.Native (>= 2.1.0)
-
net10.0-windows10.0.19041
- Microsoft.Maui.Controls (>= 10.0.110)
- Routeables (>= 2.1.0)
- Routeables.Native (>= 2.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Routeables.Maui:
| Package | Downloads |
|---|---|
|
Reshapes.Maui.Community
CommunityToolkit.Maui popups for Routeables: content dialogs, task dialogs and modals drawn with CommunityToolkit popups. |
GitHub repositories
This package is not used by any popular GitHub repositories.