Здравствуйте, AlexDP, Вы писали:
как-то так
private void Export(string extension, Action<string> export)
{
TableView viewToWorkWith = GetViewToExportOrPrint();
Microsoft.Win32.SaveFileDialog dlg = new Microsoft.Win32.SaveFileDialog();
dlg.FileName = "Document"; // Default file name
dlg.DefaultExt = string.Format(".{0}", extension); // Default file extension
dlg.Filter = string.Format(".{0}|*.{0}", extension); // Filter files by extension
Nullable<bool> result = dlg.ShowDialog();
// Process save file dialog box results
if (result == true)
{
// Save document
string filename = dlg.FileName;
export(filename);
}
}