Beispiel #1
0
        private void BtnEditClass_Click(object sender, RoutedEventArgs e)
        {
            var window = new AddSubjectWindow();

            window.Owner = this;
            window.WindowStartupLocation = WindowStartupLocation.CenterOwner;

            SUBJECT changedSubject = ViewModelLocator.SubjectsListViewModel.SelectedSubject as SUBJECT;

            window.DataContext = changedSubject;

            var result = window.ShowDialog();

            if (result == true)
            {
                ViewModelLocator.SubjectsListViewModel.EditSubject(changedSubject);
            }
        }
Beispiel #2
0
        private void BtnAddClass_Click(object sender, RoutedEventArgs e)
        {
            var window = new AddSubjectWindow();

            window.Owner = this;
            window.WindowStartupLocation = WindowStartupLocation.CenterOwner;

            SUBJECT newSubject = new SUBJECT();

            window.DataContext = newSubject;

            var result = window.ShowDialog();

            if (result == true)
            {
                ViewModelLocator.SubjectsListViewModel.AddNewSubject(newSubject);
            }
        }