I want to have my HMI application automatically scale in size when the user changes the size of the application or it is run on different PC with different screen resolution.

Use a ViewBox in the Window XAML code.

When you create a WPF application by default the first container in the window is a Grid. Each container has an opening and closing statement in the XAML file.

For example:

All of your content will be in the grid.

To create a window with resizable content add a ViewBox to the window and put the grid in the ViewBox.


Select the view box and set the stretch property the way you want the application to respond. The options are None, Fill, Uniform and Uniform to Fill. The default is uniform.