Hello,
Welcome to Microsoft Q&A!
The better way is that set LoginPage as MainPage at first ,and then change App.Current.MainPage
upon login successfully .
App
MainPage = new LoginPage();
LoginPageViewModel
private async void TokenLogin()
{
string user = Tokenizer.GetTokenUser();
string token = Tokenizer.GetToken();
if(userData.TokenLogin(user, token))
{
App.Current.MainPage = new AppShell();
}
}
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.