Hi! Using the DockManager, I have created the following Layout. It has a ribbon bar on top, a large filling pane on the right and a split pane with two panes inside on the left:
<DockPanel> <Frame DockPanel.Dock="Top" Source="Views/Ribbon.xaml"></Frame> <igDock:XamDockManager LayoutMode="FillContainer" Theme="Office2010Blue"> <igDock:XamDockManager.Panes> <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedLeft" SplitterOrientation="Horizontal" Width="220"> <igDock:TabGroupPane MaxHeight="80"> <igDock:ContentPane x:Name="ViewLeftTop"> <Frame Source="Views/ViewLeftTop.xaml"></Frame> </igDock:ContentPane> </igDock:TabGroupPane> <igDock:ContentPane x:Name="ViewLeftBottom"> <Frame Source="Views/ViewLeftBottom.xaml"></Frame> </igDock:ContentPane> </igDock:SplitPane> <igDock:SplitPane igDock:XamDockManager.InitialLocation="DockedBottom"> <igDock:TabGroupPane> <igDock:ContentPane x:Name="CefBrowser"> <cef:CefBrowser></cef:CefBrowser> </igDock:ContentPane> </igDock:TabGroupPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager> </DockPanel>
I would like to have one of the panes ("ViewLeftTop") in the split pane have a fixed height and have the other one take up all remaining vertical space. The samples I found use relative size
igDock:SplitPane.RelativeSize="100,40"
which in my case is not sufficient. When the user resizes the window, the fixed height pane should not change height. Can you please advice?
Hello Kurt,
Thank you for your post. I have been looking into your requirements and I believe the best option is using the RelativeSize attached property. You are right that once the XamDockManager/ Window changes its size the specified heights would be changed because the SplitPane uses the RelativeSize of each visible child in its panes collection to determine how to distribute the space between the children. In order to handle the case where the XamDockManager size changes I use its SizeChanged event and set the RelativeSize of the bottom content pane to the XamDockManager’s ActualHeight – 80 (as this is the height I saw in the code snippet you provided). For your reference I’m attaching a sample project where this approach is used.
private void XamDockManager_SizeChanged(object sender, SizeChangedEventArgs e)
{
double xdmHeight = Math.Round((sender as XamDockManager).ActualHeight, 0);
double heightBottomPane = ((xdmHeight - 80) > 0) ? (xdmHeight - 80) : 1;
ViewLeftBottom.SetValue(SplitPane.RelativeSizeProperty, new Size(80, heightBottomPane));
}
This way the top pane doesn’t change its height dramatically unless there’s no more space to accommodate it.
If you have any further questions on the matter do not hesitate to contact us.