Articles in this section
Category / Section

How to bring the specific object to the center or viewport of the Diagram in UWP?

1 min read

The BringIntoCenter and BringIntoViewport methods will assist you to bring the diagramming elements to the center or viewport of the diagram. The methods are exposed in the Info property of diagram and diagramming elements.


This can be achieved by specifying the bounds of Node or Connector in the respective methods. The following code example demonstrates the same.



            (diagram.Info as IGraphInfo).BringIntoCenter((node.Info as INodeInfo).Bounds);
            (node.Info as INodeInfo).BringIntoCenter();
            (connector.Info as IConnectorInfo).BringIntoCenter();
            (diagram.Info as IGraphInfo).BringIntoViewport((node.Info as INodeInfo).Bounds);
            (node.Info as INodeInfo).BringIntoViewport();
            (connector.Info as IConnectorInfo).BringIntoViewport();
Here, the diagram is the instance of SfDiagram.
Here, the node is the instance of Node.
Here, the connector is the instance of Connector.



I hope you enjoyed learning about how to bring the specific object to the center or viewport of the diagram.

You can refer to our UWP Diagram feature tour page to know about its other groundbreaking feature representations and documentation, and how to quickly get started for configuration specifications. You can also explore our UWP Diagram example to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied