wpf - 将 Expander 重置为默认折叠行为

标签 wpf expander

我在 Resizer 内使用扩展器(带有调整大小抓手的 ContentControl),并且当控件最初出现时它会正确展开/折叠。一旦我调整它的大小,扩展器将无法正确折叠,如下所述。我在我的应用程序上运行了 Snoop,并且没有看到 Expander 或其组成部分设置了任何高度。

我该如何说服 Expander 再次正确崩溃?或者修改 Resizer 不让 Expander 伤心也可以。

扩展器文档说:

"For an Expander to work correctly, do not specify a Height on the Expander control when the ExpandDirection property is set to Down or Up. Similarly, do not specify a Width on the Expander control when the ExpandDirection property is set to Left or Right. When you set a size on the Expander control in the direction that the expanded content is displayed, the area that is defined by the size parameter is displayed with a border around it. This area displays even when the window is collapsed. To set the size of the expanded window, set size dimensions on the content of the Expander control or the ScrollViewer that encloses the content."

最佳答案

我通过将 Resizer 移动到 Expander 内解决了该问题,但我在其他地方遇到了 Expander 问题,因此如果有人有答案,我仍然希望得到答案。

谢谢

关于wpf - 将 Expander 重置为默认折叠行为,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/159470/

相关文章:

c# - WPF MVVM 中的 ADO.NET Entity Framework ?

wpf - 扩展器标题文本对齐

javascript - 隐藏轮播下一页上的扩展器

wpf - 带有GridSplitter的扩展器

wpf - 将 adorner 属性绑定(bind)到 viewmodel 属性

javascript - 如何从 WPF WebBrowser 控件调试页面的 JavaScript 代码

c# - 如何将 Expander ToggleButton 放在右侧

c# - 如何在失去焦点时关闭 WPF 弹出窗口

c# - 使用 .net 装饰器同时调整多个不同形状的大小

c# - 从单独的线程创建 WPF 控件