That's a great question. For our scenarios, we had tooltips that rendered the wrapped text but it would be good to know when the TextBlock has trimmed the text.
But Silverlight TextBlock is a sealed class (don't know why they seal it), so you can not inherit from it and extend the functionality like you can do in WPF to make that EnhancedTextBlock.
Sally Xu
Software Engineer
Aprimo, Inc
Please remember to mark the replies as answers if they answered your question
metal
Contributor
4753 Points
794 Posts
Detecting TextTrimming="WordEllipsis" on a TextBlock
Sep 08, 2010 03:39 PM | LINK
Text Trimming on TextBlock is great.
How can I detect if a TextBlock has trimmed its content ?
Then I can have the visibility of a "click here to read complete text" link underneth.
FuryDiamond
All-Star
23993 Points
4100 Posts
Re: Detecting TextTrimming="WordEllipsis" on a TextBlock
Sep 08, 2010 03:41 PM | LINK
That's a great question. For our scenarios, we had tooltips that rendered the wrapped text but it would be good to know when the TextBlock has trimmed the text.
Maybe this might help:
http://tranxcoder.wordpress.com/2008/10/09/showing-tooltips-on-a-trimmed-textblock-wpf/
Silverlight 5 3D Tutorials: http://silverlight.bayprince.com
Blog: http://blog.bayprince.com
Twitter: http://twitter.com/bayprince
metal
Contributor
4753 Points
794 Posts
Re: Detecting TextTrimming="WordEllipsis" on a TextBlock
Sep 08, 2010 05:21 PM | LINK
Unfortunately I had already come accross that and it relies on triggers that Silverlight does not support.
sladapter
All-Star
43609 Points
7910 Posts
Re: Detecting TextTrimming="WordEllipsis" on a TextBlock
Sep 08, 2010 06:23 PM | LINK
Silverlight does support Triggers.
But Silverlight TextBlock is a sealed class (don't know why they seal it), so you can not inherit from it and extend the functionality like you can do in WPF to make that EnhancedTextBlock.
Software Engineer
Aprimo, Inc
Please remember to mark the replies as answers if they answered your question
ColinE
Member
19 Points
17 Posts
Re: Detecting TextTrimming="WordEllipsis" on a TextBlock
Jan 06, 2011 09:27 AM | LINK
A bit of a later reply, however, I have just posted a solution to this problem on my blog:
http://www.scottlogic.co.uk/blog/colin/2011/01/showing-tooltips-on-trimmed-textblock-silverlight/
Colin E.