Silverlight Accordion 控件:加载时全部折叠
我目前正在开发一个项目,我在主页上有一个手风琴控件。一切都按预期进行,但有一个小问题我似乎无法解决。
当我加载页面时,第一个手风琴会展开。是否有任何解决方法可以告诉手风琴控件,所有手风琴在首次加载时都应该折叠?
另外,我可以单击以展开项目,但是当我单击刚刚展开的同一项目时,它不会再次折叠。有人知道我应该在这里参加哪个活动吗?
提前致谢。
祝一切顺利,
博
I'm currently working on a project where I have an Accordion control on the MainPage. It all works just as intended, but there's a small problem that I cannot seem to get my head around.
When I load the page, the first accordion is expanded. Is there any work-around to tell the Accordion control, that all the accordions should be collapsed when first loaded?
Also, I can click to expand the items, but when I click on the same item that I just expanded, it won't collapse again. Anyone know which event I should reach for here?
Thanks in advance.
All the best,
Bo
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要将
SelectionMode
属性更改为ZeroOrOne
,默认值为One
,这意味着它将坚持至少打开一项。将
SelectedIndex
属性设置为 -1 以隐藏所有项目。You need to change the
SelectionMode
property toZeroOrOne
the default isOne
which means it will insist on having at least one item open.Set the
SelectedIndex
property to -1 to hide all items.