async Task AddContractorCommandAct() { // prevent empty name if (ContractorName.Length == 0) { MessagingCenter.Send(this, "emptyContractor"); return; } // prevend same name for (int i = 0, len = ExistContractorList.Count; i < len; ++i) { if (ContractorName.Equals(ExistContractorList[i])) { MessagingCenter.Send(this, "duplicateContractor"); return; } } if (IsBusy) { return; } IsBusy = true; var isSucceed = await _taskService.AddNewContractor(ContractorName); IsBusy = false; if (isSucceed) { MessagingCenter.Send <AddContractorViewModel, String>(this, "AddContractor", ContractorName); await Navigation.PopAsync(); } else { MessagingCenter.Send(this, "AddContractorFailed"); } }