public void ShowQuestion(int idx, Question question, int count)
        {
            // It ensures that focus is set after window is initialized
            UIUserControlUtil.SetFocus(Content);

            Content.Text = question.Content;
            Answer.Text  = question.Answer;

            Index.Content = idx.ToString();
            Count.Content = count.ToString();

            if (idx == 1)
            {
                PreviousQuestion.Opacity = 0.1;
            }
            else
            {
                PreviousQuestion.Opacity = 1;
            }

            if (idx == count)
            {
                NextQuestion.Opacity = 0.1;
            }
            else
            {
                NextQuestion.Opacity = 1;
            }
        }
Exemple #2
0
        public MainUIControl()
        {
            InitializeComponent();
            controller = new MainController(this);

            // Focusing on control inside UserControl let KeyDown event
            // work (e.g. escape key)
            UIUserControlUtil.SetFocus(OpenFile);
        }
Exemple #3
0
        public void ShowQuestion(Question question)
        {
            UIUserControlUtil.SetFocus(AnswerToTry);

            QuestionContent.Text = question.Content;

            AnswerToTry.Text = "";

            ResultContent.Text = "";

            ActionButton.Content = "Check";
            ActionButton.Click  -= ActionButton_NextClick;
            ActionButton.Click  += ActionButton_CheckClick;
        }