Viewbox scaling in ElementHost
This post relates to the following forum post:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=721735&SiteID=1
I’m attempting to be able load XAML files into a Windows forms application at run time but for the WPF graphics to be automatically scaled to fit into the available form area. The intended approach is to place whatever UIElement is loaded from the XAML file within a Viewbox to perform the graphics scaling. The Microsoft forums don’t allow file attachments, so my blog is being used as an attachment staging point. A sample winforms project link follows.
http://torqsoftware.com/blogs/apolon/attachments/ElementHostExperiment.zip
The solution was built using the September RC1 bits. Run the application and then load up an all XAML files such as the Petzold clock. In Viewbox mode, I want the clock to scale with the form. Currently it doesn’t display anything in Viewbox mode.
http://www.charlespetzold.com/blog/2006/04/AllXamlClock.xaml