I Have the following XAML.., and I want that the height of each the 3 ContentPane to be adjusted based on the height of the controls within them. All the three controls have a simple grid with a StackPanel and labels stacked vertically in it. No Height is explicitly stated within these controls (labels, grids or stackpanels). Right now, there is extra space in the 1st ContentPane but some labels in the 3rd pane are getting cut.
<my:XamDockManager Grid.Row="1" Grid.Column="0">
<my:XamDockManager.Panes>
<my:SplitPane SplitterOrientation="Horizontal" VerticalAlignment="Top" MinHeight="560" Height="600">
<my:ContentPane Name="cpSummaryA" Header="Summary A" IsHitTestVisible="False" CloseButtonVisibility="Collapsed" PinButtonVisibility="Hidden" WindowPositionMenuVisibility="Hidden" >
<local:UCSummaryA x:Name="ucSummaryA" >local:UCSummaryA>
my:ContentPane>
<my:ContentPane Name="cpSummaryB" IsHitTestVisible="False" Header="Summary B" HorizontalAlignment="Left" CloseButtonVisibility="Collapsed" PinButtonVisibility="Hidden" WindowPositionMenuVisibility="Hidden">
<local:UCSummaryB x:Name="ucSummaryB" >local:UCSummaryB>
<my:ContentPane Name="cpSummaryC" Header="Summary B" IsHitTestVisible="False" HorizontalAlignment="Left" CloseButtonVisibility="Collapsed" PinButtonVisibility="Hidden" WindowPositionMenuVisibility="Hidden">
<local:UCSummaryC x:Name="ucSummaryC" >local:UCSummaryC>
my:SplitPane>
my:XamDockManager.Panes>
<my:DocumentContentHost>......my:DocumentContentHost>
Thanks for the prompt reply. Okay got it - I had misunderstood how this ratio of RelativeSize property was being used.
The Width of the RelativeSize would be used if the panes in the SplitPane are arranged horizontally. The Height of the RelativeSize would be used if the panes within are arranged vertically. Based on your snippet I thought the panes were arranged vertically in which case the panes will be equal size since you are using the same height in the RelativeSize for each.
The ReliaveSize property settings are not working for some reason - I did look at the example in FeatureBrowser it looks quite straight forward.
In my above mentioned code snippet, I simply added my:SplitPane.RelativeSize="50,300" to the 3 Content Panes. I used the ratios 50/300, 50/300 and 200/300 but their heights are still equal.
Thanks.
The xamDockManager doesn't size the panes based on the size of the content except with regards to the extent opposite to the docked edge. E.g. if you have a root (i.e. directly in the Panes collection of the xamDockMaanger) SplitPane docked to the Left/Right and its Width is not set (i.e. left set to NaN) then it's width is based on the width of the desired size of the children after measuring them with the available size. However, the height of the pane docked to Left/Right is based on the remaining space similar to what a DockPanel would do and therefore it's extent in that orientation cannot be based on the children. To determine the size of the children in that orientation the SplitPane uses the attached RelativeSize property. There is currently no mode where panes are distributed based on their desired size in that orientation.