new APIs for windows phone 8.1

后端 未结 4 446
小蘑菇
小蘑菇 2021-02-05 22:23

I am trying to use these two methods (of WP 8) in windows phone 8.1, but it gives error and doesn\'t compile, most probably becasue they are removed. I tried searching the new A

4条回答
  •  忘了有多久
    2021-02-05 23:04

    They still exists for Windows Phone 8.1 SIlverlight Apps, but not for Windows Phone Store Apps. The replacements for Windows Store Apps is:

    Sleep (see Thread.Sleep replacement in .NET for Windows Store):

    await System.Threading.Tasks.Task.Delay(TimeSpan.FromSeconds(30));
    

    Dispatcher (see How the Deployment.Current.Dispatcher.BeginInvoke work in windows store app?):

    CoreDispatcher dispatcher = CoreWindow.GetForCurrentThread().Dispatcher;
    await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { });
    

提交回复
热议问题