Updating ObservableCollection from non UI thread

前端 未结 2 1861
失恋的感觉
失恋的感觉 2021-01-22 21:13

I am working on a Windows 8 Store app. I have a timer that calls a delegate every two minutes and makes an async web request. The resulting data is added to an observablecollect

2条回答
  •  一整个雨季
    2021-01-22 21:37

    It's usually easier to have the UI thread call background operations rather than having the background operations update the UI thread.

    So, I recommend you use DispatcherTimer, and then you won't need to use Dispatcher at all.

提交回复
热议问题