Default docking size for floating windows

Docking/MDI for WPF Forum

Posted 6 years ago by Gian Luca Lavelli
Version: 12.1.0561
Avatar

Hello,

I am displaying a number of floating ToolWindows at runtime that can also be docked by the user. What I can't understand, is how to keep the size (width or height depending if it's docked on left/right or top/bottom) that the ToolWindow has when floating, when it's docked.

At the moment I tried achieving this using the following

private void DockSite_WindowStateChanged(object sender, DockingWindowStateChangedEventArgs e)
{
    if (e.NewValue == DockingWindowState.Docked)
    {
        UserControl uc = (e.Window.Content as UserControl);
        DockSite.SetControlSizeForState(e.Window, uc.RenderSize, DockingWindowState.Docked);
    }
}

 But to no avail; if I debug the code, I can see that the values are correctly set by calling GetControlSizeForState, but what is on screen is different.

How can I solve this?

 

Thanks

Comments (2)

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

Hi Gian,

You can't set the ControStateForSize property value there as it will be too late.  You'd need to set it prior to the docking operation occurring.  So perhaps in the DockSite's WindowDragging or in the WindowContextMenu event (before any of those commands can execute).


Actipro Software Support

Posted 6 years ago by Gian Luca Lavelli
Avatar

Thanks a lot, I feel kind of dumb as I have been reading the event name as WindowStateChangING for the last 2 days, and was wondering why it didn't work..

The latest build of this product (v2018.1 build 0675) 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.