Пример #1
0
        private void AnswerButtonOnClick(object sender, EventArgs eventArgs)
        {
            //if (PlaceActivity.ViewModel.PlaceComplete)
            //{
            //    //Place code below in here
            //}
            //Finish();
            //OverridePendingTransition(Resource.Animation.slide_in_down, Resource.Animation.slide_in_down);

            messages.AskQuestions("Question:", PlaceActivity.ViewModel.Place.Question, (answer) =>
            {
                PlaceActivity.ViewModel.CheckAnswer(answer);
                //if (QuestActivity.ViewModel.QuestComplete)
                //{
                //    cancelButton.Visibility = ViewStates.Invisible;
                //    answerButton.SetText(Resource.String.continue_game);
                //    labelHint.SetText(Resource.String.continue_quest);
                //    labelAwesome.SetText(Resource.String.thats_it);
                //    labelCongrats.SetText(Resource.String.correct_answer);
                //    //Settings.QuestDone = true;
                //}
            });

            //Answer Question
            //PlaceActivity.ViewModel.CheckAnswer(answer);
        }
Пример #2
0
 private void ExecuteExtraTaskCommand()
 {
     if (CodeRequired)
     {
         messages.EnterTextMessage("Enter Code", "Find the code and enter it below!", CheckCode);
     }
     else if (QuestionRequired)
     {
         messages.AskQuestions("Question!", quest.Question, CheckAnswer);
     }
 }
Пример #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            App.CurrentActivity = this;
            messages            = ServiceContainer.Resolve <IMessageDialog>();
            SetContentView(Resource.Layout.quest_question);
            // Create your application here

            var cancelButton = FindViewById <Button>(Resource.Id.button_cancel);

            cancelButton.Click += (sender, args) =>
            {
                Finish();
                OverridePendingTransition(Resource.Animation.slide_in_down, Resource.Animation.slide_out_down);
            };

            var answerButton  = FindViewById <Button>(Resource.Id.button_answer);
            var labelHint     = FindViewById <TextView>(Resource.Id.hint);
            var labelAwesome  = FindViewById <TextView>(Resource.Id.awesome);
            var labelCongrats = FindViewById <TextView>(Resource.Id.congrats);

            labelHint.Text      = QuestActivity.ViewModel.Quest.Question.Text;
            answerButton.Click += (sender, args) =>
            {
                if (QuestActivity.ViewModel.QuestComplete)
                {
                    Finish();
                    OverridePendingTransition(Resource.Animation.slide_in_down, Resource.Animation.slide_out_down);

                    return;
                }

                messages.AskQuestions("Question:", QuestActivity.ViewModel.Quest.Question, (answer) =>
                {
                    QuestActivity.ViewModel.CheckAnswer(answer);
                    if (QuestActivity.ViewModel.QuestComplete)
                    {
                        cancelButton.Visibility = ViewStates.Invisible;
                        answerButton.SetText(Resource.String.continue_game);
                        labelHint.SetText(Resource.String.continue_quest);
                        labelAwesome.SetText(Resource.String.thats_it);
                        labelCongrats.SetText(Resource.String.correct_answer);
                        Settings.QuestDone = true;
                    }
                });
            };

            var questNumber = FindViewById <TextView>(Resource.Id.text_quest_number);

            questNumber.Text = QuestActivity.ViewModel.CompletionDisplayShort;
        }
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            App.CurrentActivity = this;
            messages = ServiceContainer.Resolve<IMessageDialog>();
            SetContentView(Resource.Layout.quest_question);
            // Create your application here

            var cancelButton = FindViewById<Button>(Resource.Id.button_cancel);
            cancelButton.Click += (sender, args) =>
            {
                Finish();
                OverridePendingTransition(Resource.Animation.slide_in_down, Resource.Animation.slide_out_down);
            };

            var answerButton = FindViewById<Button>(Resource.Id.button_answer);
            var labelHint = FindViewById<TextView>(Resource.Id.hint);
            var labelAwesome = FindViewById<TextView>(Resource.Id.awesome);
            var labelCongrats = FindViewById<TextView>(Resource.Id.congrats);
            labelHint.Text = QuestActivity.ViewModel.Quest.Question.Text;
            answerButton.Click += (sender, args) =>
            {
                if (QuestActivity.ViewModel.QuestComplete)
                {
                    Finish();
                    OverridePendingTransition(Resource.Animation.slide_in_down, Resource.Animation.slide_out_down);
      
                    return;
                }

                messages.AskQuestions("Question:", QuestActivity.ViewModel.Quest.Question, (answer) =>
                    {
                        QuestActivity.ViewModel.CheckAnswer(answer);
                        if (QuestActivity.ViewModel.QuestComplete)
                        {
                            cancelButton.Visibility = ViewStates.Invisible;
                            answerButton.SetText(Resource.String.continue_game);
                            labelHint.SetText(Resource.String.continue_quest);
                            labelAwesome.SetText(Resource.String.thats_it);
                            labelCongrats.SetText(Resource.String.correct_answer);
                            Settings.QuestDone = true;
                        }
                    });

            };

            var questNumber = FindViewById<TextView>(Resource.Id.text_quest_number);
            questNumber.Text = QuestActivity.ViewModel.CompletionDisplayShort;
        }
        private void ButtonContinue_Click(object sender, RoutedEventArgs e)
        {
            if (QuestPage.ViewModel.QuestComplete)
            {
                NavigationService.GoBack();
                return;
            }

            messages.AskQuestions("Question:", QuestPage.ViewModel.Quest.Question, (answer) =>
            {
                QuestPage.ViewModel.CheckAnswer(answer);
                if (QuestPage.ViewModel.QuestComplete)
                {
                    ButtonCancel.Visibility = System.Windows.Visibility.Collapsed;
                    ButtonContinue.Content  = "continue";
                    Hint.Text          = "Are you ready to continue with the next quest, thrill-seeker?";
                    Awesome.Text       = "That's it!";
                    Congrats.Text      = "You answered the question correct, noble one.";
                    Settings.QuestDone = true;
                }
            });
        }