Error with Dispatcher.BeginInvoke

早过忘川 提交于 2019-12-06 10:41:43

问题


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

);


回答1:


Should use the following instead:

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


来源:https://stackoverflow.com/questions/27211044/error-with-dispatcher-begininvoke

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!