当前位置: 动力学知识库 > 问答 > 编程问答 >

animation - WPF: Expanders stacked on top of each other where one should be expanded and take all remaining space

问题描述:

I think this is pretty known control but I couldn't find an WPF example/blog on the web. What I need is collection of Expander WPF controls stacked on top of each other just like in StackPanel. Difference though is that Expanders should be collapsed by default and once one of them is expanded it should take all the remaining space. If expanded Expander is in the middle of the stack it should push items below it all the way down to the bottom edge of the parent element. Every expande/collapse action should be animated.

StackPanel as the parent panel for Expanders here is out of the question because it can't give "all remaining space" to its child(ren). DockPanel does this partially but it can do that only for the "last child" and I need to be able to do it for any child.

So what would be the best approach to implement this?

网友答案:

To answer my question, I just found out that controls like this is called Accordion. There are couple of implementations online but I think the most complete is that in WPF Toolkit http://wpf.codeplex.com/

分享给朋友:
您可能感兴趣的文章:
随机阅读: