Root TabbedPage
.AddSingleton<MultiPage<Page>, AdaptedTabbedPage>()using FunctionZero.Maui.MvvmZero;
using MvvmZeroTutorial.Mvvm.PageViewModels;
namespace MvvmZeroTutorial
{
public partial class App : Application
{
public App(IPageServiceZero pageService)
{
InitializeComponent();
// Don't forget to call pageService.Init, or navigation will not work properly!
pageService.Init(this);
MainPage = pageService.GetMultiPage(VmInitializer, typeof(ReadyPageVm), typeof(SteadyPageVm), typeof(GoPageVm));
}
private bool VmInitializer(object viewModel)
{
if (viewModel is ReadyPageVm)
return false; // Do not wrap the ReadyPage in a NavigationPage.
return true;
}
}
}Last updated