Extended.Wpf.Toolkit DockingManager,设置面板的启动大小?

时间:2017-09-04 16:51:39

标签: c# wpf xaml

我是WPF的新手,我正在开始一个新项目。我有Extended.Wpf.Toolkit和DockingManager。我在xaml中设置了DockWidth值,并查看尺寸更新。但是当我启动应用程序时,LayoutAnchorablePane以不同的大小开始。我在发布时错过了设置尺寸的东西吗?

  <xcad:DockingManager Margin="0,38,0,0" Loaded="FormInit">
            <xcad:LayoutRoot>
                <xcad:LayoutPanel Orientation="Vertical" >
                    <xcad:LayoutPanel Orientation="Horizontal"
                          DockHeight="*">
                        <xcad:LayoutAnchorablePaneGroup DockWidth="200"
                                            Orientation="Vertical">
                            <xcad:LayoutAnchorablePane>
                                <xcad:LayoutAnchorable Title="Setup">
                                    <Label>
                                        <xctk:WrapPanel Name="LeftLoader" />                                      
                                    </Label>
                                </xcad:LayoutAnchorable>
                            </xcad:LayoutAnchorablePane>
                        </xcad:LayoutAnchorablePaneGroup>
                        <xcad:LayoutAnchorablePaneGroup DockWidth="1000"
                                            Orientation="Vertical">
                            <xcad:LayoutAnchorablePane>
                                <xcad:LayoutAnchorable Title="MidZone">
                                    <Label>
                                        <xctk:WrapPanel Name="MainLoader" />
                                    </Label>
                                </xcad:LayoutAnchorable>
                            </xcad:LayoutAnchorablePane>
                        </xcad:LayoutAnchorablePaneGroup>                      
                    </xcad:LayoutPanel>
                    <xcad:LayoutAnchorablePaneGroup DockHeight="200">
                        <xcad:LayoutAnchorablePane>
                            <xcad:LayoutAnchorable Title="Runtime">
                                <Label>
                                    <xctk:WrapPanel Name="BaseLoader" />
                                </Label>
                            </xcad:LayoutAnchorable>
                        </xcad:LayoutAnchorablePane>
                    </xcad:LayoutAnchorablePaneGroup>
                </xcad:LayoutPanel>
            </xcad:LayoutRoot>
        </xcad:DockingManager>

1 个答案:

答案 0 :(得分:0)

通过存储布局文件并在加载时加载来解决。感谢这个答案:

AvalonDock DockingManager does not load layout

和这段代码:

http://avalondock.codeplex.com/wikipage?title=AvalonDock%202.0%20Getting%20Start%20Guide%20PART%202