O'Reilly logo

XAML Unleashed by Adam Nathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Text Overflow

If you place more text in a RichTextBlock (or TextBlock) than what fits in its bounds, you could wrap it in a ScrollViewer to make it all readable. RichTextBlock, however, supports a nifty trick that enables text that doesn’t fit to spill into a special element called RichTextBlockOverflow that you can place anywhere. If the remaining content doesn’t all fit in the RichTextBlockOverflow, it can spill into another RichTextBlockOverflow, and so on.

To enable this feature, all you need to do is set RichTextBlock’s OverflowContentTarget property to the desired RichTextBlockOverflow instance. RichTextBlockOverflow has its own OverflowContentTarget property so you can keep chaining RichTextBlockOverflows to each other. You could use this ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required