开发者

Is it possible to get rendered text from textBlock

开发者 https://www.devze.com 2023-02-20 11:51 出处:网络
I have textBlock defined such that it fills the entire screen of the phone. The textBlock is initialized with some data which cannot be displayed in the boundary and hence gets clipped.

I have textBlock defined such that it fills the entire screen of the phone.

The textBlock is initialized with some data which cannot be displayed in the boundary and hence gets clipped.

I want to read the data which actually got rendered on the screen (i.e. whole data - clipped data).

Putting a breakpoint shows me that开发者_如何转开发 myNewTextBlock.Text contains the entire data that it was initialized with.

Thanks


You could look at using Measure and MeasureOverride to determine how much of the Text would fit in the available space.

You'll likely need to test various trimmed versions of the Text but it shouldn't be too tricky.

0

精彩评论

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