public void WriteLine(object content) { if (content == null) { return; } Dispatcher.Invoke((() => { Cos.AppendText(content.ToString().TrimEnd(' ', '\n', '\r') + Environment.NewLine); CosViewer.ScrollToEnd(); })); }