0

There is a background thread in the viewmodel. It is trying to set a usercontrol property there which is being binded to the view. In simpler terms, accessing a UI thread from a non UI thread. What are the ways to establish this?

Thanks in advance.

dp94
  • 31
  • 4
  • It works for other UI control properties except for the usercontrol property. I get the error that says "the calling thread cannot access this object because a different thread owns it". – dp94 May 24 '16 at 11:57

1 Answers1

0

in WPF:

Application.Current.Dispatcher.BeginInvoke(
DispatcherPriority.Background, () => { /* UI WORK HERE */ });
Zein Makki
  • 29,485
  • 6
  • 52
  • 63