How to get the resolution of screen? For a WinRT app?

a_rahmanshah picture a_rahmanshah · May 31, 2012 · Viewed 40.1k times · Source

I want to know the screen resolution so that I can set the height of an element according to the resolution in a Windows 8 app.

Answer

Krishna picture Krishna · May 31, 2012

How about this?

var bounds = Window.Current.Bounds;

double height = bounds.Height;

double width = bounds.Width;