Try this:
if (!MyTextBox.Dispatcher.CheckAccess())
{
MyTextBox.Dispatcher.Invoke(() => { MyTextBox.Text = myReceivedMessage.ToString(); });
}
else
{
MyTextBox.Text = myReceivedMessage.ToString();
}
2
solved write to text box from a thread in after aborting thread WPF C# [duplicate]