Is there any way to move GraphLayout (Canvas)?

Jun 21, 2011 at 10:01 PM
Edited Jun 21, 2011 at 10:02 PM

Hi all,

         Is there any way to move (programmatically) GraphLayout (Canvas) in order that a target Vertex is in center of screen?

         Thanks a lot for help.

Jun 22, 2011 at 5:22 PM

Actually it is nothing to do with GraphLayout but ZoomControl.

So the following code does the trick:

double x = GraphCanvas.GetX(vertex);
double y = GraphCanvas.GetY(vertex);
zoomCtrl.TranslateX = -(x - zoomCtrl.OrigoPosition.X);
zoomCtrl.TranslateY = -(y - zoomCtrl.OrigoPosition.Y);