Setting Width/Height parameters for ToolWindow/SplitContaine

Docking/MDI for WPF Forum

Posted 14 years ago by Ujjwal Lahoti
Avatar
I have created my GUI using nested SplitContainers. And the bottom of the tree there are ToolWindows which contain the actual content. I am facing challenges to provide proper width to different containers. If I specify Width, then that container gets that Width, but then there is lot of empty space left, which is not occupied by other windows. eg.

                    <docking:SplitContainer Orientation="Horizontal" >
                        <docking:SplitContainer Orientation="Vertical" >
                            <docking:SplitContainer Orientation="Horizontal" >
                                <docking:ToolWindowContainer>
                                    <docking:ToolWindow x:Name="rfPhyConfigLeft" Title="RF/Physical Configuration">
                                        <Grid>
                                        </Grid>
                                    </docking:ToolWindow>
                                </docking:ToolWindowContainer>

                                <docking:SplitContainer Orientation="Vertical" >
                                    <docking:ToolWindowContainer>
                                        <docking:ToolWindow x:Name="logicalConfig" Title="Logical Configuration">
                                            <Grid>
                                            </Grid>
                                        </docking:ToolWindow>
                                    </docking:ToolWindowContainer>

                                    <docking:SplitContainer Orientation="Horizontal" >
                                        <docking:SplitContainer Orientation="Vertical" >
                                            <docking:ToolWindowContainer>
                                                <docking:ToolWindow x:Name="pdpProfile" Title="Power Delay Profile">
                                                    <Grid>
                                                    </Grid>
                                                </docking:ToolWindow>
                                            </docking:ToolWindowContainer>

                                            <docking:ToolWindowContainer>
                                                <docking:ToolWindow x:Name="correlation" Background="Cornsilk" Title="Correlation" MinWidth="100" MaxHeight="50">

                                                    <Grid Margin="5">
                                                    </Grid>
                                                </docking:ToolWindow>
                                            </docking:ToolWindowContainer>
                                        </docking:SplitContainer>

                                        <docking:ToolWindowContainer>
                                            <docking:ToolWindow x:Name="chanPlayer" Title="Channel Player">
                                            </docking:ToolWindow>
                                        </docking:ToolWindowContainer>
                                    </docking:SplitContainer>
                                </docking:SplitContainer>
                            </docking:SplitContainer>

                            <docking:ToolWindowContainer>
                                <docking:ToolWindow x:Name="testEventsWindow" Title="Test Events" CanClose="False">
                                        <Grid>
                                        </Grid>
                                </docking:ToolWindow>
                            </docking:ToolWindowContainer>
                        </docking:SplitContainer>

                        <docking:ToolWindowContainer>
                                <docking:ToolWindow Width="350" MaxWidth="350" x:Name="rfPhyConfigRight" Title="Instrument1: RF Configuration">
                                        <Grid>
                                        </Grid>                                
                            </docking:ToolWindow>
                        </docking:ToolWindowContainer>
                    </docking:SplitContainer>
In the example above, specifying Width to ToolWindow has no effect. However if I specify width to ToolWindowContainer, then it does take effect for than window, however then other ToolWindows don't resize properly. I am not able provide the layout properly.

Here are some of the things I am trying to do

1. Able to specify Min and Max Widths, and default widths to different Windows. (Both programmatically and in XAML)
2. If the Width/Height due to window resizing goes below the MinWidth/MinHeight requirement, then I want scrollbars to appear

If you have an example, that assigns widths to different Toolwindows in Docking/MDI it would be very useful.

[Modified at 03/31/2010 11:39 PM]

Comments (2)

Posted 14 years ago by Arthur Damen
Avatar
I too find this very anoying and haven't got a solution until now.
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ujjwal,

Please take a look at the "Docking & MDI Layout, Globalization, and Accessbility Features / Programmatic Layout" documentation topic. That tells you how to resize slots programmatically and also links to the other topic that talks about setting initial sizes of docking windows. You can't use the normal properties like Width, MinWidth, etc. because those will prevent the layout from resizing correctly.

We don't support min/max width for layouts at this time. It's on the TODO list and we'll add your request to that item. If you wish to have scrollbars show up then you should wrap your docking window content with a ScrollViewer.

The ToolWindowInnerFill QuickStart shows setting initial sizes in XAML and the ProgrammaticSizing QuickStart is a good example for programmatically resizing the layout.


Actipro Software Support

The latest build of this product (v24.1.2) was released 0 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.