Collapsible Container Node

I want to have a Collapsible container control like mindfusion’s one.I want a node exactly like it , a bar with title(like win form) which is its handle. user can add other nodes on it and when user moves it all its contents move with it. Do you have any built-in node in this regard?


Nothing exactly like that, although I can put one together.

What does the collapsed node look like? Does the width collapse to the title, or does it stay the same width?

It collapses to the width of title(caption).

See attached file.20101221_160754_TitleBarSubGrap.txt

Note this doesn’t support setting the SubGraph to Resize=true and letting the user resize the subgraph with the resize handles.

oh, pooh. I read your note earlier wrong. What I’ve coded remains the same width on expand/collapse.

Well, give it a try, see what you think.

Hi Jake
Thanks. But there are some problems with it:
1.End user can’t drop other nodes inside it
2.Initial width and height: it should have initial size for example 300*200 to let end user drop other nodes inside it
3.user should be able to move items/nodes inside it
4.there should be some space between title bar and contents(add a node to see what is wrong)


  1. just a matter of adding an OnSelectionDropped handler, like BoxArea in NodeLinkDemo.

    2. ok… I’ll work on that.

    3. you can do that. Create a couple of nodes and subgraph.Add(node) them.

    4. yup. ok.

    Bumping up against a holiday here, not sure if I’ll get this done before Santa comes. What’s your timeframe?

Hi Jake
It is very good for me if you could do it before holidays.


OK, Collapsing SubGraphs really want to collapse to the margins when there aren’t any children, so I stole a little bit of LimitedSubGraph from NodeLinkDemo (see the comments in that code). The little resize handles give the user control over the minimum dimensions of an “empty” subgraph, so I think it’s a nice feature. And it gives you an option on (2) above to set the min width/height.

I’ve added Drag-in with OnSelectionDropped.

I haven’t added drag-out. I’m not sure whether you want drag-out or “make the subgraph bigger” to be the default when you drag a node inside a subgraph.

and I’ve fixed 4.

I didn’t change the collapse to just collapse to the title width. After playing with it over the last 2 days, I’ve become pretty attached to the width staying the same, it just “feels” better.

File attached here: 20101223_100240_TitleBarSubGrap.txt

Here’s a screenshot.

To get a gradient background, you’d have to override PaintDecoration, as it only supports solid colors with an Opacity with now.

Hi Jake
Thanks,It works great! How I can find out that user has dropped a node on it? and what it is? it handles it itself, But I want to change that node’s ContainerID.