是否有一个 WPF 控件可以用来展开/折叠面板(动画)
我有一个包含很多内容的窗口。 我希望能够使用面板分隔内容,并有一个分隔符,用户可以单击每个面板之间的切换(带有将分隔符从左向右移动的动画,显示一个部分并隐藏另一个部分) 。 想想 Microsoft Office (2007) 导航窗格。 有没有一种简单的方法可以实现这一点?
谢谢!
I have a window that has a lot of content. I'd like to be able to separate the content using panels, and have a separator that the user can click on the toggle between each panel (with an animation that moves the separator from left to right, showing one section and hiding the other). Think of the Microsoft Office (2007) navigation pane. Is there an easy way to accomplish this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我的 WPF 应用程序也需要这个,我发现的最好的就是 Silverlight Toolkit 中功能齐全的 Accordion 控件:
替代文本 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
源代码位于此处,还有现场演示< a href="http://silverlight.net/content/samples/sl3/toolkitcontrolsamples/run/default.html" rel="nofollow noreferrer">此处。 移植到 WPF 可能很容易。 Ruurd Boeke 的 5 部分博客文章对此进行了详细讨论。 在 第 4 部分 中,他讨论了如何使用模板重新设计手风琴样式以获得这款出色的手风琴看:
(来源:sitechno.com)
(来源:sitechno.com)
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.
我认为您正在寻找的是一个“手风琴”控件,这是一篇关于如何从一堆扩展器控件中构建一个控件的帖子:
http://www.rooijakkers.net/Blog/post/2007/11/WPF-implementation-of-a -basic-Accordion-control.aspx
对于动画,请查看 Kevin 的 bag-o-tricks 中的“Reveal”控件,网址为 http://j832.com/bagotricks/
我认为甚至还有一个基于示例项目中的 Reveal 控件的动画 Expander 控件模板。
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.