Erroneous copying of GoObjects

My application uses nodes extending GoBoxNode I will refer to as GNodes. The Body of GNode holds two GoListGroup which might expand and collapse. Every GNode has its Port.IsValidTo and Port.IsValidFrom set to false and instead got 4 ports added: NorthPort, SouthPort, WestPort and EastPort. Each port is positioned exactly on the border of the GNode.Port and get re-positioned after any collapse/expand operation via LayoutChildren(…).

If I create an instance of GNode and add it to my GoDocument everything works fine. However, if I create a copy of GNode (called faultyNode below) and adding it to the Document by calling

Doc.AddCopy(faultyNode, dropNodePoint);
the position of the four ports doesn't get changed as soon as I collapse/expand a GoListGroup of faultyNode.

The same applies if I copy a whole GoDocument containing GNodes and work on the GNodes of the copied GoDocument.

Why is this so and how can I change the default behaviour other than creating another copy of GNode manually?

You probably need a CopyChildren override. See what NodeLinkDemo InfoNode does.

Yep that was it. I solved the problem, although I already had the CopyChildren() overriden and it copied over the ports. The problem was that I have multiple nodes extending GNode which also had CopyChildren() overriden, but it didn’t call base.CopyChildren(). Rather stupid but your mentioning of CopyChildren() brought me on the right track. Thank you.