Following a discussion on the Metro/WinRT mailinglist I’ve decided to share a handy little code snippet. With different screen resolutions, aspect ratios and scaling you might need to display things differently, and maybe you would like to access the resolution and scale details in code/programmatically. Well, it’s actually quite easy:
//
double height = Windows.UI.Xaml.Window.Current.Bounds.Height;
double width = Windows.UI.Xaml.Window.Current.Bounds.Width;
ResolutionScale resolutionScale = DisplayProperties.ResolutionScale;
//

















Pingback: Dew Drop – July 18, 2012 (1,366) | Alvin Ashcraft's Morning Dew
Pingback: Windows 8 Developer Links – 2012-07-19Dan Rigby | Dan Rigby
You just saved my day! (again)
Thank you so much for that snippet! All I could find was way-to-advanced samples.