Exemplo n.º 1
0
 public void SetAllOtherToFalse(ChoiceForChoiceQuestionViewModel choiceNotFalse)
 {
     foreach (ChoiceForChoiceQuestionViewModel choice in Choices)
     {
         choice.IsChosen = (choice == choiceNotFalse);
     }
 }
Exemplo n.º 2
0
        public ChoiceQuestionViewModel(AppShell appShell, ChoiceQuestion choiceQuestion)
        {
            this.Question   = choiceQuestion.QuestionText;
            this.BaseObject = choiceQuestion;
            this.Title      = "Otázka " + NumberOfQuestion;
            NumberOfQuestion++;
            this.AppShell        = appShell;
            this.ConfirmQuestion = new Command(OnAnswerConfirmed);

            Choices = new ObservableCollection <ChoiceForChoiceQuestionViewModel>();

            foreach (ChoiceForChoiceQuestion choice in choiceQuestion.Choices)
            {
                var newChoice = new ChoiceForChoiceQuestionViewModel(this, choice);
                Choices.Add(newChoice);
            }

            FlyOutItem = new FlyoutItem()
            {
                Title = this.Title,
                Icon  = "icon_question.png",
            };

            TextQuestionPage = new ChoiceQuestionPage(this)
            {
                Title = this.Title
            };

            ShellContent = new ShellContent {
                Content = TextQuestionPage
            };

            FlyOutItem.Items.Add(ShellContent);
        }