Dragging nodes in and out of a GoSubGraph

If the “drop” (defined by mouse cursor) happens over another object, it’s not a Background drop. Look for the GoView.ObjectSelectionDropped event.

Another small thing…

I have set the FillEllipseGradient of the Border on my BoxArea. If I then drag two nodes into theboxarea and then I drag a link between the two nodes, the link is not visible. If I drag the two nodes out of the boxarea, the link is then visible, and if I drag them back into the boxarea, the link is still visible.
I've debugged this and it looks like when the link is first created, it gets add as the first object in the boxarea group of objects. So the Border gets drawn after the link, overwriting it. If you drag the nodes out, and back in again, then the link gets added as the last object in the group and gets drawn ok.
What can I do about this?

Yes, the behavior when adding links via GoToolLinkingNew to GoSubGraphBase objects is to add them “behind” everything else, so in the case of BoxArea, which uses a separate GoRoundedRectangle for a background, the links end up behind the background (the sample uses a null brush, so it isn’t an issue in the sample).



add this to the BoxArea.LayoutChildren



GoObject border = this.Border; /// Existing code



// New code



if (border != null) {

// make sure the border is behind everything else

if (this[0] != border) InsertBefore(null, border);

}



that should be all you need to do.

cheers!