Small problem of referencing xNa in the WP7 Silverlight Project

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.