new APIs for windows phone 8.1

后端 未结 4 441
小蘑菇
小蘑菇 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 22:52

    Dispatcher.BeginInvoke( () => {}); is replaced by

    await this.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, async () => {});
    

    and System.Threading.Thread.Sleep(); is replaced by

    await Task.Delay(TimeSpan.FromSeconds(doubleValue));
    

提交回复
热议问题