public override AttachToProgramOptions[] Show(ShowAttachToProcessDialogOptions options) { AttachToProcessVM vm = null; try { var dlg = new AttachToProcessDlg(); vm = new AttachToProcessVM(options, uiDispatcher.Value, dbgManager.Value, debuggerSettings.Value, programFormatterProvider.Value, classificationFormatMapService, textElementProvider, attachProgramOptionsAggregatorFactory.Value, () => SearchHelp(vm, dlg)); dlg.DataContext = vm; dlg.Owner = appWindow.MainWindow; var res = dlg.ShowDialog(); if (res != true) { return(Array.Empty <AttachToProgramOptions>()); } return(vm.SelectedItems.Select(a => a.AttachProgramOptions.GetOptions()).ToArray()); } finally { vm?.Dispose(); } }
void SearchHelp(AttachToProcessVM vm, DependencyObject control) => messageBoxService.Show(vm.GetSearchHelpText(), ownerWindow: Window.GetWindow(control));