private void InsertRichText(string rtf) { ChatEdit.AppendRtf(rtf); ChatEdit.RemoveEmptyLastParagraph(); ChatEdit.ScrollToEnd(); }
private void InsertMessage(string message, Brush foreground) { Paragraph paragraph = new Paragraph(); paragraph.Inlines.Add( new Run(message) { FontWeight = FontWeights.Normal, Foreground = foreground, } ); if (ChatEdit.Document.Blocks.Count == 1) { ChatEdit.RemoveEmptyLastParagraph(); } ChatEdit.Document.Blocks.Add(paragraph); ChatEdit.ScrollToEnd(); }