Install the template pack
dotnet new install Plugin.Maui.MVVMExpress.Templates
dotnet new mvvmexpress -n MyApp
cd MyApp
dotnet test MyApp.TestsNuGet: Plugin.Maui.MVVMExpress.Templates 1.0.1
From the product repo, without installing the nupkg: dotnet new install templates/maui-app and templates/page, then dotnet new mvvmexpress -n MyApp.
mvvmexpress app
Short name: mvvmexpress. Creates a NavigationPage host on Android, iOS, Mac Catalyst, and Windows (single-window).
| Included | What you get |
|---|---|
| MainPage + MainPageViewModel | [Notify] counter and IncrementCommand, bound in XAML |
| IGreetingService | Registered by AddMain() |
| Login | Replace-root back to MainPage after sign-in |
| List + form | One Snapshot-style list and one FormViewModel screen |
| MyApp.Tests | net10.0 tests for the generated ViewModels |
Demo sign-in is demo@mvvmexpress.dev / secret. Production tokens stay on Plugin.Maui.SecureSession — do not store them on the ViewModel.
mvvmexpress-page item
cd MyApp
dotnet new mvvmexpress-page -n Catalog --namespace MyAppCreates a XAML page, ViewModel, service, AddCatalog(), and {Binding} / Command. Then map the route and call services.AddCatalog() in MauiProgram:
builder.UseMvvmExpress(o => o
.UseNavigationPage((nav, _) => nav
.Map<MainPageViewModel, MainPage>("home")
.Map<CatalogViewModel, CatalogPage>("catalog")
.Map<LoginViewModel, LoginPage>("login"))
.UseDialogs()
.UseAuth<LoginViewModel>());
builder.Services.AddCatalog();Move the ViewModel and service into MyApp.Core if you keep a shared / test split. Types that use [Notify] or [AsyncModelCommand] must stay partial.
After you scaffold
- Do not reconstruct GuardedNavigator — UseAuth<TChallenge>() already wraps it.
- Register an IAuthState adapter. The template uses an in-memory demo.
- Add Navigation, Dialogs, Validation, Pagination, Reactive, or Testing only when the screen needs them — the template already references the host set.
- Playground remains the cloneable 15-minute path if you want the in-repo sample instead of a new project.
Getting started walkthrough: Install and first screen