Programatically resize splitter panels

Docking/MDI for WPF Forum

Posted 15 years ago by Bill Morgenweck
Version: 4.5.0487
Avatar
I am using the following code to create various toolwindows. How can I programatically resize the windows and also save the layout for the next time the window is opened?
What I want to end up with is an Outlook like layout.
Thanks
Bill

    <docking:DockSite x:Name="dockSite" Grid.Row="0">
            <docking:SplitContainer Orientation="Horizontal">
                <docking:ToolWindowContainer  docking:DockSite.ControlSize="50, 499" >
                <docking:ToolWindow x:Name="LeftPanel" Title=""  CanAutoHide="False" HasOptions="False">
                    <TextBox BorderThickness="0" Text="LeftPanel" />
                </docking:ToolWindow>
           </docking:ToolWindowContainer> 
            <docking:ToolWindowContainer docking:DockSite.ControlSize="50, 499">
                        <docking:ToolWindow Title="Fixed" CanAttach="False" CanDrag="False" HasTitleBar="False" x:Name="TreePanel" CanAutoHide="True">
                            <TextBlock Margin="7" Text="This tool window is 'fixed' and cannot move.  Other tool windows may not be attached to it, however they may be docked around it." TextWrapping="Wrap" />
                          </docking:ToolWindow>                   
                </docking:ToolWindowContainer>
                <docking:ToolWindowContainer docking:DockSite.ControlSize="150, 200">
                    <docking:ToolWindow Title="Fixed" CanAttach="False" CanDrag="False" HasTitleBar="False">
                                            
                 <docking:SplitContainer Orientation="Vertical">
                            <docking:ToolWindowContainer docking:DockSite.ControlSize="150, 200">

                                <docking:ToolWindow x:Name="CenterTop" Title="" CanAutoHide="False" HasOptions="False">
                                    <TextBox BorderThickness="0" Text="LeftPanel" />
                                </docking:ToolWindow>
                                
                            </docking:ToolWindowContainer>

                            <docking:ToolWindowContainer docking:DockSite.ControlSize="150, 200">

                                <docking:ToolWindow x:Name="CenterBottom" Title="" CanAutoHide="False" HasOptions="False">
                                    <TextBox BorderThickness="0" Text="LeftPanel" />
                                </docking:ToolWindow>

                            </docking:ToolWindowContainer>
                        </docking:SplitContainer>
                     
                    </docking:ToolWindow>
                </docking:ToolWindowContainer>
               
                <docking:ToolWindowContainer docking:DockSite.ControlSize="150, 200">

                    <docking:ToolWindow x:Name="RightPanel" Title="" CanAutoHide="False" HasOptions="False">
                        <TextBox BorderThickness="0" Text="RightPanel" />
                    </docking:ToolWindow>
                </docking:ToolWindowContainer>


            </docking:SplitContainer> 
            
            </docking:DockSite>

Comments (4)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Bill,

Right now I don't believe there is a way to programmatically resize the objects in a split container (other than initially with DockSite.ControlSize) but that is something we will add to our TODO list.

The layout serialization feature is described in the documentation and a sample is available in the main demo in the Layout document tab. Check those out.


Actipro Software Support

Posted 15 years ago by Bill Morgenweck
Avatar
I have the DockSiteLayoutSerializer working fine however it will not save the position of a SplitContainer Orientation="Vertical". I have a small app but I'm not sure how to upload it.
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Bill,

You can email a simple sample project to our support address. Please reference this post too. Thanks.


Actipro Software Support

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Bill,

Just an fyi, we've added some resizing functionality for the next maintenance release. The new functionality allows the items of a SplitContainer to be resized based on specified ratios (which is a percentage of the SplitContainer's size). But, we still have a TODO item to handle setting an explicit size on a ToolWindow/DocumentWindow/etc.


Actipro Software Support

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.