Is Messaging Thread Safe?

Topics: Questions
Sep 9, 2012 at 4:56 PM

If I send a Message from another thread and receiver method is in my main thread, do I need to call BeginInvoke in order to update a GUI control or I can simply set control value?

Coordinator
Sep 9, 2012 at 6:12 PM

The message mediator by itself does not invoke anything because it can be used in scenarios where no dispatcher exists (think about ASP.NET sites, windows services, etc). So you will have to call DispatcherService.BeginInvoke (or Invoke) yourself.

Sep 9, 2012 at 7:25 PM

Fair enough. Thank you for the clarification.