Vatyx
Topic Author
Posts: 9
Joined: 15 May 2023, 22:41

Recommended workflow for dealing with multiple resolutions?

21 Jul 2023, 14:26

What is the recommended workflow when trying to make your UI look nice at multiple resolutions? Specifically, I would like my UI to be built for 1920x1080 and then have all other resolutions be scalings of that resolution. This goes for font size, width, height, etc.
 
User avatar
sfernandez
Site Admin
Posts: 3364
Joined: 22 Dec 2011, 19:20

Re: Recommended workflow for dealing with multiple resolutions?

24 Jul 2023, 12:39

There are 2 alternatives depending on the UI layout you need.

- If the UI can be split in several zones/cells, then you can use a Grid to split your screen in relative columns/rows, and then place the UI inside the corresponding cells wrapped by Viewboxes:



- If there are different aspect ratios depending on the resolution and your UI cannot be split that way, then you should use LayoutTransform with a ScaleTransform in your UI root to handle the UI scale:



Please let me know if you need more help with any of this.
 
Vatyx
Topic Author
Posts: 9
Joined: 15 May 2023, 22:41

Re: Recommended workflow for dealing with multiple resolutions?

03 Aug 2023, 22:22

Thank you so much for the examples, I will try them out. Can you go into a bit more detail about what LayoutTransform actually does? I did look it up but I think you may be able to shed more direct light on how it fixes this particular problem with aspect ratios.
 
User avatar
sfernandez
Site Admin
Posts: 3364
Joined: 22 Dec 2011, 19:20

Re: Recommended workflow for dealing with multiple resolutions?

06 Aug 2023, 19:02

The LayoutTransform just scales the available space (resolution), but keeping the aspect ratio, so the UI adapts as if you were changing the window size.
In the xamltoy example I posted you can see the wrapped text adjusts depending on the available width and independently of the scale applied to the LayoutTransform. This is very useful to stretch different parts of the UI without affecting the scale of the content.

Who is online

Users browsing this forum: Bing [Bot] and 3 guests