I previously pointed out how easy it was to manipulate and then render a .dgml file in the upcoming VSTS 2010 Architecture product. I want to continue that discussion by showing how easy it is to indicate to the product that you need to see nodes contained inside another, and a few other niceties along the way.
So we had previously started with a graph that looked like this:
In order to tell the VSTS 2010 Architecture product's DGML rendering engine to draw a container around the "From" node, you first start by adding another Link element that has the Source attribute named "My Container" ( value doesn't matter ), and the Target attribute's value set to "From" ( this value does matter ). When you add that to your graph, you'll see this:
Not exactly containing the "From" node at this point, but we're not done. We need to add two more things to the markup.
The first step is to add a Category element to the Link element we just added, with a value of "Contains". Markup should now look like this:
The second step is to add a Nodes element with a single Node element contained inside, like so:
The resulting graph looks like this:
Let me point out a number of things, and bring them to your attention. In the image below, I've selected the contained "From" node:
That's it! I should also add that you can have as many levels of containment as you'd like. Hope that helps!
Cameron