Refresh UI with a Timer in WPF (with BackgroundWorker?)

前端 未结 2 908
半阙折子戏
半阙折子戏 2021-01-04 12:33

We have an application in WPF that shows data via ObservableCollection. After 5 minutes, I want to refresh the data.

I thought I could use the System.Timers.Ti

2条回答
  •  时光说笑
    2021-01-04 12:48

    Why not use a DispatcherTimer? That will "tick" in the dispatcher thread already.

    Beyond that, it's hard to say what's wrong just from your description of "there's a problem with the threads".

提交回复
热议问题