Hi Stoyo
It is not working as expected.
Please find the attached code and try to reposition the nodes. Anchor points are changing only for the selected node.\
private ShapeNode CreateApplication(string appName)
{
ShapeNode appNode = new ShapeNode(diagram1);
appNode.Text = appName;
appNode.Bounds = new Rect(new Size(200, 70));
diagram1.Nodes.Add(appNode);
return appNode;
}
void diagram1_NodeModified(object sender, NodeEventArgs e)
{
diagram1.RoutingOptions.Anchoring = Anchoring.Reassign;
diagram1.LinkRouter.RouteLinks(e.Node.GetAllLinks());
}
private void LoadCustom(object sender, RoutedEventArgs e)
{
diagram1.ClearAll();
ShapeNode app5 = CreateApplication("Item5");
ShapeNode app6 = CreateApplication("Item6");
ShapeNode app7 = CreateApplication("Item7");
DiagramLink link1 = diagram1.Factory.CreateDiagramLink(app7, app5);
link1.Dynamic = true;
link1 = diagram1.Factory.CreateDiagramLink(app7, app6);
link1.Dynamic = true;
//new LayeredLayout() { LinkType = LayeredLayoutLinkType.Cascading, KeepGroupLayout = true, MultipleGraphsPlacement = MultipleGraphsPlacement.MinimalArea }.Arrange(diagram1);
new OrthogonalLayout() { KeepGroupLayout = true, MultipleGraphsPlacement = MultipleGraphsPlacement.MinimalArea }.Arrange(diagram1);
}
With LayeredLayout, Anchor point gets changed only for selected node and since the other node to which selected node is linked, anchor point doen't get changed it results in more segement line than expected ( For eq. when possible with 2 segement , line generated is 5 segement overlapping other lines )
With OrthogonalLayout it doen't change the anchor points at all with added code.
What I would like is with OrthogonalLayout ( I think the complex diagram generated with Orthogonal layout is more nice than LayeredLayout)
Update: What I observed in layered layout is that, if orignial anchor point is top, it always gets changed to top/botton depending on the position and never set to left or right anchor point.Regards
Rajesh