This project is read-only.

Set initial vertex position

Aug 27, 2010 at 10:33 PM

From what I read I know we can call GraphCanvas.SetX(vc, x) and GraphCanvas.SetY(vc, y) to set the vertex controls' positions.  We can get a list of VertexControls by calling GetVertexControl(vertex).  But I still couldn't get it work.    When I call GetVertexControl(vertex), it return null (I call GetVertexControl right after calling AddVertex).  I think I call GetVertexControl(vertex) too early.  If so, when should I call GetVertexControl(vertex) to overwrite the vertext position?   Is there a give to add vertexes with initial positions (like AddVertex(vertext, x, y) and skip running the layout algorithm?  Or, I have to let the layout algorithm run, then call GraphCanvas.SetX(vc,x) and GraphCanvas.SetY(vc.y) to overwrite the position?

Thanks.