使网格拉伸到 AccordionItem 的宽度/高度
我正在编写的 Silverlight 应用程序中有几个手风琴(甚至是手风琴内的手风琴!),但布局让我发疯。
例如,假设您有一个 500x500 的手风琴。如果您有 3 个 AccordionItems,则“内容”区域是 Accordion 的高度/宽度,减去每个标题的宽度/高度乘以您拥有的项目数。
如果我添加或删除一个项目,如果我想通过手动将网格设置为每个 AccordionItems 内容的结果大小,将项目停靠在每个 AccordionItem 的右侧或左侧,则必须重新开始。
有办法解决这个问题吗?
I have a couple of Accordions in a Silverlight App I'm writing (even an Accordion inside of an Accordion!) but the layout is driving me insane.
For example, suppose you have a 500x500 Accordion. If you have 3 AccordionItems, the "Content" area is whatever the height/width of the Accordion is, MINUS the width/height of each header times the number of items you have.
If I add or remove an item, I have to start over if I want to dock items to the right or left of each AccordionItem by manually setting a grid to the resulting size of each AccordionItems content.
Is there a way around this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你想要的事情可以非常简单地完成。只需在 AccordianItem 元素上将 HorizontalContentAlignment 和 VerticalContentAlignment 设置为“Stretch”,它们的内容就会拉伸以填充任何可用空间。
显示拉伸和未拉伸内容的简单示例:
What you want can be done very simply. Just set HorizontalContentAlignment and VerticalContentAlignment to "Stretch" on the AccordianItem elements, and their contents will stretch to fill whatever the available space is.
Simple example showing stretched and unstretched content: