Thank you for the additional info. I promise I am almost done asking questions
Let me show you my current code as well as a couple of example videos. The first example video shows you what is being produced by my current code. The second example video shows you the kind of experience I am hoping to have in my app.
First, here is my current code:
public MainPage()
{
InitializeComponent();
var node1 = diagram.Factory.CreateShapeNode(10, 20, 40, 30);
node1.EnabledHandles = AdjustmentHandles.ResizeBottomCenter;
node1.Text = "Hello,";
node1.HandlesStyle = HandlesStyle.HatchHandles3;
node1.AnchorPattern = new AnchorPattern()
{
Points = new AnchorPointCollection()
{
new AnchorPoint(0, 33, true, false),
new AnchorPoint(0, 66, true, false),
new AnchorPoint(100, 50, false, true)
}
};
var node2 = diagram.Factory.CreateShapeNode(80, 90, 40, 30);
node2.EnabledHandles = AdjustmentHandles.ResizeBottomCenter;
node2.Text = "World!";
node2.HandlesStyle = HandlesStyle.HatchHandles3;
node2.AnchorPattern = new AnchorPattern()
{
Points = new AnchorPointCollection()
{
new AnchorPoint(0, 33, true, false),
new AnchorPoint(0, 66, true, false),
new AnchorPoint(100, 50, false, true)
}
};
var link1 = diagram.Factory.CreateDiagramLink(node1, node2);
link1.Shape = LinkShape.Cascading;
link1.AutoRoute = true;
link1.HeadBrush = MindFusion.Drawing.Brushes.Red;
link1.HeadShape = Shapes.Rectangle;
link1.BaseShape = Shapes.Rectangle;
link1.BaseBrush = MindFusion.Drawing.Brushes.Red;
link1.RetainForm = false;
link1.Pen = new Pen(Colors.Red, 1.0);
diagram.Behavior = MindFusion.Diagramming.Behavior.PanAndModify;
diagram.RouteLinks = true;
diagram.LinkRouter = new GridRouter();
diagram.AlignToGrid = true;
diagram.ShowGrid = true;
diagram.GridSizeX = 10;
diagram.GridSizeY = 10;
diagram.GridStyle = GridStyle.Lines;
diagram.ShowAnchors = ShowAnchors.Always;
diagram.SnapToAnchor = SnapToAnchor.OnCreateOrModify;
}
That code generates a diagram that looks like and interacts like what you see in this video:
https://www.youtube.com/watch?v=IDrZndu6560&feature=youtu.beAs you notice, the "base" of the link does not appear to be even initially attached to the source node, which seems like an issue. Also, something is wrong with the algorithm that is routing the link: this link should easily be routed in 3 segments. It should be a horizontal line coming out of the source node, then a vertical line doing down, and then a horizontal line going into the destination node. Finally, when I move the nodes around, there is also some weird behavior. I would expect the link to re-route intelligently, but it seems like what's happening is the link is staying fairly static and only the final segment of the link is changing its angle.
To show you the kind of interaction/behavior I am looking for, I made another video in which I use an app called Lucid Chart to create a simple 2 node diagram with a link between the two nodes, and then I move the nodes around. Here is the video:
https://www.youtube.com/watch?v=w2taMRQSwn0&feature=youtu.beHow can I achieve the same behaviors that you can see in that 2nd video?
Namely:
1. The link should have the correct number of segments (I know I can set the "SegmentCount" property on the link, but I shouldn't have to tell it how many segments it should have. It should figure that out intelligently).
2. The link should re-route intelligently as I move nodes around.
3. The link should appear correctly.