Determine metro app is running in Windows 8 tab or Desktop PC(确定 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 选项卡或台式电脑中运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:确定 Metro 应用程序正在 Windows 8 选项卡或台式电脑中运行


- C# 中多线程网络服务器的模式 2022-01-01
- Web Api 中的 Swagger .netcore 3.1,使用 swagger UI 设置日期时间格式 2022-01-01
- 输入按键事件处理程序 2022-01-01
- C#MongoDB使用Builders查找派生对象 2022-09-04
- 如何用自己压缩一个 IEnumerable 2022-01-01
- WebMatrix WebSecurity PasswordSalt 2022-01-01
- 良好实践:如何重用 .csproj 和 .sln 文件来为 CI 创建 2022-01-01
- 在哪里可以找到使用中的C#/XML文档注释的好例子? 2022-01-01
- MoreLinq maxBy vs LINQ max + where 2022-01-01
- 带有服务/守护程序应用程序的 Microsoft Graph CSharp SDK 和 OneDrive for Business - 配额方面返回 null 2022-01-01