private void ConsoleTextBox_TextChanged(object sender, TextChangedEventArgs e) { if (AutoscrollCheckBox.IsChecked == true) { ConsoleTextbox.Focus(); ConsoleTextbox.CaretIndex = ConsoleTextbox.Text.Length; ConsoleTextbox.ScrollToEnd(); } }
void Print(string msg) { try { this.Dispatcher.Invoke(new Action(() => { ConsoleTextbox.AppendText(msg); ConsoleTextbox.AppendText(Environment.NewLine); })); }catch (Exception E) { } }
private void Log(string text) { string line = string.Format("{0:HH:mm:ss.fff}: {1}\r\n", DateTime.Now, text); ConsoleTextbox.AppendText(line); }