private async void RefreshAction(object obj) { await Task.Delay(1000); try { if (IsBusy) { return; } IsBusy = true; Source.Clear(); var result = await PengaduanService.GetItemsAsync(); foreach (var item in result) { if (item.Petugas != null && !string.IsNullOrEmpty(item.Petugas.Nama)) { item.ShowPetugas = true; } Source.Add(item); } } catch (Exception ex) { Helpers.ShowMessageError(ex.Message); } finally { IsBusy = false; } }
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)); }