示例#1
0
        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();
        }
示例#2
0
 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();
 }