Silverlight 4 Beta – Text Trimming

Category:UncategorizedTag: , :

Before Silverlight 4 if you wanted to dynamically add ellipses (the commonly used … to show that the sentence continues), you have to invent your own implementation which usually involves creating your own control that wraps a text based control and then manipulate the text inside based on the size.  Similar to what Robby Ingebretsen had to do here.

Well, that is no longer the case. Introducing Text Trimming.

<TextBlock FontSize="16"

           TextTrimming="WordEllipsis"

           Text="A man is known by the company he keeps."

           Width="120"/>

Displays as: “A man is…”

This is a nice addition to the Silverlight framework.

2 thoughts on “Silverlight 4 Beta – Text Trimming

Comments are closed.

Find me

RSS
Facebook
Twitter
LinkedIn

Disclaimer

The opinions and content expressed here are my own and not those of my employer.