Hosting the Windows Forms Designer for Things Other than Controls

The .NET framework supports hosting a design environment for forms.


This is interesting stuff - this framework support is what's used in Visual Studio .NET, making it really easy to make your own applications that allow users to design forms.  This is how a number of other .NET IDEs have managed to look and feel so much like VS.NET - they gave us the pieces VS.NET is made from.


There isn't a lot of good Microsoft documentation on exactly how you do it, but there are some good articles on the net - here's a good one called Hosting Windows Forms Designers


The design environment, once you've got it set up, seems like it would be ideal for working on any collection of 2D objects - you drop your object on the surface, and the designer takes care of the UI for dragging it around and editing properties. 


However, it really is only suited to designing forms, or other surfaces that contain controls. 


I did some tests of trying to use this for a simple 2D shape editor, and for one thing, there's no way to “zoom in” or “zoom out”.  Even if you did implement shapes that supported the required interfaces, you'd just have shapes you could put on a form (nothing wrong with that I guess, but that's not what I wanted). 


But the architecture is well thought out, and very flexible, so I ended up implementing something very much like it, but with more of a 2D imaging flavour.  The surface contains the “design objects” which are things that know how to visually edit other objects, which know how to draw themselves. 


This got me wondering if this is something that would make sense as a “common control” of sorts - a surface that let you place objects on it that was designed for any 2D object, not just controls, and that supported things like printing, zooming, rotating..


I'd certainly find it useful.