Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1925
XamDockManager to fill in parent grid or container
posted

Hi

I have very simple dock manager, how can my dockmanager fill in the window/parent container, so that when I resize the whole dockmanager is resized accordingly. Following grid is in my window.

<Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <igWPF:XamDockManager Grid.Row="0" Height="200" HorizontalAlignment="Left" Name="xamDockManager1" 
                              LayoutMode="FillContainer"
                              VerticalAlignment="Top" Width="500">
            <igWPF:XamDockManager.Panes>
                <igWPF:SplitPane SplitterOrientation="Horizontal" igWPF:XamDockManager.InitialLocation="DockedBottom">
                    <igWPF:TabGroupPane>
                        <igWPF:ContentPane Header="Details Pane" />
                        <igWPF:ContentPane Header="Details Pane" />
                    </igWPF:TabGroupPane>
                </igWPF:SplitPane>
                <igWPF:SplitPane SplitterOrientation="Horizontal" igWPF:XamDockManager.InitialLocation="DockedTop">
                    <igWPF:ContentPane Header="Top Pane" WindowPositionMenuVisibility="Collapsed" CloseButtonVisibility="Collapsed" />
                </igWPF:SplitPane>
            </igWPF:XamDockManager.Panes>
            <igWPF:SplitPane>
                <igWPF:ContentPane>
                    <StackPanel VerticalAlignment="Stretch">
                        <TextBlock Text="Conent"/>
                    </StackPanel>
                </igWPF:ContentPane>
            </igWPF:SplitPane>
        </igWPF:XamDockManager>
    </Grid>

Thank you.

  • 54937
    Verified Answer
    Offline posted

    You have set the Width and Height of the xamDockManager. Whenever you set the Width or Height of a WPF element, then the element is measured and arranged with that extent regardless of the parent element so you should remove these (i.e. leave these set to NaN which is the default). Also, you have set the HorizontalAlignment to Left which basically means that the element will only be as wide as its DesiredSize Width - I think you want to remove this (so it is set to Stretch which is the default) if you want it to horizontally fill the Grid.

    Just a couple of notes about your snippet. First the Content can be anything but the only thing that is specially treated is DocumentContentHost which is used to provide a tabbed document interface. You have set the Content to a SplitPane but that pane and its elements will not be considered part of the dockmanager so they will not drag, unpin, etc. so you probably want to move this into the Panes collection of the XDM. Second, you have set the LayoutMode to FillContainer. FillContainer will only be honored if there is no Content specified. Essentially FillContainer causes the XDM to take the innermost docked SplitPane and have it fill the remaining area.