Hi !
After drawing my own nodes based on a DiagramNode (thx to Stoyo!!) I need some Anchorpoints.
I loaded your IconNode Sample and modify the code for the node creation:
private void diagram_Clicked(object sender, DiagramEventArgs e)
{
IconNode iconNode = new IconNode(diagram);
var apat2 = new AnchorPattern(new AnchorPoint[]
{
new AnchorPoint(10, 0, true, false, MarkStyle.Circle, Color.RoyalBlue),
new AnchorPoint(50, 0, true, false, MarkStyle.Circle, Color.Blue),
new AnchorPoint(90, 0, true, false, MarkStyle.Circle, Color.Firebrick),
new AnchorPoint(10, 100, false, true, MarkStyle.Rectangle),
new AnchorPoint(50, 100, false, true, MarkStyle.Rectangle),
new AnchorPoint(90, 100, false, true, MarkStyle.Rectangle),
new AnchorPoint(0, 50, true, true, MarkStyle.Custom)
});
iconNode.AnchorPattern = apat2;
diagram.Nodes.Add(iconNode);
iconNode.Move(e.MousePosition.X, e.MousePosition.Y);
}
I need to show the Anchorpoints always so I try setting "ShowAnchors" to "Always".
But the result is that the points are gone. If set it back to selection I see the points when I hover over the node with the mouse.
The next problem is the snapping. I need always the same Anchorpoints. So I set SnaptToAnchor to "OnCreate". But if you run the above code, create 2 nodes, link them you could a nive effect.
Move one node around the other and you will see that the link is snapping
Maybe I did something completely wrong but I can´t find any hints in the help which pointing to some known issues.
And one last question about AnchorPoints. Is it a problem to replace the Points if the drawing of the node changes? I have a node where I can enable / disable an additional text. This causes some changes in the Draw methode. So can I change the positions of the Anchors within the Draw methode of my node?
Greetz
Dominik