Get Screen Resolution in Win10 UWP App

2019-01-07 10:23发布

As an UWP App runs in window mode on common desktop systems the "old" way of getting the screen resolution won't work anymore.

Old Resolution with Window.Current.Bounds was like shown in.

Is there another way to get the resolution of the (primary) display?

7条回答
啃猪蹄的小仙女
2楼-- · 2019-01-07 11:24

Just set a name for main Grid or Page and call its width or height for an element you want:

Element.Height = PagePane.Height;
Element.width = PagePane.Width;

it's the easiest way you can use!

查看更多
登录 后发表回答