コード例 #1
0
        /// <summary>
        /// Common method to create the question text.
        /// </summary>
        private void CreateQuestionText(SurveyQuestion question, Panel view)
        {
            var printTextBlock = new TextBlock {
                Text = question.GetTextByLanguage("en")
            };

            view.Children.Add(printTextBlock);
        }
コード例 #2
0
        private void PrintComboboxAnswers(SurveyQuestion question, StackPanel view)
        {
            var selectQuestion = (SelectSurveyQuestion)question;
            var comboBox       = new ComboBox();

            foreach (var answer in selectQuestion.Answers)
            {
                comboBox.Items.Add(new ComboBoxItem {
                    Content = answer.GetTextByLanguage("en")
                });
            }
            view.Children.Add(comboBox);
        }
コード例 #3
0
        private void PrintRangeAnswers(SurveyQuestion question, StackPanel view)
        {
            var numericQuestion = (NumericSurveyQuestion)question;
            var slider          = new Slider
            {
                SelectionStart = numericQuestion.From,
                SelectionEnd   = numericQuestion.To,
                TickFrequency  = 1,
                TickPlacement  = TickPlacement.Both
            };

            view.Children.Add(slider);
        }
コード例 #4
0
        private void PrintCheckboxAnswers(SurveyQuestion question, StackPanel view)
        {
            var selectQuestion = (SelectSurveyQuestion)question;

            foreach (var answer in selectQuestion.Answers)
            {
                view.Children.Add(new CheckBox
                {
                    Content   = answer.GetTextByLanguage("en"),
                    IsChecked = answer.IsSelected
                });
            }
        }