Call Dispatcher.Invoke when needed.