WP7 supports Silverlight and xNa frameworks. However, xNa DLL is often referenced in the Silverlight project, because the two frameworks have their own key points and there are not many features repeated. For example, to call the Zune function, play a song or obtain the current song. I referenced Microsoft. xNa. Framework. dll in the Silverlight project and used:
Song = Mediaplayer. queue. activesong;
All functions are useless. But every time Zune switches songs, fast forward, and fast return, myProgramWill crash. It is useless to capture all exceptions. I have no idea. I asked a question on the Forum. Someone reminded me that the call should be:
Frameworkdispatcher. Update ();
This function updates the status of various xNa components and triggers corresponding events. In xNa, we recommend that you call each frame. I don't know how frequently it needs to be called in Silverlight, but I only call it once in page_load, and the program will no longer crash.
Here, I want to help anyone who has encountered similar problems find this problem.