public async void Execute(object parameter) { Acr.UserDialogs.PromptResult result = await Helpers.AlertsHelper.PromptAsync("Enter New Email User Name ..."); if (result.Ok && !string.IsNullOrEmpty(result.Value)) { App.MainViewModel.GetNewDisposableEmail(result.Value); Helpers.AlertsHelper.ShowShortToast("Email Address Changed !"); } }
/// <summary>Handle the device back button being pressed.</summary> /// <remarks>As this is the root page, we have to prevent the back button otherwise it will exit the application.</remarks> /// <returns>true; cancellation of back button.</returns> protected override bool OnBackButtonPressed() { // Begin an asynchronous task on the UI thread because we intend to ask the users permission. Device.BeginInvokeOnMainThread(async() => { Acr.UserDialogs.PromptResult trulyExit = await this.VM.DialogService.ShowPromptAsync("Exit?", "Are you sure you want to exit the app?", "Yes", "Cancel"); if (trulyExit.Ok) { base.OnBackButtonPressed(); Process.GetCurrentProcess().CloseMainWindow(); Process.GetCurrentProcess().Close(); } }); return(true); }