C# – WPF Gui that changes size with window


Does anybody have a suggestion on how to create a gui that can change size with the size of the window. Similar to how Media Center works. If media center is maximized the fonts etc increase in size. So the gui is always "uniform"?

Best Solution

You'll need a Viewbox as your outermost container if you want everything including fonts and images to resize. By default the Stretch property of the Viewbox is set to Uniform which means everything maintains a relative aspect ratio and fills the direction that would clip it first.

Here's an example from MSDN displaying the effects of the various Stretch values.

alt text
(source: microsoft.com)