I am using the following xaml for laying out my application's UI using XamDockManager.
<Grid x:Name="mainGrid" > <DockPanel> <!--The docking manager and the controls contained within--> <dock:XamDockManager x:Name="dockingManager" Theme="Office2k7Black" Margin="0" DockPanel.Dock="Bottom"> <dock:XamDockManager.Panes>
//first split pane <dock:SplitPane dock:XamDockManager.InitialLocation="DockedTop"> <dock:ContentPane> //some control contained within </dock:ContentPane> <dock:ContentPane> //some control contained within </dock:ContentPane> </dock:SplitPane>
//second split pane - <dock:SplitPane dock:XamDockManager.InitialLocation="DockedBottom"> <dock:TabGroupPane dock:SplitPane.RelativeSize="100,200"> <dock:ContentPane> //some control contained within </dock:ContentPane> <dock:ContentPane> //some control contained within </dock:ContentPane> </dock:TabGroupPane> </dock:SplitPane> </dock:XamDockManager.Panes> </dock:XamDockManager> </DockPanel> </Grid>
Using the above code and the xamDockManager the two splitpanes contained within the XamDockManager.Panes collection do not fill the screen appropriately. The split panes are having their own width and height. There is also certain gap between the two split panes.
How can I adjust the split panes' width and height to be based on the screen's dimensions and also there should not be any gap between the two split panes.Also how can the first split pane occupy most of the UI while the second one docks to the bottom.
The XamDockManager is a ContentControl. The Content determines what fills the available area. SplitPane instances that are docked are simply docked to one edge of the control and their extent (Width for those docked left|right and Height for those docked top/bottom) determines how big the split pane is but they will never fill the control. The content for the XamDockManager can be any element that you want to be the fill content. If you use a DocumentContentHost as the Content then you can provide VS style tabbed document functionality and the panes within can be docked/undocked.
Can't we use anything other than the DocumentContentHost because my application does not require the VS style tabbed document functionality.Else can we have a solution with DocumentContentHost minus the VS style tabbed documents?
Is this feature available now in V12.2 ?
~Vasu
If you mean the ability to have the last pane of the XamDockManager's Panes collection fill the available area instead of leaving that area for the Content, you can set the LayoutMode to FillContainer.
Hi Andrew,
I was trying to follow the same solution you provided but using LayoutMode Just fills the height but width is still not filled. Please let me know how to fill width as well?
I'm not sure I follow. Basically when the LayoutMode is FillContainer the innermost docked pane fills (horizontally and vertically) the available area that would normally be used to display the content (assuming you don't have any content). Maybe you can post a sample that demonstrates your situation.
WPF DockManager specific
I have pane resize and overlap issues especially when the panes are docked adjacent (top and left) (top and right) (left and bottom) etc. I have the LayoutMode set to FillContainer but when resizing such a layout, some of the contained panes either overlap or leave free space (ie don't resize properly)
This doesn't happens when controls are docked in opposite direction (top and bottom) for example.
In most of the cases, the problematic container splitpane is the last one to be instantiated.
In my case, I have individual services hosted within DM and this issue is regardless of which service is placed where. Even multiple instance of same service is also causing this error, so it cannot be specific to my own service.
The zip file shows screenshots of overlapping and a sample workspace to try that out.
It might be best to create a new post since this isn't really related to the original issue discussed here. When you do you should include a project that demonstrates the issue. From the image it looks like you're using WindowsFormsHost and those won't be clipped by a WPF element that is smaller (e.g. the contentpane) so maybe you have a min height set on that WF grid within the WindowsFormsHost or otherwise something else is causing it to keep the height. The sample would help to understand what is causing that grid to keep that height.