private void Application_Startup(object sender, StartupEventArgs e) { // data => storage _students = MyStorage.ReadXml <ObservableCollection <Student> >("student.xml"); if (_students == null) { _students = new ObservableCollection <Student>(); //_students = GenerateStudents(10); } }
private void Application_Exit(object sender, ExitEventArgs e) { MyStorage.WriteXml <ObservableCollection <Student> >(_students, "student.xml"); }