예제 #1
0
        private async System.Threading.Tasks.Task AddList()
        {
            AreBtnsEn = false;
            string result = await Application.Current.MainPage.DisplayPromptAsync("New List",
                                                                                  "Insert new list name:");

            if (String.IsNullOrEmpty(result))
            {
                AreBtnsEn = true;
                return;
            }

            var addResult = await n_Restctrl.AddList(result);

            if (addResult.StatusCode == System.Net.HttpStatusCode.Created)
            {
                await Refresh();
            }
            else
            {
                await Application.Current.MainPage.DisplayAlert("Error",
                                                                "Something went wrong, check your connection", "Ok");
            }
            AreBtnsEn = true;
        }