private async System.Threading.Tasks.Task AddTask() { AreBtnsEn = false; string taskName = await Application.Current.MainPage.DisplayPromptAsync("New Task", "Insert new task name:"); if (String.IsNullOrEmpty(taskName)) { return; } Models.Task newTask = new Models.Task(ListID, taskName); var addResult = await n_Restctrl.AddTask(newTask); if (addResult.StatusCode == HttpStatusCode.Created) { await Refresh(); } else if (addResult.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; }