示例#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();
     }
 }