private async void Init()
        {
            StatusQuestions = new ObservableCollection <StatusQuestionsCardModel>();
            BackToManagerQuestionsCommand = new RelayCommand(() => PopPushViewUtil.PopNavModalAsync <StatusSuggestionsView>(true));

            using IMaterialModalPage dialog = await MaterialDialog.Instance.LoadingDialogAsync("Recolhendo informaçoes...");

            IRestResponse response = await ManagerQuestionsService.StatusQuestionsTaskAsync();

            if (response.StatusCode == HttpStatusCode.OK)
            {
                (await DeselializeAsync(response)).ForEach(question =>
                {
                    StatusQuestions.Add(new StatusQuestionsCardModel
                    {
                        Question          = question,
                        ViewStatusCommand = new RelayCommand <IQuestion>(ViewStatus)
                    });
                });
            }
            else
            {
                await MaterialDialog.Instance.AlertAsync("Algo de errado nao está certo", "Ops");
            }
        }
Пример #2
0
 private async void CategoryChosenAsync(Button bt)
 {
     if (Enum.TryParse(bt.Text, out CategoryEnum result))
     {
         PopPushViewUtil.PopNavModalAsync <GameView>();
         await PopPushViewUtil.PushModalAsync(new NavigationPage(new GameView(result)), true);
     }
 }