简体   繁体   中英

How to scale window according to screen resolution in UWP?

I am new to Stackoverflow as well as UWP (My English is regular too). I apologize in advance for my bad writing.

I am developing a windows application in UWP / C# . My monitor size is 23' and it is set to 1920x1080 (100%) resolution.

图 1

As seen in image 1, I have configured the application in such a way that the size of the main frame is 1920x1080, therefore, when I run the application on my computer it looks perfectly (see image 2).

图 2

However, when I run the application on another computer with a smaller screen size (17 "), it looks like in image 3, where it can be seen that the application does not fit this size. It seems to keep the original size and mi application "does not fit on the screen". 图 3

My question is: how do I program the application so that it does not lose its shape, distribution, aspect ratio, or proportion when it is run on screens that are different in size from the computer on which it was programmed? In this way, it automatically adjusts to the resolution and scale of the screen, without losing the original proportion and distribution with which it was programmed and designed.

Thank you very much for your help and understanding.

EDIT 1: I am not looking for the content of the application to fit a change of the window, but rather to fit screens of different sizes. That is, the same content, distribution and proportion are scaled to fit on any screen size, as evidenced in image 3 that does not happen. (see Image 4)

I don't want the image 3 to happen.

图 4

The control doing exactly what you want is called ViewBox , but as people already suggested above, it would be better to design adaptive UI using triggers or at least grids.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM