This sample was copied from the DragCreating Tool sample.

This uses an AutoShiftingLayout to ensure that for a node (including margin) that overlaps another node shifts the one on the right rightward, to just beyond the right edge of the left node.

This does not guarantee that there are no overlapping nodes.