public virtual void SaveFile(FileConfig config, Action<Stream> callback) { SaveFileDialog dialog = new SaveFileDialog(); if (config == null) config = this.CreateDefaultConfig(); dialog.FileName = config.FileName; dialog.Filter = config.Filter; dialog.Title = config.Title; if (dialog.ShowDialog(Application.Current.MainWindow) == true) { config.FileName = dialog.FileName; if (callback != null) { var stream = dialog.OpenFile(); callback.Invoke(stream); } } }
public void SaveFile(FileConfig config, Action<Stream> callback) { }
FileConfig CreateDefaultConfig() { var config = new FileConfig(); config.Title = "请选择保存的路径"; return config; }