示例#1
0
 public EditQuestionWindow(int id, TestsWindow testWindow)
 {
     InitializeComponent();
     data            = DataLoad.LoadDataFromJson();
     this.id         = id;
     this.testWindow = testWindow;
     QObject         = DataLoad.GetQuestionById(this.id);
     SetDefaultValues();
 }
示例#2
0
 public EditTestsWindow(TestsWindow testWindow)
 {
     //загружаем список вопросов
     InitializeComponent();
     data            = DataLoad.LoadDataFromJson();
     this.testWindow = testWindow;
     if (data != null)
     {
         var types     = DataLoad.GetQuestionTypes();
         var allThemes = DataLoad.GetQuestionThemes();
         foreach (var type in types)
         {
             TestTypes.Items.Add(type);
         }
     }
 }
        public CreateTestWindow(TestsWindow win)
        {
            InitializeComponent();
            data     = DataLoad.LoadDataFromJson(); //получаем данные из json
            this.win = win;                         //ссылка на главное окно с тестами

            if (data != null)
            {
                var types     = DataLoad.GetQuestionTypes();
                var allThemes = DataLoad.GetQuestionThemes();
                id = DataLoad.GetMaxQuestionId();

                //добаляем темы и типы тестов в списки
                foreach (var type in types)
                {
                    TestTypes.Items.Add(type);
                }
                foreach (var theme in allThemes)
                {
                    Theme.Items.Add(theme);
                }
            }
        }
示例#4
0
        private void Button_Click_Tests(object sender, RoutedEventArgs e)
        {
            TestsWindow win = new TestsWindow();

            win.ShowDialog();
        }