CB-8750 [wp8]: Rewrite resoultion helper

This commit is contained in:
sgrebnov 2015-04-25 14:56:39 -07:00
parent 9549ce3a9d
commit 00e8999eeb

View File

@ -22,38 +22,17 @@ namespace WPCordovaClassLib.Cordova.Commands
public static class ResolutionHelper
{
private static bool IsWvga
{
get
{
return Application.Current.Host.Content.ScaleFactor == 100;
}
}
private static bool IsWxga
{
get
{
return Application.Current.Host.Content.ScaleFactor == 160;
}
}
private static bool IsHD
{
get
{
return Application.Current.Host.Content.ScaleFactor == 150;
}
}
public static Resolutions CurrentResolution
{
get
{
if (IsWvga) return Resolutions.WVGA;
else if (IsWxga) return Resolutions.WXGA;
else if (IsHD) return Resolutions.HD;
else throw new InvalidOperationException("Unknown resolution");
switch (Application.Current.Host.Content.ScaleFactor)
{
case 100: return Resolutions.WVGA;
case 160: return Resolutions.WXGA;
case 150: return Resolutions.HD;
}
throw new InvalidOperationException("Unknown resolution");
}
}
}