I have my shell
<ShellContent
ContentTemplate="{DataTemplate pages:StartupPage}"
Shell.FlyoutBehavior="Disabled"
Route="StartupPage"
Shell.FlyoutItemIsVisible="False" />
<ShellContent
ContentTemplate="{DataTemplate pages:LoginPage}"
Shell.FlyoutBehavior="Disabled"
Route="LoginPage"
Shell.FlyoutItemIsVisible="False" />
<ShellContent
ContentTemplate="{DataTemplate pages:NoInternetPage}"
Shell.FlyoutBehavior="Disabled"
Route="NoInternetPage"
Shell.FlyoutItemIsVisible="False" />
<FlyoutItem
FlyoutDisplayOptions="AsMultipleItems"
Route="WelcomePage">
<ShellContent
Title="Welcome"
ContentTemplate="{DataTemplate pages:WelcomePage}" />
<ShellContent
Title="Join meeting"
ContentTemplate="{DataTemplate pages:JoinMeetingPage}" />
<ShellContent
Title="Manage Course"
ContentTemplate="{DataTemplate pages:ManageCoursePage}" />
<ShellContent
Title="New Lecture"
ContentTemplate="{DataTemplate pages:NewLecturePage}" />
<ShellContent
Title="New Test"
ContentTemplate="{DataTemplate pages:NewTestPage}" />
<ShellContent
Title="Schedule lecture"
ContentTemplate="{DataTemplate pages:ScheduleLecturePage}" />
<ShellContent
Title="Schedule test"
ContentTemplate="{DataTemplate pages:ScheduleTestPage}" />
<ShellContent
Title="Assigned courses"
ContentTemplate="{DataTemplate pages:NotificationsPage}" />
</FlyoutItem>
</Shell>
the first page, is the startupPage
private readonly StartupPageViewModel startupPageViewModel;
public StartupPage(StartupPageViewModel startupPageViewModel) {
InitializeComponent();
this.startupPageViewModel = startupPageViewModel;
BindingContext = startupPageViewModel;
}
protected override async void OnAppearing() {
base.OnAppearing();
await startupPageViewModel.CheckInternet();
}
}
I also have the vm
public class StartupPageViewModel(IAppService appService, IConnectivity connectivity) : BaseViewModel {
public async Task CheckInternet() {
if(connectivity.NetworkAccess is not NetworkAccess.Internet) {
await appService.NavigateTo($"//{nameof(NoInternetPage)}");
} else {
await appService.NavigateTo($"//{nameof(LoginPage)}");
}
}
}
and the app
public App(AppShell shell) {
InitializeComponent();
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense(Constants.LICENSE);
MainPage = shell;
}
}
but I get the error
Pending Navigations still processing