private void CreateNew() { var model = new AlertAndWorkDialogViewModel(null); var view = new AlertAndWorkDialog { DataContext = model, Owner = Application.Current.MainWindow }; model.SetView(view); view.ShowDialog(); RefreshAlerts(); }
private void Open(object sender) { var selectedItem = sender as AlertDto; if (selectedItem == null) { return; } var model = new AlertAndWorkDialogViewModel(selectedItem); var view = new AlertAndWorkDialog { DataContext = model, Owner = Application.Current.MainWindow }; model.SetView(view); if (view.ShowDialog() == true) { RefreshAlerts(); } }