AvalonDock.DockingManager is the root control of AvalonDock. It hosts the entire docking layout, manages floating windows, handles drag-and-drop operations, and applies themes.
The root of the layout tree. Set this to define or replace the entire layout.
DockLayout
IRootDock
The MVVM layout model. When set, the manager keeps this ViewModel tree in sync with the internal layout. Leave it null for classic (v4.x) mode.
Theme
Theme
The active theme. Change at runtime to switch themes.
ActiveContent
object
The currently active content (document or anchorable). Bindable.
LayoutEngine
ILayoutEngine
The engine performing layout tree operations. Overridden by ToggleDockingManager.
Data Binding (MVVM)
Property
Type
Description
DocumentsSource
IEnumerable
Bind to a collection of document view models.
AnchorablesSource
IEnumerable
Bind to a collection of anchorable view models.
LayoutItemTemplate
DataTemplate
Default template for rendering the content of documents and anchorables.
LayoutItemTemplateSelector
DataTemplateSelector
Select templates based on content type.
DocumentHeaderTemplate
DataTemplate
Template for the tab header of a document.
DocumentTitleTemplate
DataTemplate
Template for the title of a document.
AnchorableHeaderTemplate
DataTemplate
Template for the header of an anchorable.
AnchorableTitleTemplate
DataTemplate
Template for the title of an anchorable.
LayoutItemContainerStyle
Style
Style applied to LayoutItem containers (target type: LayoutItem).
LayoutItemContainerStyleSelector
StyleSelector
Select container styles based on content type.
Behavior
Property
Type
Description
AllowMixedOrientation
bool
Allow panels with mixed horizontal/vertical orientation.
AllowFloatingWindows
bool
Whether content can be torn off into floating windows at all. Default true. See Floating Windows.
AllowDetachedWindows
bool
Whether anchorables can be moved into standalone top level windows (“Window” view mode). Default true.
ShowSystemMenu
bool
Show system menu on floating windows.
AllowDrop
bool
Enable drag-and-drop docking (inherited from WPF).
AutoHideDelay
int
Delay in milliseconds before an auto-hidden tool window slides shut.
SupportsAutoHideFlyout
bool
Whether auto-hidden anchorables are shown in the classic slide-out flyout. false for ToggleDockingManager, which presents them through its sidebar buttons.
Layout Update Strategy
Property
Type
Description
LayoutUpdateStrategy
ILayoutUpdateStrategy
Custom strategy for handling layout updates during drag operations.
Key Methods
Method
Returns
Description
GetFloatingWindows()
IEnumerable<LayoutFloatingWindowControl>
Get all active floating windows.
DockAllFloatingWindows()
void
Dock the content of every floating window back into the layout and close the windows.
DetachAnchorableToWindow(anchorable)
void
Move the content of an anchorable into a standalone top level window. See Floating Windows.
ReattachAnchorable(anchorable)
void
Close that window and return the content to the layout.
ReattachAllDetachedAnchorables()
void
Return every detached anchorable to the layout.
IsDetached(anchorable)
bool
Whether the anchorable is currently hosted by a standalone window.
DetachedAnchorables
IEnumerable<LayoutAnchorable>
The anchorables currently hosted by standalone windows.
Events
Document Events
Event
Args
Description
DocumentClosing
DocumentClosingEventArgs
Before a document closes. Cancellable.
DocumentClosed
DocumentClosedEventArgs
After a document is closed.
Anchorable Events
Event
Args
Description
AnchorableClosing
AnchorableClosingEventArgs
Before an anchorable closes. Cancellable.
AnchorableClosed
AnchorableClosedEventArgs
After an anchorable is closed.
AnchorableHiding
AnchorableHidingEventArgs
Before an anchorable hides. Cancellable.
AnchorableHidden
AnchorableHiddenEventArgs
After an anchorable is hidden.
Docking Events
Event
Args
Description
ContentFloating
ContentFloatingEventArgs
Before docked content starts floating. Cancellable.
ContentFloated
ContentFloatedEventArgs
After content has been floated.
ContentDocking
ContentDockingEventArgs
Before floating content is docked back. Cancellable.
// Create and configure a DockingManagervardockManager=newDockingManager();// Set themedockManager.Theme=newArcDarkTheme();// Handle document closingdockManager.DocumentClosing+=(sender,args)=>{if(args.Document.ContentisIModifiedmodified&&modified.HasChanges){varresult=MessageBox.Show("Save changes?","Confirm",MessageBoxButton.YesNoCancel);if(result==MessageBoxResult.Cancel)args.Cancel=true;}};// Set the layoutdockManager.Layout=newLayoutRoot{RootPanel=newLayoutPanel(newLayoutDocumentPane())};