如何检查 Windows 设备是手机还是平板电脑/电脑? [英] How to check if Windows device is phone or tablet/pc?

查看:62
本文介绍了如何检查 Windows 设备是手机还是平板电脑/电脑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检查 Windows 设备是手机还是平板电脑/PC?我需要知道以便为 xaml 元素使用不同的大小

How to check if Windows device is phone or tablet/PC? I need to know in order to use different sizes for xaml elements

推荐答案

我觉得你可以尝试使用 EasClientDeviceInformation 类:

I think you can try to use EasClientDeviceInformation class:

EasClientDeviceInformation info = new EasClientDeviceInformation();
string system = info.OperatingSystem;

在 WP 上,它应该在桌面上返回 WindowsPhoneWindows.

on WP it should return WindowsPhone and Windows on desktop.

这篇关于如何检查 Windows 设备是手机还是平板电脑/电脑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆