The ViewBox provides you with a way to adjust the content of a window automatically, based on the resolution of the screen. When you resize the ViewBox, it automatically adjusts the size and the relative position of the contents to fit on the screen.
In the preceding example, the size of the window is set to 400x120. The window has a TextBlock control with a text string, wrapped in a ViewBox. When you resize the window, the content also resizes by applying scale transform.
But if the aspect ratio of the ViewBox window does not fit in proportion, you will see a white space either at the left and right or top and bottom of the content.