
In our product we only use Docking/MDI programmatically, nothing is preconfigured in XAML. One of our use cases is having a document tab and a tool window at the bottom, which can be opened and closed at any time, below MDI area. One of our users complained that when another tool window is docked on the left or the right then newly opened tool window on the bottom takes the whole viewport horizontally, so that previously docked left/right tool window is resized vertiaclly.
Here is an illustrative screenshot: https://snipboard.io/CVGgTA.jpg
We open new tool windows in the following way:
var window = new ToolWindow(dockSite)
{
State = DockingWindowState.Docked,
DefaultDockSide = Side.Bottom
};
window.Open();
Setting
e.Target
in DockingWindow.DefaultLocationRequested
and DockSite.WindowDefaultLocationRequested
doesn't make window appear directly under MDI area, it still takes the whole horizontal dimension.But we figured that calling
window.Dock(dockSite.DocumentWindows.FirstOrDefault(), Side.Bottom)
after opening a new tool window results in something very close to what we need but it makes State == DockingWindowState.Document
. It actually corresponds to one of the options that appear when a window is dragged in GUI. But we need another option, the bottom one (State = DockingWindowState.Docked
).See screenshot: https://snipboard.io/FTMGfc.jpg
How can it be achieved programmatically?