private void LogMessage(string message, Brush color) { var test = new TextRange(MessageTextBox.Document.ContentEnd, MessageTextBox.Document.ContentEnd); test.Text = "[" + DateTime.Now.ToLongTimeString() + "] " + message + '\r'; // Coloring there. test.ApplyPropertyValue(TextElement.ForegroundProperty, color); FileLog.Append(test.Text); MessageTextBox.ScrollToEnd(); }
public void AddMessage(string statusMessage, Color color) { TextRange textRange = new TextRange(MessageTextBox.Document.ContentStart, MessageTextBox.Document.ContentEnd); if (textRange.Text.Length > 0) { MessageTextBox.AppendText("\r"); } MessageTextBox.AppendText(DateTime.Now.ToString(msgDateFormat), Palette.Colors.CONCRETE); MessageTextBox.AppendText(" "); MessageTextBox.AppendText(statusMessage, color); MessageTextBox.ScrollToEnd(); }
private void OnMessageTextBoxTextChanged(object sender, TextChangedEventArgs e) { MessageTextBox.ScrollToEnd(); }