public MainPageViewModel() { AccountServices.GetProfile().ContinueWith(x => CompleteProfile(x)); PemasanganService.GetItemsAsync().ContinueWith(x => CompletePemasangan(x)); PerubahanService.GetItemsAsync().ContinueWith(x => CompletePerubahan(x)); PengaduanService.GetItemsAsync().ContinueWith(x => CompletePengaduan(x)); }
private async void SaveAction(object obj) { try { if (IsBusy) { return; } IsBusy = true; var saved = await PemasanganService.AddItemAsync(Model); if (saved) { Helpers.ShowMessage("Permohonan Pemasangan Berhasil Dikirim"); ResetCommand.Execute(null); var app = await Helpers.GetMainPageAsync(); if (app != null) { app.SetCurrenttarget("Pemasangan"); } } } catch (Exception ex) { Helpers.ShowMessageError(ex.Message); } finally { IsBusy = false; } }