误差Dispatcher.BeginInvoke [英] Error with Dispatcher.BeginInvoke

查看:363
本文介绍了误差Dispatcher.BeginInvoke的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将项目添加到SharePoint列表,但是当我尝试保存我的变化即时得到这个错误与我的 Dispatcher.BeginInvoke Windows.UI.Core.CoreDispatcher'不包含为的BeginInvoke的定义,并没有扩展方法'的BeginInvoke接受型Windows.UI.Core.CoreDispatcher'的第一个参数可以找到(是否缺少using指令或程序集引用?

I am trying to add an item to a sharepoint list but when i try to save my changes im getting this error with my Dispatcher.BeginInvoke 'Windows.UI.Core.CoreDispatcher' does not contain a definition for 'BeginInvoke' and no extension method 'BeginInvoke' accepting a first argument of type 'Windows.UI.Core.CoreDispatcher' could be found (are you missing a using directive or an assembly reference?

 ctx.BeginSaveChanges(
  (IAsyncResult result) => Dispatcher.BeginInvoke(
      () => ctx.EndSaveChanges(result)),
   ctx

);

推荐答案

应使用以下代替:

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

这篇关于误差Dispatcher.BeginInvoke的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆