确定 Metro 应用程序正在 Windows 8 选项卡或台式电脑中运行 [英] Determine metro app is running in Windows 8 tab or Desktop PC

查看:22
本文介绍了确定 Metro 应用程序正在 Windows 8 选项卡或台式电脑中运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发具有 Windows 8 Metro 风格的应用程序.与平板电脑相比,如果它在台式电脑上运行,此应用程序具有更多功能.但我的问题是如何检测应用程序是否在 PC 或 Tab 中运行.我不想为 PC 和 TAB 分别发布 2 版本.

I am developing app with windows 8 metro style. This app has some more feature if it running in desktop pc compared to Tablet. But my problem is how to detect app is running in PC or Tab. I don't want to release 2 build seperately for PC and TAB.

请帮助我.更新:GetSystemMatrics 是否可以做到这一点?在桌面上,我们的应用程序的行为类似于客户端和服务器,但在选项卡和移动设备中,它的行为仅类似于客户端

Please help me. Update: Wheter is it possible to do it with GetSystemMatrics? In the desktop, our app behave like client and server, but in the tab and mobile device it behave like client only

推荐答案

Windows.Devices 命名空间包含大量有关设备功能的信息.例如,要确定设备是否启用触摸,您可以使用:

Windows.Devices namespace has a wealth of information about device capabilities. For example to determine if the device is touch enabled, you can use:

var hasTouch = Windows.Devices.Input
                  .PointerDevice.GetPointerDevices()
                  .Any(p => p.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Touch);

这篇关于确定 Metro 应用程序正在 Windows 8 选项卡或台式电脑中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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