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

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

问题描述

我开发与Windows 8 Metro风格的应用程序。这个程序有一些更多的功能,如果它的台式PC运行相比,平板电脑。但我的问题是如何检测的应用程序在PC或Tab运行。
 我不希望释放2构建单独的PC和TAB。

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.

请帮助我。
更新:Wheter是否有可能与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);

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

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