草庐IT

isTypePresent

全部标签

c# - 如何在 Windows 10 通用应用程序中使用 isTypePresent 检测相机是否可用

在为Windows10开发通用应用程序时,我们鼓励您使用IsTypePresent检测特定于设备的硬件。(Microsoft将此功能称为“Lightup”)。一个examplefromthedocumentation检查设备后退按钮的是:如果(Windows.Foundation.Metadata.ApiInformation.IsTypePresent(“Windows.Phone.UI.Input.HardwareButtons”))Windows.Phone.UI.Input.HardwareButtons.BackPressed+=HardwareButtons_BackPre