Use this method to set the points for each link:
private void SetLinkPoints(DiagramLink link, params Point[] points)
{
link.AutoRoute = false;
link.Style = LinkStyle.Cascading;
link.ControlPoints.Clear();
link.ControlPoints.AddRange(points);
link.UpdateFromPoints(false, true);
}
Then handle four cases:
- links in the left column
- links between the left column and the center node
- links in the right column
- links between the right column and the center node
and set the points respectively. E.g. for links in the right column:
Rect or = link.Origin.Bounds;
Rect dr = link.Destination.Bounds;
float dist = 10;
SetLinkPoints(link,
new Point(or.Right, or.Top + or.Height / 2),
new Point(or.Right + dist, or.Top + or.Height / 2),
new Point(or.Right + dist, dr.Top + dr.Height / 2),
new Point(dr.Right, dr.Top + dr.Height / 2));
I hope that helps,
Stoyan