I am having several layout issues using the XamDockManager. The following is a very stripped-down version of the XAML for my application:
<Page ...> <DockPanel> <TextBlock DockPanel.Dock="Top">PDC Margin</TextBlock> <local:Ribbon DockPanel.Dock="Top" /> <igDock:XamDockManager> <igDock:XamDockManager.Panes> <igDock:SplitPane Name="spMainPage"> <igDock:ContentPane Width="300" /> </igDock:SplitPane> <igDock:SplitPane Name="splitMain"> <igDock:TabGroupPane> <ContentPane> <igDock:XamDockManager> <igDock:XamDockManager.Panes> <igDock:SplitPane SplitterOrientation="Horizontal" igDock:XamDockManager.InitialLocation="DockedLeft"> <igDock:ContentPane> <xcdg:DataGridControl /> </igDock:ContentPane> <igDock:ContentPane> <xcdg:DataGridControl /> </igDock:ContentPane> </igDock:SplitPane> <igDock:SplitPane SplitterOrientation="Horizontal" igDock:XamDockManager.InitialLocation="DockedRight"> <igDock:ContentPane> <xcdg:DataGridControl /> </igDock:ContentPane> <igDock:ContentPane> <xcdg:DataGridControl /> </igDock:ContentPane> <igDock:ContentPane> <!-- Some controls here --> </igDock:ContentPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager> </ContentPane> </igDock:TabGroupPane> </igDock:SplitPane> </igDock:XamDockManager.Panes> </igDock:XamDockManager> </DockPanel></Page>
Upon starting my app, this is the result I see:
As can be seen, the SplitPane on the far right containing the three ContentPanes arranged vertically is squashed right up against the edge of the browser window.
If I click and drag the splitter to the left of this SplitPane on the left edge of the splitter (where the red arrow points) in the left direction, it resizes perfectly as below, but if I click and drag on the right edge of the splitter, it doesn't allow me to drag leftwards, it only allows me to drag rightwards.
However, as soon as I even touch the right edge of the splitter (green arrow), the right-hand SplitPane loses its anchorage to the right edge of the browser window. This results in perculiar resizing issues. If I drag the splitter leftwards (by the red arrow), the left SplitPane gets smaller, the splitter moves to where the mouse button is released (as expected), but the right SplitPane stays the same size but moves left. If I drag the splitter rightwards (by the green arrow), when I release the mouse button, the splitter returns to its original position but the width of the right-hand SplitPane goes smaller by the amount I attempted to drag the splitter by, leaving a big gap. See below:
If I now try to drag the right-hand edge of the the right-hand SplitPane (adjacent to the big gap) rightwards, the SplitPane's width doesn't increase, it stays the same size but just moves horizontally by the same distance dragged. See below:
The behaviour I would like instead of all the above is for the panes to fill up the space nicely and remain anchored to adjacent window/pane edges as the splitters and edges are dragged around. And certainly for the splitters to not have two almost indiscernible edges. How can I achieve this?
Many thanks,
Jason
PS: I've noticed that the screenshots are clipped due to the reduced width of the discussion window, it never used to be so thin!
First, let me state some facts about the xaml snippet you provided and the layout that will result.
* You have an outer xamDockManager that has 2 root splitpane -both are docked to the left (since the InitialPaneLocation was not set).
* In the 1st outer root split pane, you can contain a single ContentPane. Since that ContentPane has an explicit Width, that split pane may be able to get smaller/larger but the ContentPane will not. In WPF when you set an explicit width that is the width that the element will always be until something explicitly changes that value - which normally doesn't happen. If you want that split and its contentpane to be resizable then you should set the Width on the root SplitPane itself. When its splitter is moved that will adjust the Width of the associated root splitpane.
* In the 2nd outer root split pane, you have a tabgrouppane with a single ContentPane. That ContentPane contains a XamDockManager as its content. Since this pane is docked on the left and since it has been given no explicit Width on the outer root splitpane, the content (the tabgrouppane in this case) will be measured with an infinite width - i.e. it will be sized based on the (desired) size of the content.
* The inner xamdockmanager has 2 split panes - one docked left and one docked right. Again neither have an explicit width so their content will be measured/arranged based on their desired size.
XtreemX said: As can be seen, the SplitPane on the far right containing the three ContentPanes arranged vertically is squashed right up against the edge of the browser window.
XtreemX said:but if I click and drag on the right edge of the splitter, it doesn't allow me to drag leftwards, it only allows me to drag rightwards
XtreemX said:However, as soon as I even touch the right edge of the splitter (green arrow), the right-hand SplitPane loses its anchorage to the right edge of the browser window. This results in perculiar resizing issues. If I drag the splitter leftwards (by the red arrow), the left SplitPane gets smaller, the splitter moves to where the mouse button is released (as expected), but the right SplitPane stays the same size but moves left. If I drag the splitter rightwards (by the green arrow), when I release the mouse button, the splitter returns to its original position but the width of the right-hand SplitPane goes smaller by the amount I attempted to drag the splitter by, leaving a big gap.
XtreemX said: The behaviour I would like instead of all the above is for the panes to fill up the space nicely and remain anchored to adjacent window/pane edges as the splitters and edges are dragged around. And certainly for the splitters to not have two almost indiscernible edges. How can I achieve this?