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 don’t have access to myButton (because the viewmodel doesn’t have access to the view’s controls). So what is the normal pattern for doing this?
(I guess there’s always binding, but I’d like to know how to do it via the dispatcher)
I usually use
Application.Current.Dispatcher: sinceApplication.Currentis static, you don’t need a reference to a control