Example #1
0
 private void DettachNewTestEvents(EditingTestViewModel viewModel)
 {
     viewModel.ChangesCancelledEvent -= CancelNewTest;
     viewModel.ChangesSavedEvent -= SaveNewTest;
 }
Example #2
0
 private void DettachEditingEvents(EditingTestViewModel editingViewModel)
 {
     editingViewModel.ChangesCancelledEvent -= RequestedChangesCancelled;
     editingViewModel.ChangesSavedEvent -= RequestedChangesSaved;
 }
Example #3
0
        private void AddNewTest()
        {
            EditingTestViewModel viewModel
                = new EditingTestViewModel(
                    new Domain.Test(),
                    _testValidator,
                    _questionValidator,
                    _answerValidator,
                    _subjectValidator,
                    _subjectQuery
                );

            AttachNewTestEvents(viewModel);

            DataContext = viewModel;

            IsEditing = true;
        }
Example #4
0
        private void BeginEditingTest(TestViewModel vm)
        {
            EditingTestViewModel editingViewModel =
                new EditingTestViewModel(
                    vm.Test, _testValidator,
                    _questionValidator,
                    _answerValidator,
                    _subjectValidator,
                    _subjectQuery
                );

            AttachEditingEvents(editingViewModel);

            DataContext = editingViewModel;

            IsEditing = true;
        }