Sure, here is the relevant snippet:
Code:
int? scaleFactor = null;
var content = Application.Current.Host.Content;
var scaleFactorProperty = content.GetType().GetProperty("ScaleFactor");
if (scaleFactorProperty != null)
{
scaleFactor = scaleFactorProperty.GetValue(content, null) as int?;
}
if (scaleFactor == null)
scaleFactor = 100;
_width = _width * (double)scaleFactor / 100.0;
_height = _height * (double)scaleFactor / 100.0;
if (scaleFactor == 150)
{
graphics.PreferredBackBufferHeight = 450;
graphics.PreferredBackBufferWidth = 800;
}
Also detect if you are running on Windows Phone 8 first.