Register your new content
... using statements omitted for brevity ...
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseMvvmZero(
serviceBuilder =>
{
serviceBuilder
.MapVmToView<ReadyPageVm, ReadyPage>()
.MapVmToView<SteadyPageVm, SteadyPage>()
.MapVmToView<GoPageVm, GoPage>()
.MapVmToView<DetailPageVm, DetailPage>();
}
)
...Note: A common misconception is that using Singleton Pages consumes vast amounts of memory, because after all, a fully realised ContentPage can have a large footprint. In Maui, cross-platform controls are lightweight wrappers around platform controls, and these controls are only instantiated when they are part of the visual tree.
ContentPage can have a large footprint. In Maui, cross-platform controls are lightweight wrappers around platform controls, and these controls are only instantiated when they are part of the visual tree.Last updated