Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
A

AvalonDock

> 开发工具
Open source

Our own development branch of the well known WPF document docking library

1.7K stars0 likes0 views
WebsiteGitHub

About

Our own development branch of the well known WPF document docking library

AvalonDock

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:

  • Stride — Free and open-source cross-platform C# game engine
  • Optick — C++ Profiler for Games
  • RoslynPad — A cross-platform C# editor based on Roslyn and AvalonEdit
  • WpfDesigner — The WPF Designer from SharpDevelop
  • DaxStudio — DAX query tool for Power BI and Analysis Services
  • Macad3D — Free and open-source 3D Construction Tool
  • Edi — Open source text editor IDE based on AvalonDock and AvalonEdit
  • Profile Explorer — Microsoft CPU profiling trace viewer

Be sure to check out the Wiki and the documentation site for tutorials and API reference.


NuGet Packages

Core

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

Serializers

Package Downloads Description
Dirkster.AvalonDock.Serializer.Xml XML layout serialization
Dirkster.AvalonDock.Serializer.Json JSON layout serialization (new in v5)

Themes

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)

Quick Start

Install the packages you need:

bash
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.Arc

Docking Manager

The 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.

DockingManager

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.

ToggleDockingManager

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.

Dependency Injection

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.

Extension Methods

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

DockLayoutBuilder Methods

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

Composition Root Example

…

Layout Priority Options

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.


MVVM

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.

Base Classes

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

Creating a Toolbox View Model

Using AvalonDock.Mvvm (no external dependencies):

csharp
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):

csharp
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";
    }
}

Dock Zones

Toolboxes declare their sidebar placement using DockZone:

Zone Position
LeftTop / LeftBottom Left sidebar
RightTop / RightBottom Right sidebar
BottomLeft / BottomRight Bottom panel

IDockLayoutService

IDockLayoutService is the central service for managing documents and toolboxes at runtime:

…

XAML Binding

For the ToggleDockingManager, bind the DockLayout property to your view model:

xml
<avalonDock:ToggleDockingManager x:Name="dockManager"
    DockLayout="{Binding DockLayout}"
    LayoutItemContainerStyleSelector="{StaticResource PanesStyleSelector}" />

For the classic DockingManager, bind the DockLayout to the Layout property:

xml
<avalonDock:DockingManager x:Name="dockManager"
    Layout="{Binding DockLayout}"
    LayoutItemContainerStyleSelector="{StaticResource PanesStyleSelector}" />

Architecture (v5.0)

AvalonDock v5 is organized into modular packages with clear separation of concerns:

…

Theming

Arc Theme (NEW!)

Modern theme with compact tabs, rounded corners, and sem

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C#avalondockcontrolcsharpdark-theme

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具