Ejemplo n.º 1
0
 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));
 }
Ejemplo n.º 2
0
        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;
            }
        }