WPF/Multithreading: UI Dispatcher in MVVM

前端 未结 7 1312
有刺的猬
有刺的猬 2020-12-24 09:49

So say in an MVVM environment, I\'m in a background thread and I\'d like to run an update on a ui control. So normally I\'d go myButton.Dispatcher.BeginInvoke(blabla) but I

相关标签:
7条回答
  • 2020-12-24 10:20

    I usually use Application.Current.Dispatcher: since Application.Current is static, you don't need a reference to a control

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