Reputation: 5222
I want to conditionally check device type runtime for windows 10 UWP. there is already a class and enum available for windows phone 8 platform as mentioned below.
Class - Microsoft.Devices.Environment.DeviceType
Enum - Microsoft.Devices.DeviceType
What is equivalent for windows 10 platform?
Upvotes: 0
Views: 235
Reputation: 1090
I would suggest this approach. The classes are available for UWP as seen on the documentation
private static EasClientDeviceInformation deviceInfo = new EasClientDeviceInformation();
public static bool IsRunningOnEmulator
{
get
{
return (deviceInfo.SystemProductName == "Virtual");
}
}
Upvotes: 1