private void Log(string msg) { this.Dispatcher.Invoke(() => { DebugOutput.Text = DebugOutput.Text + "\n" + msg; DebugOutput.ScrollToEnd(); }); }