Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error with Dispatcher.BeginInvoke

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

);

like image 278
Page F.P.T Avatar asked Mar 16 '26 02:03

Page F.P.T


1 Answers

Should use the following instead:

await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () => {
}
like image 142
Yuchen Avatar answered Mar 19 '26 01:03

Yuchen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!