public static Window ShowSelectDialog(WpfWindow owner) { var viewModel = new SelectViewModel(); var win = new SelectWindow { DataContext = viewModel, Owner = owner }; viewModel.LoadWindows(); return(win.ShowDialog().GetValueOrDefault() ? viewModel.SelectedWindow : null); }
private void OnDoClick(object sender, RoutedEventArgs e) { var wnd = SelectWindow.ShowSelectDialog(this); if (wnd != null) { image.Source = wnd.Icon; textBlock.Text = wnd.Title; textBlock1.Text = wnd.Class; textBlock2.Text = wnd.ExeName; } }