public void Show(ViewModelBase viewModel) { var dialogView = new DialogView { DataContext = viewModel, Title = viewModel.Title }; viewModel.CloseCmd = new RelayCommand(dialogView.Close); dialogView.Loaded += viewModel.OnLoaded; dialogView.Show(); }
public bool? ShowDialog(ViewModelBase viewModel) { var dialogView = new DialogView { Owner = Application.Current.MainWindow, Title = viewModel.Title, DataContext = viewModel, ShowInTaskbar = false, }; viewModel.CloseCmd = new RelayCommand(dialogView.Close); return dialogView.ShowDialog(); }