示例#1
0
 private void SetLayer(Models.Question q)
 {
     if (q.Type == typeof(bool))
     {
         SetLayerBool();
     }
     if (q.Type == typeof(Models.Answer))
     {
         SetLayerAnswer();
     }
     if (q.Type == typeof(int))
     {
         SetLayerInt();
     }
 }
示例#2
0
 private void Next()
 {
     if (question.Next != null)
     {
         question = question.Next;
         SetQuestion(question);
         return;
     }
     //TBQuestion.Text = "Результат...";
     //TextEnd.Text = "Ваша стриальная машина: " + vm_is.GetWasher();
     //SetLayerEnd();
     SetLayerEnd();
     itemResult.ItemsSource = vm_is.GetOffers();
     LayerOffers.IsEnabled  = true;
     LayerOffers.Visibility = Visibility.Visible;
     this.Width             = 800;
     this.Height            = 600;
 }
示例#3
0
 private void SetQuestion(Models.Question q)
 {
     question        = q;
     TBQuestion.Text = question.Value;
     if (q.Type == typeof(Models.Answer))
     {
         SPAnswer.Children.Clear();
         foreach (var ans in q.Answers)
         {
             var button = new Button()
             {
                 Content = ans.Value,
                 Margin  = new Thickness(20, 10, 20, 10)
             };
             button.Click += Button_Click_Answer;
             button.Tag    = ans;
             SPAnswer.Children.Add(button);
         }
     }
     SetLayer(q);
 }