是否可以从textBlock获取渲染文本
我定义了 textBlock,使其填满手机的整个屏幕。
textBlock 使用一些无法在边界中显示的数据进行初始化,因此会被剪切。
我想读取实际在屏幕上呈现的数据(即整个数据 - 剪辑数据)。
设置断点表明 myNewTextBlock.Text 包含其初始化时使用的全部数据。
谢谢
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以查看使用 测量和MeasureOverride 来确定可用空间适合多少
Text
。您可能需要测试
Text
的各种修剪版本,但这应该不会太棘手。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.