在Avalon扩展坞中设置面板的初始高度 [英] Setting the initial height for panel in Avalon dock

查看:55
本文介绍了在Avalon扩展坞中设置面板的初始高度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在以这种方式在代码中创建面板:

I am creating panels in code in this way:

DockableContent dockableContent = CreateDockableContent<TView>(model);
dockableContent.Show(_dockingManager, AnchorStyle.Bottom);

如何为该面板指定初始高度?以下内容不起作用:

How can I specify the initial height for that panel? The following doesn't work:

dockableContent.Height = 400;

ResizingPanel.SetResizeHeight(dockableContent, new GridLength(400));

推荐答案

纳格,

设置面板的高度仅会影响其在浮动时的外观.停靠后,它受调整大小"面板的限制所约束(看起来您自己已经了解了这一点).

Setting the height of the panel only affects its appearance when floating. When it is docked, it is bound by the limits of Resizing panel (looks like you figured that out yourself).

在AvalonDock库中使用默认大小创建尺寸调整面板.

Resizing panels are created with a default size in the AvalonDock library.

您可能想研究AvalonDock的2.0版-它在自定义面板方面提供了更大的灵活性-尤其是因为它们可以绑定到可以更改外观的ViewModel上.

You might want to look into version 2.0 of AvalonDock - it offers way more flexibility in customizing Panels - especially because they can be bound to a ViewModel where you can change their appearance.

如果您仍然想使用1.3,则必须修改AvalonDock源代码才能使其执行您想要的操作(例如,添加默认的面板高度).

If you still want to use 1.3 then you'd have to modify the AvalonDock source code to get it to do what you want (add in a default panel height for example).

史蒂夫

这篇关于在Avalon扩展坞中设置面板的初始高度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆