void Logger_OnWrite(string s, Brush b = null) { Dispatcher.Invoke(() => { if (string.IsNullOrEmpty(s)) { return; } //OutputTab.Focus(); if (b != null) { TextRange tr = new TextRange(CompileOutputTextbox.Document.ContentEnd, CompileOutputTextbox.Document.ContentEnd) { Text = s }; tr.ApplyPropertyValue(TextElement.ForegroundProperty, b); } else { CompileOutputTextbox.AppendText(s); } CompileOutputTextbox.ScrollToEnd(); }); }
void CompilingManager_OnClear() { Dispatcher.Invoke(() => { CompileOutputTextbox.Document.Blocks.Clear(); CompileOutputTextbox.AppendText(Environment.NewLine); }); }