public override void Dispose()
        {
            base.Dispose();

            ViewportCalculator.TransformChanged -= OnViewportTransformChanged;
            DiagramService.DiagramChanged       -= OnDiagramChanged;

            ViewportCalculator.Dispose();
            MiniButtonPanelViewModel.Dispose();

            foreach (var diagramNodeViewModel in DiagramNodeViewModels)
            {
                diagramNodeViewModel.Dispose();
            }

            foreach (var diagramConnectorViewModel in DiagramConnectorViewModels)
            {
                diagramConnectorViewModel.Dispose();
            }
        }
        public void Dispose()
        {
            UnsubscribeFromViewportEvents();
            UnsubscribeFromDiagramEvents();
            UnsubscribeFromDiagramShapeButtonEvents();

            ViewportCalculator.Dispose();

            foreach (var diagramNodeViewModel in DiagramNodeViewModels)
            {
                diagramNodeViewModel.Dispose();
            }

            foreach (var diagramConnectorViewModel in DiagramConnectorViewModels)
            {
                diagramConnectorViewModel.Dispose();
            }

            foreach (var diagramShapeButtonViewModel in DiagramNodeButtonViewModels)
            {
                diagramShapeButtonViewModel.Dispose();
            }
        }
 public bool IsDiagramContentVisible() => ViewportCalculator.IsDiagramRectVisible();
 public void EnsureRectIsVisible(Rect rect, TransitionSpeed transitionSpeed = TransitionSpeed.Medium) => ViewportCalculator.ContainRect(rect, transitionSpeed);
 public void ZoomToRect(Rect rect, TransitionSpeed transitionSpeed          = TransitionSpeed.Medium) => ViewportCalculator.ZoomToRect(rect, transitionSpeed);
 public void ZoomToContent(TransitionSpeed transitionSpeed                  = TransitionSpeed.Medium) => ViewportCalculator.ZoomToContent(transitionSpeed);
 public void StopFollowingDiagramNodes() => ViewportCalculator.StopFollowingDiagramNodes();
 public void FollowDiagramNodes(IEnumerable <IDiagramNode> diagramNodes, TransitionSpeed transitionSpeed = TransitionSpeed.Slow)
 => ViewportCalculator.FollowDiagramNodes(diagramNodes, transitionSpeed);
 public void FollowDiagramNodes(IEnumerable <ModelNodeId> nodeIds, TransitionSpeed transitionSpeed = TransitionSpeed.Slow)
 => ViewportCalculator.FollowDiagramNodes(nodeIds, transitionSpeed);