ToolWindow Resize Problem

Docking/MDI for WPF Forum

Posted 6 years ago by Jason Stevenson - Senior Software Architect, Gemvision
Version: 18.1.0671
Avatar

Let me start by saying, I'm new to the product.  We are evaluating switching from DevExpress AvalonDock to ActiPro.  I'm having some issues with saving, loading, and changing the sizes of our tool windows.

 

I have ContainerMinSize specifed on each ToolWindow, each ToolWindow is within a ToolWindowContainer.  We have 2 on the Left, Workspace, and 3 on the Right.

For some reason when the parent window is Maximized they respect the sizes, but if the parent window is Normal state the containers revert to 1/2 size on left, and 1/3 size on right.

Also for some reason that I cannot reproduce, my main window can no longer resize those ToolWindows, however creating a new sample using the exact same Xaml (only different content in the ToolWindows) does work and allows them to resize.

Any help is appreciated, I'd like to get a working sample so we can purhcase this software.

 

<Window
    x:Class="MatrixGold.TestDock"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking"
    xmlns:local="clr-namespace:MatrixGold"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:views="clr-namespace:MatrixGold.Views"
    Title="TestDock"
    Width="800"
    Height="450"
    mc:Ignorable="d">
    <Grid>
 
        <!--  Dockable UI Panes  -->
        <docking:DockSite
            x:Name="dockSite"
            Margin="0,0,0,0"
            CanDocumentWindowsClose="False"
            DockPanel.Dock="Top"
            UseLayoutRounding="False">
 
            <docking:SplitContainer Orientation="Horizontal">
 
                <docking:SplitContainer Orientation="Vertical">
                    <docking:ToolWindowContainer>
                        <docking:ToolWindow
                            x:Name="Layers"
                            Title="Layers"
                            ContainerMinSize="200,311"
                            HasOptionsButton="True"
                            HasTitleBar="True"
                            IsFloating="False">
                            <TextBlock
                                HorizontalAlignment="Center"
                                Foreground="Black"
                                Text="LAYERS" />
                        </docking:ToolWindow>
                    </docking:ToolWindowContainer>
                    <docking:ToolWindowContainer>
                        <docking:ToolWindow
                            x:Name="Projects"
                            Title="Projects"
                            ContainerMinSize="200,778"
                            HasTitleBar="True"
                            IsFloating="False">
                            <TextBlock
                                HorizontalAlignment="Center"
                                Foreground="Black"
                                Text="PROJECTS" />
                        </docking:ToolWindow>
                    </docking:ToolWindowContainer>
                </docking:SplitContainer>
 
                <docking:Workspace x:Name="RhinoContainer">
                    <Grid
                        x:Name="AreaRhino"
                        Margin="0,0,0,0"
                        Background="{StaticResource BrushBuilderBackground}">
                        <TextBlock
                            HorizontalAlignment="Center"
                            Foreground="Black"
                            Text="MAIN" />
                    </Grid>
                </docking:Workspace>
 
 
                <docking:SplitContainer
                    MinWidth="300"
                    HorizontalAlignment="Stretch"
                    Orientation="Vertical">
                    <docking:ToolWindowContainer>
                        <docking:ToolWindow
                            x:Name="Properties"
                            Title="Properties"
                            ContainerMinSize="300,150"
                            HasTitleBar="True">
                            <TextBlock
                                HorizontalAlignment="Center"
                                Foreground="Black"
                                Text="PROPERTIES" />
                        </docking:ToolWindow>
                    </docking:ToolWindowContainer>
                    <docking:ToolWindowContainer>
                        <docking:ToolWindow
                            x:Name="QuickMenu"
                            Title="Quick Menu"
                            ContainerMinSize="300,236"
                            IsFloating="False">
                            <TextBlock
                                HorizontalAlignment="Center"
                                Foreground="Black"
                                Text="QUICK" />
                        </docking:ToolWindow>
                    </docking:ToolWindowContainer>
                    <docking:ToolWindowContainer>
                        <docking:ToolWindow
                            x:Name="Builders"
                            Title="Builders"
                            ContainerMinSize="300,697"
                            HasOptionsButton="True"
                            HasTitleBar="True"
                            IsFloating="False">
                            <TextBlock
                                HorizontalAlignment="Center"
                                Foreground="Black"
                                Text="BUILDERS" />
                        </docking:ToolWindow>
                    </docking:ToolWindowContainer>
                </docking:SplitContainer>
 
 
            </docking:SplitContainer>
        </docking:DockSite>
    </Grid>
</Window>

[Modified 6 years ago]

Jason Stevenson

Comments (6)

Posted 6 years ago by Jason Stevenson - Senior Software Architect, Gemvision
Avatar

Content moved to original post.

[Modified 6 years ago]

Jason Stevenson

Posted 6 years ago by Jason Stevenson - Senior Software Architect, Gemvision
Avatar

It also appears that when the parent window is not maximized, I cannot resize the ToolWindows, probably related to the same issue...  Just maximize the window, and they are resizable again...

Jason Stevenson

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Jason,

Thank you for evaluating our product.

I think you might have confused the ContainerMinSize with ContainerDockedSize.  The ContainerMinSize you are using tries to make sure those containers are never smaller than the specified size.  That might be why you can't resize in certain cases, if the containers are at or already smaller than those sizes.  If you switch all your ContainerMinSize settings to ContainerDockedSize, I think it might behave more like what you intended.


Actipro Software Support

Posted 6 years ago by Jason Stevenson - Senior Software Architect, Gemvision
Avatar

ContainerDockedSize does now allow me to resize the containers again, but I still need a minimum size.

It still appears to resize the containers when I maximize the parent window.  It is as if, the tool windows are using a percentage height when splitting instead of an absolute height.  So that ratio appears to be maintained, but everything get's bigger when the window maximizes.

Is there instead a way to put limits on the containers, or to specify that only one of the containers should fill the remaining space?  Like in a DockPanel LastChildFill scenario?

Jason Stevenson

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

Hi Jason,

The only portion of a docking layout that behaves like a DockPanel.LastChildFill is the Workspace control.  Anything else will try to retain its proportions as the split container grows/shrinks. 

That being said, you can set the ContainerMinSize and ContainerMaxSize properties to try and prevent containers from growing past the designated size thresholds and that might help in your scenario if you know they shouldn't grow past a certain point.  Just be careful what you set for those properties since they will also affect the ability to resize containers.  Our code tries to keep the containers within the thresholds you may set.


Actipro Software Support

Posted 6 years ago by Jason Stevenson - Senior Software Architect, Gemvision
Avatar

Thank you.  I believe I have the correct mix of properties and have the behavior I need.

Jason Stevenson

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.