捏合时缩放网格/视图框中的文本
一整天,我都在努力解决这个问题,涉及在捏 scatterViewItem 来调整其大小时缩放文本块和文本框。 我尝试将每个元素放入其视图框中,但也将整个网格放入视图框中。 问题是它(即textbloxk)不会在收缩或拉伸时缩放(可以说是动态地) - 在运行时,甚至在 contact_up 时也不会缩放。
For a day now I'm struggling to solving this issue, regarding scaling a textblock and a textbox upon pinching the scatterViewItem for resizing it.
I've tried putting each of the elements in their viewbox, but also having the whole grid in a viewbox.
The issue is that it(the textbloxk, that is) doesn't scale upon pinching or stretching rather, (dynamically so to speak) - at runtime, or not even upon contact_up.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
真正解决这个问题的方法是简单地设置一个事件处理程序,该事件处理程序在 SVI 的 size_changed 上触发,只需在其中粘贴代码即可:
谢谢!
What actually solves it is simply setting an event handler that fires upon size_changed of the SVI, inside simply paste the code:
Thanks!
我假设您的意思是窗口中的 TextBlock 在调整窗口大小时不会缩放...?您是否尝试过将
ViewBox
放入包含要调整大小的项目的Grid
中?如果您在ViewBox
中有该项目,并将ViewBox
的Height
和Width
设置为自动,应该随窗口调整大小...我希望这会有所帮助。
I am assuming you mean that the TextBlock in the window does not scale when resizing the window...? Have you tried putting a
ViewBox
in aGrid
that contains the item you want to resize? If you have the item in aViewBox
, and set theHeight
andWidth
of theViewBox
toAuto
, is should resize with the window...I hope this helps a little.