WP7 Invalid cross-thread access - ScheduledTaskAgent

前端 未结 1 1309
滥情空心
滥情空心 2020-12-05 12:12

In WP7 app I am calling some code to update a live tile from the onInvoke method on the ScheduledAgent class.

Getting an invalid cross-thread error.

The li

相关标签:
1条回答
  • 2020-12-05 12:42

    Use the Dispatcher to execute the code on the UI thread instead on a background thread:

    Deployment.Current.Dispatcher.BeginInvoke(()=>
        { 
             fontForeground  = new SolidColorBrush(Colors.White);
             ...        
       });
    
    0 讨论(0)
提交回复
热议问题