Hi,
I would like to create a ContainerNode and have a number of nodes inside it that are laid out side by side.
If I run the following code;
// create the container
_container = new ContainerNode();
_container.Bounds = new Rect(new Point(50, 50), new Size(250, 75));
diagram.Nodes.Add(_container);
// add the first node
var node1 = new ShapeNode();
node1.Bounds = new Rect(new Point(0, 0), new Size(50, 50));
diagram.Nodes.Add(node1);
_container.Add(node1);
// add the second node - this is side-by-side with the first node which is good
var node2 = new ShapeNode();
node2.Bounds = new Rect(new Point(50, 0), new Size(50, 50));
diagram.Nodes.Add(node2);
_container.Add(node2);
... this creates a ContainerNode with two nodes side by side.
If I then move the ContainerNode to a new position in my diagram and run this code;
// add a third node - this should be alongside the other two nodes, but it isn't
var node3 = new ShapeNode();
node3.Bounds = new Rect(new Point(100, 0), new Size(50, 50));
diagram.Nodes.Add(node3);
_container.Add(node3);
.. what I am finding is that the third node is not side by side with the others - it is in a different place entirely. This only happens if I move the ContainerNode inbetween adding the first two nodes and the third.
Why are the nodes not being placed in the positions that I have specified?
Thanks
Matt