Can't use dispatcher on WP7

后端 未结 1 2023
无人共我
无人共我 2021-02-01 17:39

I was looking around for refrences using dispatcher to call code on the UI thread and they say to do this:

Dispatcher.BeginInvoke(() => {OnSendSuccessful(); }         


        
相关标签:
1条回答
  • 2021-02-01 18:11

    Try using:

    Deployment.Current.Dispatcher.BeginInvoke(() => {OnSendSuccessful(); });  
    

    This uses a static method to get a dispatcher for use in a static context.

    0 讨论(0)
提交回复
热议问题