Our own development branch of the well known WPF document docking library
Our own development branch of the well known WPF document docking library
Support this project with a :star: — report an issue, or even better, place a pull request :mailbox: :blush:
AvalonDock is a WPF Document and Tool Window layout container that is used to arrange documents and tool windows in similar ways to many well known IDEs, such as Visual Studio, Eclipse, JetBrains Rider, and more. Version 5.0 introduces first-class MVVM support, dependency injection integration, and a modular package architecture.
AvalonDock is used by many open source and commercial projects, including:
Be sure to check out the Wiki and the documentation site for tutorials and API reference.
| Package | Downloads | Description |
|---|---|---|
| Dirkster.AvalonDock | Main WPF docking framework package | |
| Dirkster.AvalonDock.Core | UI-agnostic interfaces and models | |
| Dirkster.AvalonDock.Mvvm | MVVM base classes (DockableBase, ToolboxBase, DockLayoutService) — no external dependencies |
|
| Dirkster.AvalonDock.Mvvm.CommunityToolkit | CommunityToolkit.Mvvm integration (ObservableDockableBase, ObservableToolboxBase) with [ObservableProperty] support |
|
| Dirkster.AvalonDock.DependencyInjection | IServiceCollection extensions for DI registration |
| Package | Downloads | Description |
|---|---|---|
| Dirkster.AvalonDock.Serializer.Xml | XML layout serialization | |
| Dirkster.AvalonDock.Serializer.Json | JSON layout serialization (new in v5) |
| Package | Downloads | Description |
|---|---|---|
| Dirkster.AvalonDock.Themes.Arc | Arc theme NEW! | |
| Dirkster.AvalonDock.Themes.Aero | Aero theme | |
| Dirkster.AvalonDock.Themes.Expression | Expression theme | |
| Dirkster.AvalonDock.Themes.Metro | Metro theme | |
| Dirkster.AvalonDock.Themes.VS | Visual Studio Themes (2015, 2022) incl. .vstheme support | |
| Dirkster.AvalonDock.Themes.VS2010 | Visual Studio 2010 theme (Legacy) | |
| Dirkster.AvalonDock.Themes.VS2013 | Visual Studio 2013 theme (Legacy) |
Install the packages you need:
dotnet add package Dirkster.AvalonDock
dotnet add package Dirkster.AvalonDock.Mvvm
dotnet add package Dirkster.AvalonDock.Mvvm.CommunityToolkit # optional, for [ObservableProperty] support
dotnet add package Dirkster.AvalonDock.DependencyInjection
dotnet add package Dirkster.AvalonDock.Themes.ArcThe DockingManager control is the main entry point for using AvalonDock in your WPF application. It provides the core docking functionality, including layout management, drag-and-drop support, and theme integration.
AvalonDock also includes a ToggleDockingManager which adds a built-in sidebar for toggling tool windows, similar to VS Code's or Jetbrains IDE's behavior.
The standard DockingManager provides a blank canvas for custom layouts and is ideal for applications that require full control over the docking behavior and UI.
The ToggleDockingManager includes a built-in sidebar that automatically populates with registered tool windows (anchorable view models). This is perfect for applications that want a modern, out-of-the-box docking experience without manual layout management.
The AvalonDock.DependencyInjection package provides IServiceCollection extension methods to wire up the entire docking system through your DI container. This replaces manual DocumentsSource/AnchorablesSource binding with a clean, service-oriented composition root.
| Method | Purpose |
|---|---|
AddDockLayoutService(configure) |
Register IDockLayoutService with a builder to configure toolboxes and toggle dock options in a single call |
AddDockLayoutService() |
Register IDockLayoutService without builder configuration |
AddAvalonDock<TFactory>() |
Register a custom IFactory implementation |
AddAvalonDockSerializer<T>() |
Register an ILayoutSerializer (XML or JSON) |
AddAvalonDockThemeManager<T>() |
Register a theme manager |
AddDockingManager(factory) |
Register an IDockingManager wrapper |
AddAutoHideManager<T>() |
Register an auto-hide manager |
AddFloatingWindowService<T>() |
Register a floating window service |
AddDragDropHandler<T>() |
Register a custom drag-and-drop handler |
| Method | Purpose |
|---|---|
ConfigureToggleDock(configure) |
Configure sidebar button size, default dock dimensions, and layout priority |
AddToolbox<T>() |
Register a toolbox (anchorable) view model as a singleton |
AddToolbox<T>(factory) |
Register a toolbox with a custom factory for constructor parameters |
…The LayoutPriority setting controls how panels are arranged when multiple panels are docked:
| Priority | Behavior | Similar To |
|---|---|---|
BottomFullWidth |
Bottom panel spans the full window width | JetBrains Rider |
SidesFullHeight |
Side panels span the full window height | VS Code |
Default |
No automatic restructuring | Classic AvalonDock |
For a complete walkthrough, see the Dependency Injection tutorial.
The AvalonDock.Mvvm package provides ready-to-use view model base classes with zero external dependencies. These classes implement the core interfaces from AvalonDock.Core and handle property change notifications, serialization attributes, and docking behavior out of the box.
For projects using CommunityToolkit.Mvvm source generators ([ObservableProperty], [RelayCommand]), install the optional AvalonDock.Mvvm.CommunityToolkit package which provides ObservableObject-based equivalents.
AvalonDock.Mvvm (no external dependencies):
| Class | Purpose |
|---|---|
DockableBase |
Base for all dockable view models — provides Id, Title, CanClose, CanFloat, CanPin, IsModified, DockState, and more |
ToolboxBase |
Base for toolbox (anchorable) view models — adds Zone, IsOpenByDefault, ToolTipText, and Icon |
DockBase |
Container for multiple dockables — manages VisibleDockables, ActiveDockable, and navigation |
RootDock |
Root of the layout tree — manages floating and pinned dockables |
DocumentDock |
Container for document tabs |
ToolDock |
Container for tool windows with Alignment and AutoHide support |
AvalonDock.Mvvm.CommunityToolkit (requires CommunityToolkit.Mvvm):
| Class | Purpose |
|---|---|
ObservableDockableBase |
ObservableObject-based equivalent of DockableBase — supports [ObservableProperty] and [RelayCommand] |
ObservableToolboxBase |
ObservableObject-based equivalent of ToolboxBase |
ObservableDockBase |
ObservableObject-based equivalent of DockBase |
ObservableDocument / ObservableTool |
Leaf dockable classes for documents and tools |
Using AvalonDock.Mvvm (no external dependencies):
using AvalonDock.Core;
using AvalonDock.Mvvm;
public class ExplorerToolbox : ToolboxBase
{
public ExplorerToolbox()
{
Id = "Explorer";
Title = "Explorer";
Zone = DockZone.LeftTop; // Sidebar placement zone
IsOpenByDefault = true; // Open when app starts
ToolTipText = "Solution Explorer";
}
}Using AvalonDock.Mvvm.CommunityToolkit (with [ObservableProperty] support):
using AvalonDock.Core;
using AvalonDock.Mvvm.CommunityToolkit;
using CommunityToolkit.Mvvm.ComponentModel;
public partial class ExplorerToolbox : ObservableToolboxBase
{
[ObservableProperty] private string _searchFilter = string.Empty;
public ExplorerToolbox()
{
Id = "Explorer";
Title = "Explorer";
Zone = DockZone.LeftTop;
IsOpenByDefault = true;
ToolTipText = "Solution Explorer";
}
}Toolboxes declare their sidebar placement using DockZone:
| Zone | Position |
|---|---|
LeftTop / LeftBottom |
Left sidebar |
RightTop / RightBottom |
Right sidebar |
BottomLeft / BottomRight |
Bottom panel |
IDockLayoutService is the central service for managing documents and toolboxes at runtime:
…For the ToggleDockingManager, bind the DockLayout property to your view model:
<avalonDock:ToggleDockingManager x:Name="dockManager"
DockLayout="{Binding DockLayout}"
LayoutItemContainerStyleSelector="{StaticResource PanesStyleSelector}" />For the classic DockingManager, bind the DockLayout to the Layout property:
<avalonDock:DockingManager x:Name="dockManager"
Layout="{Binding DockLayout}"
LayoutItemContainerStyleSelector="{StaticResource PanesStyleSelector}" />AvalonDock v5 is organized into modular packages with clear separation of concerns:
…Modern theme with compact tabs, rounded corners, and sem
No open issues yet, or sync has not completed.