开发者

Silverlight: TextTrimming

开发者 https://www.devze.com 2023-01-03 11:53 出处:网络
Is there a way to identify if TextTrim开发者_如何转开发ming is triggered? For example in my first row, text is not trimmed because its only 20 characters, in my second row text are 1500 characters an

Is there a way to identify if TextTrim开发者_如何转开发ming is triggered?

For example in my first row, text is not trimmed because its only 20 characters, in my second row text are 1500 characters and it trims the text, is there a way to identify it, like IsTextTrimmed property?

<TextBlock TextWrapping="Wrap" Text="{Binding test}" TextTrimming="WordEllipsis" />

Thank you


According to the MSDN documentation on the TextWrapping property,

You can detect clipped text programmatically because ActualWidth for a TextBlock always reports the expanded size of the text, even if it does not fit in the layout container. If you know where to read the Width for the layout container that is doing the clipping, you can compare these two values.

Silverlight: TextTrimming

0

精彩评论

暂无评论...
验证码 换一张
取 消