Just adding why and when to use Invoke().
Both Invoke() and BeginInvoke() marshal the code you specify to the dispatcher thread.
But unlike BeginInvoke(), Invoke() stalls your thread until the dispatcher executes your code. You might want to use Invoke() if you need to pause an asynchronous operation until the user has supplied some sort of feedback.
For example, you could call Invoke() to run a snippet of code that shows an OK/Cancel dialog box. After the user clicks a button and your marshaled code completes, the invoke() method will return, and you can act upon the user's response.
See Pro WPF in C# chapter 31