To reproduce:
- Dock a tool window in a black RadDock.
- Drag and drop the toolwindow in the top, bottom, right or left docking guides in the center.
- The tool window is docked as document window and fills the entire space.
Workaround:
public Form1()
{
InitializeComponent();
DragDropService service = this.radDock1.GetService<DragDropService>();
service.PreviewHitTest += service_PreviewHitTest;
radDock1.DockStateChanged += radDock1_DockStateChanged;
}
void radDock1_DockStateChanged(object sender, DockWindowEventArgs e)
{
if (dropTarget is DocumentContainer)
{
if (position != null && position != "Fill")
{
e.DockWindow.DockState = DockState.Docked;
switch (position)
{
case "Top":
radDock1.DockWindow(e.DockWindow, DockPosition.Top);
break;
case "Left":
radDock1.DockWindow(e.DockWindow, DockPosition.Left);
break;
case "Right":
radDock1.DockWindow(e.DockWindow, DockPosition.Right);
break;
case "Bottom":
radDock1.DockWindow(e.DockWindow, DockPosition.Bottom);
break;
}
position = null;
}
}
}
string position = null;
object dropTarget = null;
void service_PreviewHitTest(object sender, DragDropHitTestEventArgs e)
{
if (e.HitTest.GuidePosition != null)
{
dropTarget = e.DropTarget;
position = e.HitTest.DockPosition.Value.ToString();
Console.WriteLine(e.DropTarget);
}
}