带有用于固定类似行为的按钮的 GridSplitter

发布于 2024-09-18 12:15:37 字数 450 浏览 5 评论 0原文

我希望以某种方式扩展 GridSplitter 以添加一个按钮,单击该按钮会将控件展开或折叠到拆分器的指定一侧之一。

我发现 适用于 Silverlight 4 的解决方案,但我需要它适用于 .NET 3.5 中的标准 WPF,这意味着 GridSplitter 不会实现 Shemesh 解决方案中使用的视觉状态管理器内容。除了它不适用于 .NET 3.5 中的 WPF 之外,我认为 Shemesh 的解决方案可能正是我正在寻找的解决方案,它具有平滑的动画过渡,并在从折叠状态展开时记住上次展开的大小。

有人有在常规 WPF 中完成此操作的任何示例吗?

I'm looking to extend the GridSplitter in some way to add a button which when click expands or collapses the control to one of the specified sides of the splitter.

I've found a solution that works for Silverlight 4 but I need this to work for standard WPF in .NET 3.5 which means that the GridSplitter doesn't implement the Visual State Manager stuff that is used in Shemesh's solution. Other than it won't work for WPF in .NET 3.5 I think Shemesh's solutions is probably exactly what I'm looking for with smooth animated transitions and remembering the last expanded size upon expanding from a collapsed state.

Anybody have any examples of this being done in regular WPF?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

还在原地等你 2024-09-25 12:15:37

好的,我已经对 Silverlight 示例 进行了足够的修改获取适用于 .NET 3.5 SP1 的内容以及适用于 Visual State Manager 内容的 WPF Toolkit 二月版本。您可以在下面找到我已经修复、重构和重新组织的两个主要源文件。

该解决方案太大,无法在 StackOverflow 上发布,因此请参阅 我的博客文章 其中包含您需要的代码片段。

Ok, I've tinkered with the Silverlight example enough to get something working for .NET 3.5 SP1 and the WPF Toolkit February release for the Visual State Manager stuff. Below you can find the two main source files that I've fixed, refactored, and reorganized quite a bit.

The solution is to big to post on StackOverflow so please see my blog post that has the code snippets you will need.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文