Пример #1
0
 private void SwitchQuestionVisibility()
 {
     base.RaisePropertyChanged("Questions");
     if (NewQuestionVisibility == Visibility.Collapsed)
     {
         NewQuestionVisibility = Visibility.Visible;
     }
     else
     {
         NewQuestionVisibility = Visibility.Collapsed;
         textQuestion          = new TextQuestionVM();
         sliderQuestion        = new SliderQuestionVM();
         base.RaisePropertyChanged("textQuestion");
         base.RaisePropertyChanged("sliderQuestion");
     }
 }
Пример #2
0
 public void SwitchEditQVisibility()
 {
     {
         base.RaisePropertyChanged("Questions");
         if (EditQuestionVisibility == Visibility.Collapsed)
         {
             EditQuestionVisibility = Visibility.Visible;
         }
         else
         {
             EditQuestionVisibility = Visibility.Collapsed;
             textQuestion           = new TextQuestionVM();
             sliderQuestion         = new SliderQuestionVM();
             base.RaisePropertyChanged("textQuestion");
             base.RaisePropertyChanged("sliderQuestion");
         }
     }
 }
Пример #3
0
        //TODO questionnumber, make question string separate
        public MainViewModel()
        {
            textQuestion   = new TextQuestionVM();
            sliderQuestion = new SliderQuestionVM();
            Questions      = new ObservableCollection <Question>();

            foreach (QuestionTypes q in Enum.GetValues(typeof(QuestionTypes)))
            {
                QuestionType.Add(q);
            }


            SwitchNewQuestionVisibility  = new RelayCommand(SwitchQuestionVisibility);
            SwitchEditQuestionVisibility = new RelayCommand(SwitchEditQVisibility);
            SaveNewTextQuestion          = new RelayCommand(SaveTextQuestion);
            SaveNewSliderQuestion        = new RelayCommand(SaveSliderQuestion);
            DeleteSelectedQuestion       = new RelayCommand(DeleteQuestion);
        }