WPF 手风琴垂直对齐错误
使用最新 WPF 工具包中的 Accordion 控件时,我遇到了这个问题。 当手风琴控件的 VerticalAlignment 设置为“Stretch”时,如果 SelectionMode 设置为“One”,则其中包含的 AccordionItems 将不再展开。如果选择模式设置为“ZeroOrOne”,您会在多次尝试单击后得到扩展。如果将其设置为“ZeroOrMore”,则会发生一些非常时髦的事情,即手风琴项目从屏幕底部丢失!
有人找到这个问题的解决方案吗?
谢谢!
Using the Accordion control from the latest WPF toolkit i came across this issue.
When an accordion control has its VerticalAlignment set to 'Stretch' the AccordionItems contained within it will no longer expand if the SelectionMode is set to 'One'. If the selection mode is set to 'ZeroOrOne' you get expansion after several attempts at clicking. If it is set to 'ZeroOrMore' some really funky stuff happens where accordion items go missing off the bottom of the screen!
Anyone found a solution for this problem?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您还可以将 Accordion SelectionSequence 属性设置为 CollapseBeforeExpand。
此错误是由于每个手风琴项的展开/折叠动画的计时问题(当展开和折叠同时发生时)造成的
Accordion 的布局更新扰乱了可扩展的大小。
You can also set the Accordion SelectionSequence property to CollapseBeforeExpand.
This bug is due to timing problems of the expanding/collapsing animation of each accordion item (when both expanding and collapsing happens simultaneously) with
the layout update of the Accordion which messes up the size available for expansion.
一个好的解决方法是将
ActualHeight
和ActualWidth
绑定到您希望其填充的父元素。这有点麻烦,但它会起作用。An OK workaround is to bind the
ActualHeight
andActualWidth
to the parent element you want it to fill. This is a bit of a hack but it will work.首先,我很抱歉重新激活一个非常古老的主题,但以下代码可以说明 TerrorAustralis 的响应。
第 1 部分 ScrollViewer 的 Heigth 属性取决于 Accordion 的 ActualHeigth。要进行详细调整,您可以更改 ConverterParameter 值。
和转换器的代码:
First of all, I appologise for reactivate a very old topic but the following code can illustrate TerrorAustralis response.
The Part 1 ScrollViewer's Heigth property depends of the Accordion's ActualHeigth. To adjust in detail, you can change ConverterParameter value.
And the converter's code :