Autohide window gets random size

Docking/MDI for WPF Forum

Posted 7 years ago by Berge Aadland
Version: 11.2.0552
Avatar
Hello, I've put a AutohideTopContainers section containing a ToolWindowContainer section with two rafted ToolWindows inside. When I hover over the tabs; the toolwindows does expand with a "Slide, Fade" animation BUT the border of the animated container comes much further down on the page than with only a little content at the very top (I've only put in a very small section inside the Toolwindow - a UserControl containing a Grid with Height="70"). When I hover back and forth between the toolwindow tabs sometimes the border of the container is in the correct position and sometimes it's far down the page... How can i stop this random behavior?

    <Docking:DockSite AutoHidePerContainer="False">
        <Docking:DockSite.AutoHideTopContainers>
            <Docking:ToolWindowContainer Height="70" VerticalAlignment="Top">
                <Docking:ToolWindow Name="File" Title="Menu1" CanClose="False" CanAutoHide="True" CanBecomeDocument="False" CanDockTop="True" CanDockRight="False" CanDockLeft="False" CanDockBottom="False" CanDrag="False" CanDragToLinkedDockSites="False" CanMaximize="False" CanRaft="True" CanStandardMdiMaximize="False" CanStandardMdiMinimize="False" HasTitleBar="False">
                    <Views:Menu1 />
                </Docking:ToolWindow>
                <Docking:ToolWindow Name="File2" Title="Menu2"  CanClose="False" CanAutoHide="True" CanBecomeDocument="False" CanDockTop="True" CanDockRight="False" CanDockLeft="False" CanDockBottom="False" CanDrag="False" CanDragToLinkedDockSites="False" CanMaximize="False" CanRaft="True" CanStandardMdiMaximize="False" CanStandardMdiMinimize="False" HasTitleBar="False">
                    <Views:Menu2 />
                </Docking:ToolWindow>
            </Docking:ToolWindowContainer>
        </Docking:DockSite.AutoHideTopContainers>

        <Docking:SplitContainer Orientation="Vertical"> 
            <Docking:Workspace>
                <Docking:TabbedMdiHost>
                    <Docking:TabbedMdiContainer>
                        <Docking:DocumentWindow Title="MasterPlan.txt" Description="Text document">
                            <TextBox BorderThickness="0" TextWrapping="Wrap" Text="This is a document window." />
                        </Docking:DocumentWindow>
                    </Docking:TabbedMdiContainer>
                </Docking:TabbedMdiHost>
            </Docking:Workspace>


            <Docking:SplitContainer Orientation="Vertical">
                <Docking:ToolWindowContainer>
                    <Docking:ToolWindow Title="Controls" CanBecomeDocument="False" CanClose="False">
                        <Views:ControlList VerticalAlignment="Stretch" HorizontalAlignment="Stretch"/>
                    </Docking:ToolWindow>
                </Docking:ToolWindowContainer>
            </Docking:SplitContainer>
        </Docking:SplitContainer>
    </Docking:DockSite> 
[Modified at 02/17/2012 01:40 AM]

Comments (2)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Berge,

I'm not exactly sure what the issue could be. If you are using Interop content, such as WinForms controls, then our fade/slide animation cannot be used. You would need to set DockSite.UseHostedAutoHidePopups to false, which toggles a mode that better supports Interop content.

If that doesn't help please put together a small sample project that reproduces your issue and email it over then we can take a closer look. Be sure to remove any executables or change the extension of the zip file to ensure it gets past our email filters.


Actipro Software Support

Answer - Posted 7 years ago by Berge Aadland
Avatar

After creating a full test project and sending to Actipro they promptly sent me a reply with a working solution. I thought I'd share it if anyone else has same problem.

You should not be setting the Height/Width or VerticalAlignment/HorizontalAlignment properties on the ToolWindowContainer. 
If you remove Height="70" VerticalAlignment="Top" from your MainWindow.xaml and rebuild, then it will display properly.

If you are trying to set the initial size of the ToolWindowContainer,  
 then you'd need to set ActiproDocking:DockSite.ControlSize="70,70" on the ToolWindowContainer. 
We just fixed a bug where this setting is not getting passed down to all the ToolWindows,  
 so you would also need to set it on the ToolWindows until the next maintenance release is out.

Following the first advice to remove my formatting did not help much as the initial size of the drop down toolwindowcontainer was far too large. But adding the controlsize attribute fixed it all so working code became something like

<Window x:Class="Docking.Views.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ActiproDocking="http://schemas.actiprosoftware.com/winfx/xaml/docking"
        xmlns:Views="clr-namespace:Docking.Views"
        Title="MainWindow" Height="350" Width="525">
    <ActiproDocking:DockSite AutoHidePerContainer="False">
        <ActiproDocking:DockSite.AutoHideTopContainers>
            <ActiproDocking:ToolWindowContainer ActiproDocking:DockSite.ControlSize="70,70">
                <ActiproDocking:ToolWindow ActiproDocking:DockSite.ControlSize="70,70" Name="Menu1" Title="Menu1" CanClose="False" CanAutoHide="True" CanBecomeDocument="False" CanDockTop="True" CanDockRight="False" CanDockLeft="False" CanDockBottom="False" CanDrag="False" CanDragToLinkedDockSites="False" CanMaximize="False" CanRaft="True" CanStandardMdiMaximize="False" CanStandardMdiMinimize="False" HasTitleBar="False">
                        <Views:MenuBar />
                    </ActiproDocking:ToolWindow>
                <ActiproDocking:ToolWindow ActiproDocking:DockSite.ControlSize="70,70" Name="Menu2" Title="Menu2" CanClose="False" CanAutoHide="True" CanBecomeDocument="False" CanDockTop="True" CanDockRight="False" CanDockLeft="False" CanDockBottom="False" CanDrag="False" CanDragToLinkedDockSites="False" CanMaximize="False" CanRaft="True" CanStandardMdiMaximize="False" CanStandardMdiMinimize="False" HasTitleBar="False">
                        <Views:MenuBar />
                    </ActiproDocking:ToolWindow>                
            </ActiproDocking:ToolWindowContainer>
        </ActiproDocking:DockSite.AutoHideTopContainers>
        
        <ActiproDocking:SplitContainer Orientation="Vertical">
            <ActiproDocking:Workspace>
                <ActiproDocking:TabbedMdiHost>
                    <ActiproDocking:TabbedMdiContainer>
                        <ActiproDocking:DockingWindow Title="Workwindow1.txt" Description="TextDocument">
                            <TextBox TextWrapping="Wrap" Text="This is the document window" />
                        </ActiproDocking:DockingWindow>
                    </ActiproDocking:TabbedMdiContainer>
                </ActiproDocking:TabbedMdiHost>
            </ActiproDocking:Workspace>

            <ActiproDocking:SplitContainer Orientation="Vertical">
                <ActiproDocking:ToolWindowContainer>
                    <ActiproDocking:ToolWindow Title="Controls" CanBecomeDocument="False" CanClose="False">
                        <TextBox Text="Controls goes here" />
                    </ActiproDocking:ToolWindow>
                </ActiproDocking:ToolWindowContainer>            
            </ActiproDocking:SplitContainer>            
        </ActiproDocking:SplitContainer>
    </ActiproDocking:DockSite>
</Window>

noticed that i gave a new alias ActiproDocking: instead of the usual docking: prefix.

Happend cause I was silly and called my solution/Project for Docking thus ending up with a namespace allready called Docking ;D

Hope it helps someone out there

-Berge

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.