private void saveToFile_Click(object sender, RoutedEventArgs e) { //https://stackoverflow.com/questions/20993630/saving-xml-file-using-save-file-dialog SaveFileDialog saveFileDialog = new SaveFileDialog(); saveFileDialog.Filter = "XML-File | *.xml"; if (saveFileDialog.ShowDialog() == true) { File.WriteAllText(saveFileDialog.FileName, AnimeList.Serialize(anime)); } }
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { string aniem = AnimeList.Serialize(anime); File.WriteAllText("anime.xml", aniem); }