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