Reputation: 513
Lets say you have this text
"Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas porttitor congue massa. Fusce posuere, magna sed pulvinar ultricies, purus lectus malesuada libero, sit amet commodo magna eros quis urna."
put in a textblock with TextWrapping="Wrap", the textblock only supports 2 lines, so how do I add the usual "..." at the end of the text so as to say there is more to read
Upvotes: 1
Views: 341
Reputation: 857
This question has been correctly answered here: How do I truncate a string with an ellipsis in a Silverlight TextBlock?
Silverlight 4 supports the TextTrimming property for TextBlock controls.
<TextBlock TextTrimming="WordEllipsis"/>
Upvotes: 0
Reputation: 57149
This is not trivial to answer for use in SilverLight because you cannot use native Win32 methods (of which some methods support ellipsis). There are a few resources on the Net, which basically come down to one of two approaches:
TextRenderer.DrawText
, not sure if that's available or useful in your scenario: http://www.switchonthecode.com/tutorials/how-to-auto-ellipse-text-in-csharpUpvotes: 2