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.
It’s all the little difference between Silverlight and WPF that keep bringing me back to WPF. I can’t wait for them to converge more.
Nice, but where is the CharacterEllipsis feature which I’d prefer more.