在为 Windows 10 开发通用应用程序时,我们鼓励您使用IsTypePresent
. (微软将此功能称为“点亮”)。文档中检查设备后退按钮的示例是:
if(Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
这里很清楚,字符串"Windows.Phone.UI.Input.HardwareButtons"
作为参数传递给IsTypePresent()
方法。
我想知道是否有一种简单的方法可以识别其他字符串,我可以将其用于其他硬件,特别是相机。