private void Save() { if (SaveFileService.ShowDialog(Application.Current.MainWindow) == true) { using (var fileStream = new FileStream(SaveFileService.FileName, FileMode.Create)) { var modelSaver = new XmlModelSerializer(fileStream); modelSaver.Serialize(this.Document); } } }
private void Load() { if (OpenFileService.ShowDialog(Application.Current.MainWindow) == true) { using (var fileStream = new FileStream(OpenFileService.FileName, FileMode.Open)) { var modelSaver = new XmlModelSerializer(fileStream); this.Document = modelSaver.Deserialize(); } } }