In my Windows I have a TextBox which I like to update (text property) from another thread. When doing so, I get the InvalidOperationException (see title). I have found diffe
Well, using Dispatcher.Invoke
or BeginInvoke
is definitely the way to go, but you haven't really shown much code other than creating a thread - for example, you haven't started the thread in your second code block.
If you put the Dispatcher.Invoke
code in the place where previously you were getting an InvalidOperationException
, it should be fine.