Hi, I’m evaluating GoDiagram and I have a few questions. I would like to create a node that is a cross between a ClassDiagram Node and the CollapsableRecord Node that are in the Demo1 sample.
What I mean by cross is that I would like the node to look like the ClassNode with a header and description, chevron button on the right-side, and the whole node shape have a gradient-filled background. But I also want the collapsable items to have in/out ports, like the RecordNode node, and I want to have an image icon on the left of the header title.
Would my best approach be to try and get a gradient full background to work with the CollapsableRecord Node where the record items have transparent backgrounds, or to try and add left/right ports to the classitems in the ClassNode? Sorry, I don’t have the sample code in front of me at the moment to convey the accurate names.
I didn’t expect to be in for so much coding, I had hoped it would be less, but GoDiagram has a very full API so simplifying it anymore would probably just water it down too much. So I just have to get through he learning curve I guess. Hopefully, this is the right product for my project. We’ll see.

If you want tree structure and ports-per-item, you definitely want to use CollapsingRecordNode.
It should be relatively simple to change the appearance. I’ll take a look at the code when I get a chance.

Well, the linear gradient you can get very easily by changing the CollapsingRecordNodeItemList to inherit from LinearGradientListGroup instead of from GoListGroup, and by changing the CollapsingRecordNodeItem constructor to set its own Brush to null. The first change provides a gradient background; the second change makes the items transparent, to let that gradient show through.
Then you’ll probably want to play with the StartColor and EndColor of the CollapsingRecordNodeItemList that is created in CreateBody. And you might not want to have each item that is a header have it own brush, so you should take out the Brush assignment in the Init method of CollapsingRecordNodeItem.
You can increase the Height of the body.Header that is created in that CollapsingRecordNode.CreateBody method. By default each of those items has a fixed size, but you can make that one taller so there’s room for more text. Of course you can change the Label’s TextColor and font properties, too. Having multiple GoText objects there should be do-able, just by creating and initializing them, and Add’ing them to the body.Header at the right position. (But I haven’t tried that…)
Regarding the positioning of the chevron collapsing handle, that’s basically done in the definition of CollapsingRecordNodeItem.LayoutChildren, where “h” is not null. It also requires the proper setting of the TopLeftMargin and BottomRightMargin, which is partly done in the Init method. It currently reserves extra space on the left if it’s a header – you’ll want to change the BottomRightMargin.Width instead. But note that changing these two methods in CollapsingRecordNodeItem will change the appearance of all items that contain handles/buttons. You’ll need to special case it so that it knows whether the handle is supposed to be on the left (the default) or on the right.
So there are three or four trivial code changes to get the colors the way you might want them to be. Changing the handle position and the topmost header’s text will take several lines of code each.

Where do I find a LinearGradientListGroup class? It’s not in any of the samples and not in the Northwoods.Go namespace. Thanks.

Sorry about that–it’s in the newer version of ClassDiagramNode, which you can get via: