public static void AppendText(TextBlock textBlock, string text) { if (textBlock.Dispatcher.CheckAccess()) { textBlock.Text += text; } else { textBlock.Dispatcher.BeginInvoke(new SetTextBlockDelegate(AppendText), textBlock, text); } }