EnableWindowDrag
is an option on IDocumentDock
and its implementations. When set to true
, the empty area of the document tab strip works as a drag handle for the host window.
Enabling the property lets users reposition a floating or main window by dragging the tab bar instead of the standard title bar. This is useful when the window chrome is hidden or when you want the tabs to act as the natural drag area for the window.
Set the property when creating your document docks:
var documents = new DocumentDock
{
EnableWindowDrag = true,
// other options
};
The same property is available on the Avalonia control DocumentDock
and can also be set in XAML:
<avaloniaDock:DocumentDock EnableWindowDrag="True" />
With the property enabled, DocumentTabStrip
listens for pointer events on its background and calls BeginMoveDrag
on the surrounding HostWindow
. The user can grab the tab area and drag the entire window.
See the Advanced guide for details on customizing floating windows.