Skip to content

Instantly share code, notes, and snippets.

@Delaire
Last active January 25, 2016 00:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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