/// <summary> /// Save the graph onto xml file /// </summary> private void SaveToFile() { SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "XML file (*.xml) | *.xml"; if (dialog.ShowDialog() == true) { CanvasGraphXML output = new CanvasGraphXML(); output.Save(dialog.FileName, graph); } }
private void MenuItem_Click(object sender, RoutedEventArgs e) { // TODO //string xmlFileContents = "Some testing string"; SaveFileDialog dialog = new SaveFileDialog(); dialog.Filter = "XML file (*.xml) | *.xml"; if (dialog.ShowDialog() == true) { CanvasGraphXML output = new CanvasGraphXML(); string savePath = System.IO.Path.GetDirectoryName(dialog.FileName); // Save to file output.Save(savePath, CGraph); } }