private void ExportAction_Execute(object sender, SimpleActionExecuteEventArgs e) { var winApplication = (WinApplication)Application; var form = ((WinWindow)winApplication.MainWindow).Form; string filePath; using (var dialog = new SaveFileDialog { Title = "Экспорт каталога", Filter = ExcelFilesFilter }) { if (dialog.ShowDialog(form) != DialogResult.OK) { return; } filePath = dialog.FileName; } Run(form, () => { using (var manager = new ExchangeManager()) { manager.Export(filePath); } }, "Экспорт каталога"); }