private void AddNewStandardAction(NodeView nodeView) { AddEditStandardActionDialog dialog = new AddEditStandardActionDialog(); AddEditStandardActionViewModel viewModel = new AddEditStandardActionViewModel(); viewModel.DataLoaded += () => { dialog.DataContext = viewModel; }; viewModel.View = dialog; dialog.Show(); dialog.Closed += (s1, e1) => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { var standardAction = dialog.IssueStandardAction; AddStandardAction(nodeView, standardAction); } }; }
private void EditStandardAction(NodeView nodeView) { AddEditStandardActionDialog dialog = new AddEditStandardActionDialog(); dialog.Title = "Edit Standard Action"; AddEditStandardActionViewModel viewModel = new AddEditStandardActionViewModel(nodeView.Id) { View = dialog }; viewModel.DataLoaded += () => { dialog.DataContext = viewModel; Utils.ResetOriginalValues(dialog); dialog.Show(); }; dialog.Closed += (s1, e1) => { if (dialog.DialogResult.HasValue && dialog.DialogResult.Value) { UpdateCurrentNode(nodeView, dialog.IssueStandardAction); } }; }