internal async void Filter(string result) { try { if (IsBusy) { return; } IsBusy = true; await Task.Delay(300); SourceView.Clear(); var results = await LayananServices.GetItemsAsync(); foreach (var item in results.Where(O => O.Kategori.Nama == result)) { SourceView.Add(item); } } finally { IsBusy = false; } }
private async void RefreshAction(object obj) { await Task.Delay(300); try { if (IsBusy) { return; } IsBusy = true; SourceView.Clear(); var results = await LayananServices.GetItemsAsync(); var group = results.GroupBy(O => O.Kategori.Nama); kategori.Clear(); kategori.Add("All"); foreach (var d in group) { kategori.Add(d.Key); } foreach (var item in results) { SourceView.Add(item); } } finally { IsBusy = false; } }
internal async void Filter(string result) { try { if (IsBusy) { return; } IsBusy = true; await Task.Delay(300); SourceView.Clear(); if (result != "Cancel" && result != "All") { var results = await LayananServices.GetItemsAsync(); foreach (var item in results.Where(O => O.Kategori.Nama == result)) { SourceView.Add(item); } } else if (result == "All") { RefreshCommand.Execute(null); } } finally { IsBusy = false; } }
private async void RefreshAction(object obj) { try { await Task.Delay(300); IsBusy = true; SourceView.Clear(); var results = await InboxServices.GetItemsAsync(PermohonanId); foreach (var item in results) { SourceView.Add(item); } } catch (Exception ex) { Helper.ShowMessageError(ex.Message); } finally { IsBusy = false; } }