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 选项卡或台式电脑中运行
基础教程推荐
- 如果有人提交恶意软件Nuget包怎么办? 2022-01-01
- WPF 模态进度窗口 2022-01-01
- 我应该在后面的代码中直接使用 Linq To SQL 还是使 2022-01-01
- 禁止输入少量字符,例如'<'、'&a 2022-01-01
- .NET SerialPort DataReceived 事件未触发 2022-01-01
- Moq It.Is<>不匹配 2022-01-01
- 当值可以是对象或空数组时反序列化 JSON 2022-01-01
- Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发 2022-01-01
- 如何使用 .Net 检查 Active Directory 服务器是否已启动并正在运行? 2022-01-01
- C# 从 List<List<int>> 中删除重 2022-01-01
