async void ButtonSave_Clicked(object sender, EventArgs e) { //If Paid Invoice, then no need to action if (string.IsNullOrWhiteSpace(buttonSave.Text)) { return; } //Show the loading page var loadingPage = new LoadingPage(); await PopupNavigation.PushAsync(loadingPage); var vm = BindingContext as JobsPageViewModel; if (vm != null) { var success = await vm.SaveJobDetails(); if (success) { loadingPage.ShowSuccess(); await Task.Delay(2000); await Task.WhenAll( PopupNavigation.PopAsync(), Navigation.PopAsync(true) ); } } }
public AddClientPage() { InitializeComponent(); BindingContext = new AddClientPageViewModel(); buttonAddClient.Clicked += async(sender, e) => { var loadingPage = new LoadingPage(); await PopupNavigation.PushAsync(loadingPage); var vm = BindingContext as AddClientPageViewModel; if (vm != null) { var success = await vm.AddClient(); if (success) { loadingPage.ShowSuccess(); await Task.Delay(2000); //Pop both the success and the add new client pages await PopupNavigation.PopAllAsync(); } } }; }
async void ButtonJobAction_Clicked(object sender, EventArgs e) { var loadingPage = new LoadingPage(); await PopupNavigation.PushAsync(loadingPage); var vm = BindingContext as JobsPageViewModel; if (vm != null) { var success = await vm.ExecuteJobAction(); if (success) { loadingPage.ShowSuccess(); await Task.Delay(2000); await Task.WhenAll( PopupNavigation.PopAsync(), Navigation.PopAsync(true) ); } } }