Is there a WPF control I can use to expand/collapse panels (animated)

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-28 06:56:53

I think what you are looking for is an "Accordion" control, here is a post abotu how to build one from a stack of Expander controls:

http://www.rooijakkers.net/Blog/post/2007/11/WPF-implementation-of-a-basic-Accordion-control.aspx

And for the animation take a look at the "Reveal" control from Kevin's bag-o-tricks at http://j832.com/bagotricks/

I think there's even an animated Expander control template based on the Reveal control in the sample project.

Anthony Brien

I also need this for my WPF application, and the best I've found is the fully featured Accordion control in the Silverlight Toolkit:

alt text http://www.sitechno.com/Blog/ct.ashx?id=a7c3c2d9-9446-4236-bc6e-c436427002ff&url=http%3a%2f%2fwww.sitechno.com%2fBlog%2fcontent%2fbinary%2fWindowsLiveWriter%2fAccordionpart1_102BB%2fimage_2.png

The source code is available here, and a live demo here. It's probably easy to port to WPF. There's a 5 part blog entry by Ruurd Boeke discussing it in details. In part 4, he discusses how to restyle the accordion using templates to get this great accordion look:


(source: sitechno.com)


(source: sitechno.com)

I use Expander.

<Expander Header="Items" IsExpanded="False">
    ...
</Expander>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!