如何将 WrapPanel 中的所有项目宽度设置为相同的值?
据我所知,有一些属性允许使 WrapPanel 中的每个元素具有相同的宽度(ShareSizeScope)。现在我想在 silverlight 中实现相同的输出,但没有这样的属性。是否有任何属性或其他方法可以帮助我获得与 WPF 中相同的输出?
As I know there are some properties that allow to make every elements in WrapPanel have same width (ShareSizeScope). Now I want to archieve the same output in silverlight but there's no such property. Are there any properties or other ways that can help me to get same output as in WPF?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
目前,控件中没有等效的命令来完成此操作。我不确定您的需求是什么,但如果是我,我会将面板中每个控件的宽度绑定到具有正确宽度的东西。在此示例中,我在页面上有宽度为 200 的示例控件,然后我将所有 WrapPanel 子项设置为匹配该控件,无论它是什么。
At the moment, there is no equivalent command in the control to accomplish this. I'm not sure what your needs are, but if it were me, I'd bind the width of each control in the panel either to something that has the right width. In this example, I have sample control on the page that is 200 in width, then I set all the WrapPanel children to match that, whatever it is.