private void OnShowRelatedNodesRequested(RelatedNodeMiniButtonViewModel ownerButton, IReadOnlyList <IModelNode> modelNodes) { switch (modelNodes.Count) { case 0: return; case 1: ShowModelItemsRequested?.Invoke(modelNodes, followNewDiagramNodes: true); break; default: HideRelatedNodeListBox(); ShowModelItemsRequested?.Invoke(modelNodes, followNewDiagramNodes: true); break; } }
private void OnShowRelatedEntitiesRequested(ShowRelatedNodeButtonViewModel diagramNodeButtonViewModel, IReadOnlyList <IModelEntity> modelEntities) { switch (modelEntities.Count) { case 0: return; case 1: var diagramNodes = Diagram.ShowModelItems(modelEntities).OfType <IDiagramNode>().ToArray(); FollowDiagramNodes(diagramNodes); break; default: HideRelatedEntityListBox(); ShowModelItemsRequested?.Invoke(modelEntities); break; } }
private void OnRelatedNodeSelected(IModelNode modelNode) { StopFollowingDiagramNodes(); ShowModelItemsRequested?.Invoke(new[] { modelNode }, followNewDiagramNodes: false); }
private void SubscribeToDiagramViewModelEvents(DiagramViewModel diagramViewModel) { diagramViewModel.ShowSourceRequested += i => ShowSourceRequested?.Invoke(i); diagramViewModel.ShowModelItemsRequested += i => ShowModelItemsRequested?.Invoke(i); }
private void OnRelatedNodeSelected(IRelatedNodeItemViewModel relatedNodeItemViewModel) { StopFollowingDiagramNodes(); ShowModelItemsRequested?.Invoke(new[] { relatedNodeItemViewModel.Id }, followNewDiagramNodes: false); }