How to find the device platform/type your Windows 10 application is running on
public static class DeviceTypeHelper | |
{ | |
public static DeviceTypeEnum GetDeviceType() | |
{ | |
switch (Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily) | |
{ | |
case "Windows.Desktop": | |
return DeviceTypeEnum.Tablet; | |
case "Windows.Mobile": | |
return DeviceTypeEnum.Phone; | |
case "Windows.Universal": | |
return DeviceTypeEnum.IoT; | |
case "Windows.Team": | |
return DeviceTypeEnum.SurfaceHub; | |
case "Windows.Xbox": | |
return DeviceTypeEnum.Xbox; | |
default: | |
return DeviceTypeEnum.Other; | |
} | |
} | |
} | |
public enum DeviceTypeEnum | |
{ | |
Phone, | |
Tablet, | |
IoT, | |
Xbox, | |
SurfaceHub, | |
Other | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This comment has been minimized.
the original helper can be found here: https://gist.github.com/wagonli/40d8a31bd0d6f0dd7a5d