1.GoRoundedRectangle
object as a background and visible border;
2.GoText
object at the top-left conner to display its name;
3.A
Port (derived from GoPort) object on the top-left corner also.
I tried to override the LayoutChildren to layout the above
children in this method.
The problem I encountered is that Layouting the Port object
inside the LayoutChildren blocks the resizing. The behavior is that the left
and the top sides can be increased but cannot be decreased. No problem to
resize right and bottom sides.
If the Port position is set out of the LayoutChildren, it
works OK.
Implementations of this method probably should not refer, directly or indirectly, to this group's GoObject.Bounds property. Instead, you should just position and size the children based on the bounds of the children (not this group's bounds), and let this group's bounds be determined by the union of the bounds of the children.
For groups that may have many children, overrides will often check the GoObject.Initializing flag. If true, this method usually does nothing; later when all the changes have been performed is that flag set to false and this method is called explicitly with a null argument.
so, I can't explain why the port is causing the problem, but I'd look first to the use of this.Bounds. Look at how BoxArea.cs in Demo1 works.