private async System.Threading.Tasks.Task DeleteTask(string taskid) { AreBtnsEn = false; bool answer = await Application.Current.MainPage.DisplayAlert("Delete", "Are you sure?", "Yes", "No"); if (answer) { var deleteResult = await n_Restctrl.DeleteTask(taskid); if (deleteResult.StatusCode == HttpStatusCode.OK) { await Refresh(); } else if (deleteResult.StatusCode == HttpStatusCode.Unauthorized) { await Application.Current.MainPage.DisplayAlert("Sorry", "You do not have permission to do this", "Ok"); } else { await Application.Current.MainPage.DisplayAlert("Error", "Something went wrong, check your connection", "Ok"); } } AreBtnsEn = true; }