A simple one but a good one nonetheless. Often you draw things on the artboard like this;

and these elements are currently living in my LayoutRoot container which is a Grid but maybe I want to group these items into some other kind of container so I can just multi-select them with a quick swipe;


and then either use the Object->Group Into option from the main menu or the right mouse menu;

which gives you easy access to group these all up into whatever kind of container you like. If you group into something like a Grid then you might have hoped that Blend would make rows/columns in order to try and contain your content but that’d be a pretty tricky thing for it to figure out and so instead it leaves the Grid as a single cell and just puts margins in place for the content;

if you made a mistake and actually wanted to group into some other kind of container you can easily swap it for (e.g.) a Canvas;

and Blend will substitute the margin values that it was using in the Grid into Canvas.Left, Canvas.Top values that it uses in a Canvas. Naturally, if you now went completely crazy and replace that Canvas with a StackPanel then there’s only so much Blend can do to preserve your original layout;

but it’s nice to see that it even tries to convert back to margins and do the right thing in such a different layout container.
Lastly, if I revert back to that Grid layout then I find that my beautiful drawing ( signed copies are available from the artist direct for only $1200
) does not scale itself too nicely although Blend has set all 4 margins on the content so it does scale to some extent;

but I could easily take the Grid and group it into a new Viewbox container;

and then, that will scale quite nicely;

although it may well be overkill to scale all those vectors like that.
Short, sweet and simple.
Posted
Fri, Jan 7 2011 12:30 PM
by
mtaulty