使用经典案例
public class LowMemoryHelper
{
public static bool IsLowMemDevice { get; set; }
static LowMemoryHelper()
{
try
{
Int64 result = (Int64)DeviceExtendedProperties.GetValue("ApplicationWorkingSetLimit");
if (result < 94371840L)
IsLowMemDevice = true;
else
IsLowMemDevice = false;
}
catch (ArgumentOutOfRangeException)
{
// Windows Phone OS update not installed, which indicates a 512-MB device.
IsLowMemDevice = false;
}
}
}
但是,在 Lumia 800 上运行时,我得到了 result = 223506432,并且 IsLowMemDevice = false; 我对这种行为感到非常惊讶。