Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
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

This comment has been minimized.

Show comment Hide comment
@Delaire

Delaire Jan 25, 2016

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

Owner

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