예제 #1
0
        public TestEdit(Tests test)
        {
            TestEditViewModel viewModel = new TestEditViewModel(test);
            this.DataContext = viewModel;
            InitializeComponent();

        }
예제 #2
0
        public TestEditViewModel(Tests test)
        {
            _currentTest = test;
            _currentQuestion = new QuestionModel();
            _testQuestions = new ObservableCollection<QuestionModel>();

        }
예제 #3
0
 private async void btnAddTest_Click(object sender, RoutedEventArgs e)
 {
     int id;
     string name = await this.ShowInputAsync("Name", "Please, enter test name", null);
     if(name != null)
     {
         using (var context = new QuizDBEntities())
         {
             id = context.Tests.ToList().Select(t => t.id).Max() + 1;
         }
         Tests test = new Tests();
         test.id = id;
         test.name = name;
         var view = new TestEdit(test);
         this.Close();
         view.Show();
     }
 }