Scale an entire WPF window

Hank picture Hank · Feb 16, 2011 · Viewed 39.8k times · Source

I have a WPF application that I am going to be demoing to an audience on a large, high-resolution projector, and I am worried that the application will be too small to see from afar.

Is there a simple way to make the ENTIRE application bigger (like the zoom slider in the WPF designer, that lets you zoom in?) I tried adding a layout transform to the Window in XAML, like so:

<Window.LayoutTransform>
    <ScaleTransform ScaleX="1.5" ScaleY="1.5" CenterX=".5" CenterY=".5" />
</Window.LayoutTransform>

which makes the window look bigger in the designer, but seems to have no effect on the running application.

I figure this should be dead simple with WPF's "resolution independence", high-tech text rendering, vector graphics, etc.

(I know I can use a screen zooming tool, but that's lame since it makes everything fuzzy, and always makes me dizzy when the presenter pans around the screen.)

Answer

Hank picture Hank · Feb 16, 2011

Just realized that putting the transform on the top-level control (a Grid, in my case), instead of on the window itself, has a similar effect to what I was looking for. The only difference is that the window size doesn't change so everything looks a little cramped, but that is easily remedied by making the window larger.