WinUI.Dock 1.3.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package WinUI.Dock --version 1.3.0
                    
NuGet\Install-Package WinUI.Dock -Version 1.3.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WinUI.Dock" Version="1.3.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WinUI.Dock" Version="1.3.0" />
                    
Directory.Packages.props
<PackageReference Include="WinUI.Dock" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add WinUI.Dock --version 1.3.0
                    
#r "nuget: WinUI.Dock, 1.3.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package WinUI.Dock@1.3.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=WinUI.Dock&version=1.3.0
                    
Install as a Cake Addin
#tool nuget:?package=WinUI.Dock&version=1.3.0
                    
Install as a Cake Tool

WinUI.Dock

NuGet Version

WinUI.Dock is a docking control similar to Visual Studio, based on WinUI 3. Its design is inspired by AvalonDock and ImGui.

Supported Platforms

  • WinUI 3.0
  • Uno Platform (partially available)

Quick Start

  1. Install the NuGet package
Install-Package WinUI.Dock
  1. Add the WinUIDockResources in App.xaml
<Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <XamlControlsResources xmlns="using:Microsoft.UI.Xaml.Controls" />
            <dock:WinUIDockResources xmlns:dock="using:WinUI.Dock" />
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>
  1. Add the DockManager control in MainWindow.xaml
<Window xmlns:dock="using:WinUI.Dock"
        x:Name="Main">
    <dock:DockManager CreateNewDocument="OnCreateNewDocument"
                      CreateNewGroup="OnCreateNewGroup"
                      CreateNewWindow="OnCreateNewWindow"
                      ParentWindow="{Binding ElementName=Main}">
        <dock:LayoutPanel Orientation="Vertical">
            <dock:LayoutPanel DockHeight="2" Orientation="Horizontal">
                <dock:DocumentGroup DockWidth="2">
                    <dock:Document Title="Document" CanClose="False" CanPin="False" />
                </dock:DocumentGroup>

                <dock:DocumentGroup DockWidth="1">
                    <dock:Document Title="Solution Explorer" />
                </dock:DocumentGroup>
            </dock:LayoutPanel>

            <dock:LayoutPanel DockHeight="1" Orientation="Horizontal">
                <dock:DocumentGroup IsTabWidthBasedOnContent="True" TabPosition="Bottom">
                    <dock:Document Title="Side##Error List" />
                </dock:DocumentGroup>
                <dock:DocumentGroup IsTabWidthBasedOnContent="True" TabPosition="Bottom">
                    <dock:Document Title="Side##Output" />
                </dock:DocumentGroup>
            </dock:LayoutPanel>
        </dock:LayoutPanel>
    </dock:DockManager>
</Window>
  1. Add the following code in MainWindow.xaml.cs
// This event is triggered when restoring the layout, you can add content to the Document in this event.
private void OnCreateNewDocument(object _, CreateNewDocumentEventArgs e)
{
    e.Document.Content = new TextBlock()
    {
        HorizontalAlignment = HorizontalAlignment.Center,
        VerticalAlignment = VerticalAlignment.Center,
        Text = $"New Document {e.Title}"
    };
}

// A special character "##" is added in the Title, and only the content after "##" will be displayed in the final interface.
// When dragging a Document to a specified target, a new DocumentGroup will be created, and this event will be triggered, allowing you to customize the properties of the DocumentGroup.
private void OnCreateNewGroup(object _, CreateNewGroupEventArgs e)
{
    if (e.Title.Contains("Side"))
    {
        e.Group.TabPosition = TabPosition.Bottom;
        e.Group.IsTabWidthBasedOnContent = true;
    }
}

// When dragging a Document out, a new window will be created, and this event will be triggered, allowing you to customize the title bar of the window.
private void OnCreateNewWindow(object _, CreateNewWindowEventArgs e)
{
    e.TitleBar.Child = new TextBlock()
    {
        HorizontalAlignment = HorizontalAlignment.Center,
        VerticalAlignment = VerticalAlignment.Center,
        Text = "Custom Title"
    };
}
  1. Run the program to see the effect.

Notes

  • The project is currently in an early stage and may have many issues. Please do not use it in production environments.
  • The Uno Platform has only been tested on the Skia platform and does not support cross-window dragging. It works properly if used within a single window.

Preview

WinUI Uno
image image
image image
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net9.0-windows10.0.19041 is compatible.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 154 8/21/2025
1.3.2 476 7/24/2025
1.3.1 522 7/23/2025
1.3.0 513 7/22/2025
1.2.0 195 5/9/2025
1.1.0 193 4/9/2025
1.0.5 198 3/17/2025
1.0.4 169 3/11/2025
1.0.3 221 3/7/2025
1.0.2 221 3/5/2025
1.0.1 373 3/5/2025 1.0.1 is deprecated because it has critical bugs.
1.0.0 361 3/5/2025 1.0.0 is deprecated because it has critical bugs.