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

            AttachNewTestEvents(viewModel);

            DataContext = viewModel;

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

            AttachEditingEvents(editingViewModel);

            DataContext = editingViewModel;

            IsEditing = true;
        }