Lacju
Lacju

Reputation: 91

UI Scaling/Settings

I've been working on a UWP application that will initially be deployed only to Surface Pro 4 (Maybe some SP3s) devices but I'm having a real difficult time getting my UI to fit on the screen.

Right now my Designer window is set to '12" Tablet (2160 x 1440) 150% Scale' with it locked in landscape mode (the only way this app will be used) so that the 'Effective: 1440 x 960' resolution is set.

I've got my MainPage page set to 960 x 1440 with a Frame for display content essentially filling the entire 960 x 1440 but when I run the app (either in full screen or windowed) it cuts off the content of my MainPage (not just the frame content but part of my app sidebar menu).

That all being said my question(s): How do I get my UWP to scale my content to fit inside what ever size window the app is displayed in when running (full screen or user adjusted window size), OR what settings do I need/How do I configure it to display my entire MainPage contents on my SP4 screen (2736 x 1824) in fullscreen without just trial/error adjusting elements manually until they fit.

I'm more concerned with the second question because I don't just want this app to do what I want (because I know I can figure it out myself by manually sizing elements) but I want to understand why it's doing what it's doing and the right way to go about doing what I want to do.

I did a lot of searching but could not find the answer to my question, if this is a duplicate please feel free to link the answer.

Thanks in advance.

Upvotes: 2

Views: 534

Answers (1)

Justin XL
Justin XL

Reputation: 39006

The Designer just gives you a general guide on how things would look. The demensions are not for SP4 specifically.

At 150% DPI, try setting your MainPage to 1824, 1216.

You can call

ApplicationView.GetForCurrentView().VisibleBounds

at runtime to find how many pixels(epx) that your screen is currently set to.

Note that these are effective pixels. They are different from the physical pixels of the device. All UWP UI measurements are epx based. So when you see this -

<Button Width="24" />

You should know that the value 24 is measured in epx.

To find out what epx really is, give this a read.

Upvotes: 2

Related Questions