/// <summary> /// Create a new expression constraint. /// </summary> private void AddAllDifferentConstraintAction() { var allDifferentConstraintEditorViewModel = new AllDifferentConstraintEditorViewModel(Workspace.WorkspaceModel.Model); var result = this.windowManager.ShowDialog(allDifferentConstraintEditorViewModel); if (!result.GetValueOrDefault()) { return; } Workspace.AddAllDifferentConstraint(new AllDifferentConstraintBuilder().WithName(allDifferentConstraintEditorViewModel.ConstraintName) .WithExpression(allDifferentConstraintEditorViewModel.SelectedVariable) .Inside(Workspace.WorkspaceModel.Model) .Build()); }