Center children in LayeredDigraphLayout (or use TreeLayout?)

Hi Walter,
I’ve moved my rerouting code to handler for Diagram’s LayoutCompleted event (which is activated for most changes) and it works ok. My only problem is that when not all of the graph is within the view, links to nodes that have been moved by the layout process are not rerouted. This is the code I use:

private void myDiagram_LayoutCompleted(object sender, DiagramEventArgs e)
{
    foreach (Link link in this.myDiagram.Links)
    {
        this.rerouteLinkIfNeeded(link);
    }
}

private void rerouteLinkIfNeeded(Link link)
{
    if (link.Category.Equals("DashedLink"))
    {
        double LeftMostCoordinate = link.Bounds.X;
        //find the left most vertex in the loop's subtree 
        foreach (Part VDescendant in (link.ToNode.Data as LoopNodeData).ManipulationAlgorithm.GetBelongingParts(
            link.ToNode).Where(x => x != link))
        {
            //Node descendantNode = this.Diagram.PartManager.FindNodeForData(VDescendant, this.Diagram.Model);
            //TreeVertex DescendantVertex = v.Network.FindVertex(descendantNode);
            if ((VDescendant != null) && (VDescendant.Bounds.Left < LeftMostCoordinate))
            {
                LeftMostCoordinate = VDescendant.Bounds.Left;
            }
        }
        //Get the edge that connects the end block to the loop
        Route newRoute = new Route();
        newRoute.AddPoint(new System.Windows.Point(link.Route.Points[0].X, link.Route.Points[0].Y));
        newRoute.AddPoint(new System.Windows.Point(LeftMostCoordinate - 20, link.Route.Points[0].Y));
        newRoute.AddPoint(new System.Windows.Point(LeftMostCoordinate - 20, link.Route.Points.LastOrDefault().Y));
        newRoute.AddPoint(new System.Windows.Point(link.Route.Points.LastOrDefault().X, link.Route.Points.LastOrDefault().Y));
        link.Route = newRoute;
        link.Remeasure();
    }

This is an example of what I get after a layout and links that need rerouting are not in view:

You can see that the dashed links have not been rerouted as they should have. Manually activating a layout afterwards, with the links in view fixes the routing.
Any idea why this happens and how I can solve it?
Thanks
Orr