Hello,
I want the code to wait so the user will read the message and click on the DisplayAlert button.
You can do this by Task.ContinueWith Method. And change the mainpage to Signin page, you need to run it on the Main thread, please refer to following code.
await App.Current.MainPage.DisplayAlert("Congratulations", "Your account is now active.", "Sign in").ContinueWith( (continueAction) =>
{
if (continueAction.IsCompleted)
{
MainThread.BeginInvokeOnMainThread(() =>
{
// Code to run on the main thread
App.Current.MainPage = new NavigationPage(new Signin());
});
}
});
Best Regards,
Leon Lu
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
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.