Docksite.AutoHideLeftContainers initial Width

Docking/MDI for WPF Forum

Posted 9 years ago by Rod Kuhns
Version: 10.1.0523
Avatar
I have a ToolWindow that opens or "flys-out" for which I would like to set the width that it opens to. My content is a treeView control for which the right side is being cut off with the default width. I can drag and resize the control at runtime, but have not figured out how to set the width in xaml. My last attempt (shown below) was an attempt set a width on everything, the ToolWindowContainer, the DockSite.ControlSize, the StackPanel etc. I can set these values to anything and none of these Width settings change the initial opening size. How do I set the width the tool window opens with?

WPF Toolkit v3.5.40128.1

            <docking:DockSite.AutoHideLeftContainers>
                <docking:ToolWindowContainer Width="300">
                    <docking:ToolWindow  x:Name="autoHideLeft" Title="Layer Manager" CanClose="False" 
                                        docking:DockSite.ControlSize="575,300" CanAutoHide="True" Width="300">
                        <StackPanel 
                                        Name="stackPanel1" 
                                        Background="Gray"
                                        VerticalAlignment="Top"
                                        Width="300">
                            <ContentPresenter
                                        Content="{Binding Path=LayerManagerViewModel, Mode=OneWay}" Width="300">
                            </ContentPresenter>
                        </StackPanel>
                    </docking:ToolWindow>
                </docking:ToolWindowContainer>
            </docking:DockSite.AutoHideLeftContainers>

Comments (2)

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

The Width and Height values on the ToolWindowContainer are not used. This is because the ToolWindowContainer would be a different size depending on whether it is docked to the top/bottom or left/right.

Instead, the DockSite.ControlSize attached property should be set on the ToolWindowContainer. The x value determines the width when docked to the left or right. The y value determines the height when docked to the top or bottom.

Note that the code you've pasted above does use this attached property, but it should be on the ToolWindowContainer rather than the ToolWindow.

Once you've put the DockSite.ControlSize attached property onto the ToolWindowContainer, be sure to remove the places where you have set the Width property on the docking components.

Please let us know if you have further questions.


Actipro Software Support

Posted 9 years ago by Rod Kuhns
Avatar
Thank you - that was exactly what I needed!
The latest build of this product (v2019.1 build 0683) 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.