An error occurred while calling the recording: frameworkdispatcher. Update has not been call.

Source: Internet
Author: User
Tags silverlight
WP7 recording. update has not been called. regular frameworkdispatcher. update CILS are necessary for fire and forget sound effects and framework events to function correctly ., if you use the xNa framework from an application, do not execute the game class. For example, if you use the Silverlight application in a Windows Phone application

  

". Update has not been called. regular frameworkdispatcher. update CILS are necessary for fire and forget sound effects and framework events to function correctly. ", I found the information to say this:

If you use an xNa framework from an application and do not execute a game class, for example, a Windows Phone application uses a Silverlight application model, you must call your frameworkdispatcher in the message queue of the xNa framework. update method to send messages. You can do this by repeating every frame of a timer, or implementing a dispatchertimer tick event handler iapplicationservice interface.

Method 1: Call the xNa class before adding

DispatcherTimer timer =
new
DispatcherTimer();
          timer.Interval = TimeSpan.FromMilliseconds(33);
          timer.Tick +=
delegate
{ try
{ FrameworkDispatcher.Update(); }
catch
{ } };
          timer.Start();

2:

public class XnaAsyncDispatcher : IApplicationService{    private readonly DispatcherTimer _frameworkDispatcherTimer;    public XnaAsyncDispatcher(TimeSpan dispatchInterval)    {        FrameworkDispatcher.Update();        _frameworkDispatcherTimer = new DispatcherTimer();        _frameworkDispatcherTimer.Tick += FrameworkDispatcherTimer_Tick;        _frameworkDispatcherTimer.Interval = dispatchInterval;    }    void IApplicationService.StartService(ApplicationServiceContext context)    {        _frameworkDispatcherTimer.Start();    }    void IApplicationService.StopService()    {        _frameworkDispatcherTimer.Stop();    }    private static void FrameworkDispatcherTimer_Tick(object sender, EventArgs e)    {        FrameworkDispatcher.Update();    }}

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.