Exemplo n.º 1
0
        private void LoadToLabels(Question test)
        {
            if (test == null)
            {
                return;
            }
            questionTextBlock.Text = test.AskQuestion;

            if (test.Picture != null)
            {
                image1.Source = UInterfaceHelper.GetImageSource(test.Picture);
            }
            image1.Visibility = test.Picture != null ? Visibility.Visible : Visibility.Hidden;

            var hash = new List <string>(0);

            hash.AddRange(test.AnswerList);
            //-----------------
            for (var i = 0; i < _radioButtonsList.Count; i++)
            {
                var rb  = _radioButtonsList[i];
                var rec = _recList[i];
                rb.Background = new SolidColorBrush(Const.LigthBackgroundColor);
                rec.Fill      = new SolidColorBrush(Const.LigthBackgroundColor);
                //rec.Fill = new SolidColorBrush(Const.LigthBackgroundColor );

                _tbList[i].Text = GetRandomItem(hash, i);
                // rb.Content = GetRandomItem(hash, i);
                // hash.Remove((string) rb.Content);
                hash.Remove(_tbList[i].Text);
            }
            //---------------------------
        }
Exemplo n.º 2
0
        private void CheckButton_Click(object sender, RoutedEventArgs e)
        {
            if (_currentQuestion == null)
            {
                return;
            }

            for (var index = 0; index < _radioButtonsList.Count; index++)
            {
                var rb = _radioButtonsList[index];
                var tb = (TextBlock)rb.Content;
                if (tb.Text == _currentQuestion.CorrectAnswer)
                {
                    UInterfaceHelper.PaintBackColor(_recList[index], true);

                    //tb.Background = new SolidColorBrush(Const.CorrectColor);
                    //_tbList[index].Background = new SolidColorBrush(Const.CorrectColor);
                }
                else if (rb.IsChecked ?? false)
                {
                    UInterfaceHelper.PaintBackColor(_recList[index], false);
                    //tb.Background = new SolidColorBrush(Const.IncorrectColor);
                }
            }
        }
Exemplo n.º 3
0
 private void StartAgainMenuItem_OnClick(object sender, RoutedEventArgs e)
 {
     if (_fileName == "")
     {
         return;
     }
     UInterfaceHelper.SetText(InformationLabel, "");
     UInterfaceHelper.SetText(serviceTextBox, Const.FileProcessing);
     LoadSettings();
 }