【发布时间】:2014-08-11 02:46:32
【问题描述】:
我正在尝试使用 Windows Phone 8.1。我试图通过将 HardwareButtons.BackPressed 挂接到自定义事件处理程序来处理它,以防止后退按钮暂停我的应用程序。我认为 HardwareButtons 是在 Windows.Phone.UI.Input 中定义的,但是当我尝试包含时:
using Windows.Phone.UI.Input;
编译器抛出错误说:
The type or namespace name 'Phone' does not exist in the namespace 'Windows' (are you missing an assembly reference?)
根据之前的问题: PresentationFramework DLL could not be loaded
The type or namespace name 'Window' does not exist in the namespace 'System.Windows'
看来presentationframework.dll 可能位于程序集gac 中,但我在我的机器上的任何地方都找不到它。
有人可以告诉我 dll 在哪里,以便我可以将其添加到引用中,还是 windows 8.1 的工作方式不同?这是我第一次尝试为 windows phone 8.1 编写程序。我的系统是带有 windows 8.1 的 Surface Pro 2,我使用 vs2013 高级版。如果这是 Surface Pro 的设计行为,我需要指导如何自定义 BackPressed 处理程序,以便在按下它时不会将我踢出我的应用程序。 谢谢,
【问题讨论】:
标签: c# windows-phone-8.1