async Task <bool> ExecuteLoadCandidateList(ContactCandidateRequest model) { if (IsBusy) { return(true); } IsBusy = true; try { CandiateList.Clear(); var CandidateResultFromStore = await DataStore.GetCandidateAsync(model); if (CandidateResultFromStore == null) { CandidateResultFromStore = new List <ContactDTO>(); } foreach (var item in CandidateResultFromStore) { CandiateList.Add(item); } } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } return(true); }
async Task <bool> ExecuteClearCandidateList() { if (IsBusy) { return(true); } IsBusy = true; try { await Task.Factory.StartNew(() => { CandiateList.Clear(); }); } catch (Exception ex) { Debug.WriteLine(ex); } finally { IsBusy = false; } return(true); }