public MainWindow() { InitializeComponent(); /* No editing until an exam is opened or created */ DisableEverything(); Exam = null; }
private void OpenMenuItem_Click(object sender, RoutedEventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.DefaultExt = ".xml"; dlg.Filter = "XML documents (.xml)|*.xml"; bool? result = dlg.ShowDialog(); if (result == true) { Exam = new Exam(dlg.FileName); ExamSectionListBox.ItemsSource = Exam.Sections; ExamSectionCreate.IsEnabled = true; } }
/* MENU BAR CALLBACKS */ private void NewMenuItem_Click(object sender, RoutedEventArgs e) { Exam = new Exam(); ExamSectionListBox.ItemsSource = Exam.Sections; ExamSectionCreate.IsEnabled = true; }