Getting UI button's event in Windows Phone 7
I'm currently making a game in XNA4 for Windows phone 7, and I'd like to know if it were possible to get the event of the return button, or开发者_JS百科 even the windows button that are basically present on the phone's interface.
If so, how can i do that?
thanks,
KiTe
At this point in time the SDK only allows you to get events off the back button. The windows button is like the iPhone main button - for all intents and purposes in your app it's a close button. When it's pressed, your app should save state and be ready to be terminated. The best event that you get for this is Exit
event in Application
class (App.xaml.cs
).
In a Silverlight app, the back button fires a BackKeyPress
event that lives off PhoneApplicationPage
. In Silverlight, you might need to do things a little bit different.
This is the only thing I could find about getting a back key press event in an XNA application:
http://msdn.microsoft.com/en-us/library/bb203902.aspx
精彩评论