Ejemplo n.º 1
0
        async Task LoadQuestions()
        {
            IsBusy = true;

            try
            {
                // Add the questions
                questions = (await service.GetQuestionsAsync()).ToList();
                foreach (var q in questions)
                {
                    questionPicker.Items.Add(q.Question);
                }

                questionPicker.SelectedIndex = 0;
            }
            catch (Exception ex)
            {
                await this.DisplayAlert("Error", "Failed to download questions: "
                                        + ex.Message, "OK");
            }
            finally
            {
                IsBusy = false;
            }
        }