RichTextBlock
A typical first reaction to discovering the RichTextBlock element is, “Isn’t TextBlock already rich?” TextBlock can do a lot when it comes to formatting text, but RichTextBlock adds two big new tricks:
→ Embedding arbitrary UIElements among text
→ Letting text overflow into separate elements, which enables multi-column text or other custom text layouts
Except for these two features, TextBlock and RichTextBlock are almost identical. They expose the same methods, properties, and events, although RichTextBlock happens to have an extra GetPositionFromPoint method that returns a TextPointer for the passed-in Point. RichTextBlock also has some different defaults: IsTextSelectionEnabled is true by default, and TextWrapping is Wrap by ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access