Skip to content

Instantly share code, notes, and snippets.

@Delaire
Last active January 25, 2016 00:21
Show Gist options
  • Save Delaire/37cbe07738df34bfd5e8 to your computer and use it in GitHub Desktop.
Save Delaire/37cbe07738df34bfd5e8 to your computer and use it in GitHub Desktop.
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
}
@Delaire
Copy link
Author

Delaire commented Jan 25, 2016

the original helper can be found here: https://gist.github.com/wagonli/40d8a31bd0d6f0dd7a5d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment