Silverlight 中的动态 TextBlock 字体大小
我目前正在按照 StackOverflow 上的几个答案的建议将 TextBlock 包装在 Viewbox 中,并且按照我想要的方式呈现。但经过一些研究后,我了解到这会影响性能,尤其是当您有相当数量的 TextBlock 使用这种方法时。
在 Silverlight 中是否有更好的方法来做到这一点?
注意:只要可以显示文本,我不介意使用 TextBlock 以外的其他内容。
I am currently wrapping my TextBlock in a Viewbox as suggested by a couple of answers here on StackOverflow, and this renders as I want it to. But after doing a little research, I understand that this hampers performance, especially when you have a decent number of TextBlocks which use this approach.
Is there a better way of doing this in Silverlight?
Note: I don't mind using something other than a TextBlock as long as I can display text.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自此论坛
没有 ViewBox 只涉及魔法计算。线程中还有其他建议,例如更改字体大小并测量几次直到文本适合。
From this forum
No ViewBoxes involved just a magic calculation. There are other suggestions in the thread such as changing the font size and measuring a couple of times until the text fits.