private void MoveViewport() { if (_followedNodeIds == null) { return; } var rect = DiagramService.GetRect(_followedNodeIds).ToWpf(); if (rect.IsUndefined()) { return; } switch (Mode) { case ViewportAutoMoveMode.Center: ZoomToRect(rect, _followNodesTransitionSpeed); break; case ViewportAutoMoveMode.Contain: ContainRect(rect, _followNodesTransitionSpeed); break; } }