WinUI.Dock 2.0.0

dotnet add package WinUI.Dock --version 2.0.0
                    
NuGet\Install-Package WinUI.Dock -Version 2.0.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="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="WinUI.Dock" Version="2.0.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 2.0.0
                    
#r "nuget: WinUI.Dock, 2.0.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@2.0.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=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=WinUI.Dock&version=2.0.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)

Preview

WinUI Uno
image image
image image

Quick Start

  1. Install the NuGet package
Install-Package WinUI.Dock
  1. Add the DockManager control in MainView.xaml
xmlns:dock="using:WinUI.Dock"

<dock:DockManager x:Name="Manager"
                  Grid.Row="1"
                  Adapter="{Binding}"
                  Behavior="{Binding}">
    <dock:LayoutPanel Orientation="Vertical">
        <dock:LayoutPanel Orientation="Horizontal">
            <dock:DocumentGroup ShowWhenEmpty="True">
                <dock:Document Title="MainView.xaml"
                               CanClose="True">
                    <Button VerticalAlignment="Top"
                            Command="{Binding OpenPropertiesCommand}"
                            CommandParameter="{Binding RelativeSource={RelativeSource Mode=Self}}"
                            Content="Open Properties" />
                </dock:Document>
                <dock:Document Title="MainViewModel.cs"
                               CanClose="True" />
            </dock:DocumentGroup>

            <dock:DocumentGroup Width="200"
                                CompactTabs="True"
                                TabPosition="Bottom">
                <dock:Document Title="Bottom##Solution Explorer"
                               CanClose="True"
                               CanPin="True" />
                <dock:Document Title="Bottom##Git Changes"
                               CanClose="True"
                               CanPin="True" />
            </dock:DocumentGroup>
        </dock:LayoutPanel>

        <dock:LayoutPanel Height="200"
                          Orientation="Horizontal">
            <dock:DocumentGroup TabPosition="Bottom">
                <dock:Document Title="Bottom##Error List"
                               CanClose="True"
                               CanPin="True" />
            </dock:DocumentGroup>

            <dock:DocumentGroup CompactTabs="True"
                                TabPosition="Bottom">
                <dock:Document Title="Bottom##Output"
                               CanClose="True"
                               CanPin="True" />
                <dock:Document Title="Bottom##Terminal"
                               CanClose="True"
                               CanPin="True" />
            </dock:DocumentGroup>
        </dock:LayoutPanel>
    </dock:LayoutPanel>
</dock:DockManager>
  1. Implement the Adapter and Behavior interfaces in MainViewModel.cs
public partial class MainViewModel : ObservableObject, IDockAdapter, IDockBehavior
{
    private readonly Document propertiesDocument = new()
    {
        Title = "Bottom##Properties",
        Content = "This is a properties document.",
        CanClose = true
    };

    [RelayCommand]
    private void OpenProperties(object content)
    {
        propertiesDocument.Width = 200;
        propertiesDocument.DockTo(DocumentHelpers.GetDocument(content)!, DockTarget.SplitRight);
    }

    void IDockAdapter.OnCreated(Document document)
    {
        document.Content = new TextBlock()
        {
            Text = document.ActualTitle,
            FontSize = 14,
            HorizontalAlignment = HorizontalAlignment.Center,
            VerticalAlignment = VerticalAlignment.Center
        };
    }

    void IDockAdapter.OnCreated(DocumentGroup group, Document? draggedDocument)
    {
        if (draggedDocument?.Title.Contains("Bottom##") is true)
        {
            group.TabPosition = TabPosition.Bottom;
        }
    }

    object? IDockAdapter.GetFloatingWindowTitleBar(Document? draggedDocument)
    {
        return new TextBlock()
        {
            IsHitTestVisible = false,
            Text = "Example Floating Window",
            HorizontalAlignment = HorizontalAlignment.Center,
            VerticalAlignment = VerticalAlignment.Center,
            FontSize = 16,
            FontWeight = FontWeights.Bold
        };
    }

    void IDockBehavior.ActivateMainWindow()
    {
        App.MainWindow.Activate();
    }

    void IDockBehavior.OnDocked(Document src, DockManager dest, DockTarget target)
    {
        Debug.WriteLine($"Document '{src.ActualTitle}' docked to DockManager at target '{target}'.");
    }

    void IDockBehavior.OnDocked(Document src, DocumentGroup dest, DockTarget target)
    {
        Debug.WriteLine($"Document '{src.ActualTitle}' docked to DocumentGroup at target '{target}'.");
    }

    void IDockBehavior.OnFloating(Document document)
    {
        Debug.WriteLine($"Document '{document.ActualTitle}' is now floating.");
    }
}
  1. Run the program to see the effect.

Known Issues

  • Limited MVVM support - I don't have a good solution for data source binding (document and layout creation).
  • Uno Platform's support for custom windows and cross-window drag-and-drop remains limited.
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 113 8/21/2025
1.3.2 456 7/24/2025
1.3.1 495 7/23/2025
1.3.0 489 7/22/2025
1.2.0 184 5/9/2025
1.1.0 189 4/9/2025
1.0.5 193 3/17/2025
1.0.4 168 3/11/2025
1.0.3 220 3/7/2025
1.0.2 219 3/5/2025
1.0.1 362 3/5/2025 1.0.1 is deprecated because it has critical bugs.
1.0.0 360 3/5/2025 1.0.0 is deprecated because it has critical bugs.