Deskband11Lib.Core 1.5.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package Deskband11Lib.Core --version 1.5.0
                    
NuGet\Install-Package Deskband11Lib.Core -Version 1.5.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="Deskband11Lib.Core" Version="1.5.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Deskband11Lib.Core" Version="1.5.0" />
                    
Directory.Packages.props
<PackageReference Include="Deskband11Lib.Core" />
                    
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 Deskband11Lib.Core --version 1.5.0
                    
#r "nuget: Deskband11Lib.Core, 1.5.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 Deskband11Lib.Core@1.5.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=Deskband11Lib.Core&version=1.5.0
                    
Install as a Cake Addin
#tool nuget:?package=Deskband11Lib.Core&version=1.5.0
                    
Install as a Cake Tool

Deskband11Lib

NuGet WinUI NuGet WPF Pack and Publish License: MIT

🌐 English | 한국어

Deskband11Lib is a library for building always-visible taskbar companions on Windows 11. It lets your app place real UI content directly inside the taskbar, so compact dashboards, quick controls, status indicators, media widgets, launchers, and productivity tools appear as part of the taskbar.

Deskband11Lib screenshot

Packages

Deskband11Lib comes in multiple NuGet packages, one for each supported UI framework. A shared Deskband11Lib.Core package holds the taskbar hosting engine. Future frameworks such as Avalonia can be added as additional facade packages.

Package Description
Deskband11Lib.Core Taskbar window discovery, layout calculation, UI Automation measurement, Explorer restart monitoring, and Win32 HWND hosting engine. Independent of any UI framework.
Deskband11Lib.WinUI WinUI 3 facade. Build taskbar widgets with the same WinUI controls, styling, and composition features used by your app.
Deskband11Lib.Wpf WPF facade. Bring WPF-based content into the Windows 11 taskbar with the same simple API.

Highlights

  • Build taskbar-resident widgets using your framework's native controls and styling.
  • Show live information where users can see it at a glance without opening a full window.
  • Add compact controls for actions such as timers, media playback, account switching, build status, device monitoring, or quick launch workflows.
  • Automatically fit content into the available taskbar space without overlapping pinned apps or the notification area.
  • Work on every taskbar position, including the top, left, and right positions available from Windows 11 26H2. Content follows the taskbar when it moves.
  • Run multiple instances side by side in the same taskbar area with automatic slot coordination. Each instance gets its fair share of the available space.
  • Built-in easing functions (Linear, Sine, Quadratic, Cubic, Quartic, Quintic, Exponential, Circle) for smooth layout animations.
  • Optional high refresh rate mode that matches the layout animation timer to the target monitor's current refresh rate for smoother motion on high refresh rate displays.
  • Recover cleanly when Explorer restarts by letting the application rebuild its hosted window.
  • WinUI facade supports Windows App SDK apps and NativeAOT publishing.

Install

Choose the package that matches your UI framework:

# WinUI 3
dotnet add package Deskband11Lib.WinUI

# WPF
dotnet add package Deskband11Lib.Wpf

The Deskband11Lib.Core package is pulled in automatically as a transitive dependency.

Basic Usage

WinUI 3

Create a WinUI window, create a TaskbarContentHost, attach it after the initial taskbar layout is ready, then activate the window.

using Deskband11Lib.Core;
using Deskband11Lib.WinUI;

var window = new MainWindow();
var host = new TaskbarContentHost(window, rootElement, new TaskbarContentHostOptions
{
    PreferredWidth = 360,
    PreferredHeight = 48
});

await host.AttachWhenLayoutReadyAsync();
window.Activate();

WPF

The WPF API is identical. The only difference is the UI framework namespace used for Window and FrameworkElement.

using Deskband11Lib.Core;
using Deskband11Lib.Wpf;

var window = new MainWindow();
var host = new TaskbarContentHost(window, rootElement, new TaskbarContentHostOptions
{
    PreferredWidth = 360,
    PreferredHeight = 48
});

await host.AttachWhenLayoutReadyAsync();
window.Show();

Window Recreation

The hosted window can be torn down for a few different reasons: Explorer restarts, the monitor you pinned the widget to gets disconnected, or the system DPI changes. Whatever the cause, the fix is the same: recreate the window and let the new host attach. TaskbarWindowRecreationRequired covers all of them, so one handler is enough for most apps:

host.TaskbarWindowRecreationRequired += async (_, _) =>
{
    await RecreateMainWindowAsync();
};

If you need to tell the cases apart, the individual events below are raised alongside it as well.

Explorer Restart

When Explorer restarts, the taskbar destroys the hosted child window. TaskbarWindowRecreated fires and the window needs to be recreated:

host.TaskbarWindowRecreated += async (_, _) =>
{
    await RecreateMainWindowAsync();
};

DPI Change

When the system DPI changes, the taskbar moves to the new DPI but the hosted window can keep its old one, leaving the widget misaligned. Deskband11Lib polls the taskbar and hosted window DPI values. On mismatch, it hides and detaches the hosted window and raises TaskbarDpiChanged, so the application can rebuild it with the new DPI:

host.TaskbarDpiChanged += async (_, _) =>
{
    await RecreateMainWindowAsync();
};

Secondary Monitor Disconnection

If the monitor you pinned the widget to is disconnected, the taskbar destroys the hosted child window and the library raises TaskbarWindowDisappeared. Recreate the window in that handler, the same way you would for TaskbarWindowRecreated. The new host attaches to the primary taskbar until the preferred monitor is back:

host.TaskbarWindowDisappeared += async (_, _) =>
{
    await RecreateMainWindowAsync();
};

On reconnect, TaskbarWindowRecreated fires again and the recreated window attaches to the secondary taskbar.

Multi-Instance Slot Coordination

Deskband11Lib supports running multiple instances in the same taskbar area simultaneously. When several instances target the same placement area on the same monitor, they automatically coordinate via a shared memory slot registry and divide the available space without overlapping each other.

Slot Allocation

Each registered instance is called a slot. Slots are ordered by (ManualSlotPriority, SlotIndex): lower ManualSlotPriority values place the instance earlier (further from the notification area in left-aligned mode). Among slots with the same ManualSlotPriority, arrival order (SlotIndex) breaks the tie.

Width allocation follows a Fixed-then-Stretch model. Width here is the length along the taskbar, which is the height on a left or right taskbar (see Taskbar Position).

  • Fixed slots: instances with a finite PreferredWidth get their requested width, in priority order, until available space runs out. Lower-priority Fixed slots that do not fit receive whatever remains (which may be zero).
  • Stretch slots: instances with PreferredWidth = double.MaxValue split the remaining space equally after all Fixed slots are served.

When AllowFixedSlotResize is true (the default) and the available space is too small to serve every resizable Fixed slot at its requested width, those slots shrink proportionally to their PreferredWidth instead of being starved to zero. Non-resizable Fixed slots (AllowFixedSlotResize = false) keep priority-ordered first-served behavior and are served before resizable Fixed slots. Stretch slots always split whatever remains after all Fixed slots are served.

Empty slots leave gaps. The remaining instances do not reflow to fill them.

Manual Slot Priority

By default, all instances have ManualSlotPriority = 65535, which means they are ordered purely by arrival time. Set a lower value to pin an instance ahead of auto-ordered instances:

var host = new TaskbarContentHost(window, rootElement, new TaskbarContentHostOptions
{
    PreferredWidth = 200,
    ManualSlotPriority = 100
});

Stretch Mode

Set PreferredWidth to double.MaxValue to make an instance stretch to fill whatever space remains after Fixed slots are allocated:

var host = new TaskbarContentHost(window, rootElement, new TaskbarContentHostOptions
{
    PreferredWidth = double.MaxValue
});

When all instances in an area are Stretch, they share the space equally.

Taskbar Position

Starting with Windows 11 26H2, the taskbar can sit on any edge of the screen. Deskband11Lib supports all four positions. A top taskbar works the same way as a bottom one. A left or right taskbar is vertical, so content is laid out from top to bottom.

Sizes Follow the Taskbar

PreferredWidth and PreferredHeight keep their names on every taskbar, but they describe directions relative to the taskbar, not to the screen:

Option Direction Bottom or top taskbar Left or right taskbar
PreferredWidth Along the taskbar Width Height
PreferredHeight Across the taskbar, capped by its thickness Height Width

Everything built on PreferredWidth follows the same rule. Stretch mode (double.MaxValue), AllowFixedSlotResize, ManualSlotPriority, and multi-instance slot allocation all work along the taskbar, so they need no changes for a vertical taskbar.

Your content element, on the other hand, receives its real on-screen size. On a left or right taskbar, the library sets FrameworkElement.Width to the thickness the content was given and FrameworkElement.Height to the allocated length. With the default options (PreferredWidth = 360, PreferredHeight = 48), content on a 48 epx wide vertical taskbar is 48 epx wide and up to 360 epx tall.

A vertical taskbar becomes much wider when taskbar buttons are never combined and show labels. Content still keeps PreferredHeight across the taskbar. To fill the full thickness on every taskbar, set PreferredHeight = double.MaxValue; on a bottom or top taskbar, the height is still capped by the taskbar.

Free space is usually shorter on a vertical taskbar, because the notification area stacks its icons vertically and takes up a large part of the taskbar. Design the vertical layout for a compact length.

Placement and Alignment

Placement and TaskbarAlignment values keep their names as well, and are read along the taskbar:

Value Bottom or top taskbar Left or right taskbar
TaskbarAlignment.Left Icons aligned to the left Icons aligned to the top
LeftEdge Far left, after the Widgets button Top, below the Widgets button
BeforeStartButton Left of the Start button Above the Start button
BeforeNotificationArea Left of the notification area Above the notification area

Reacting to Position Changes

Moving the taskbar does not recreate the taskbar window, so the hosted window stays attached and the layout follows the taskbar on the next refresh. Use these members to switch your content between a horizontal and a vertical layout:

  • TaskbarEdge: the edge the taskbar sits on (Left, Top, Right, or Bottom). It is Unknown until the first layout.
  • IsTaskbarVertical: true when the taskbar is on the left or right edge.
  • TaskbarEdgeChanged: raised on the UI thread right before the bounds for a new position are applied, including the first layout after attaching.
host.TaskbarEdgeChanged += (_, _) =>
{
    // Switch the content between its horizontal and vertical layouts.
    content.ApplyTaskbarOrientation(host.IsTaskbarVertical);
};

ApplyTaskbarOrientation stands for a method in your own content. The sample projects implement it by keeping one horizontal and one vertical layout and toggling their visibility.

Layout animation is skipped when the taskbar switches between horizontal and vertical.

How It Works

Deskband11Lib gives your app a taskbar-sized surface and keeps that surface aligned with the real taskbar layout. Internally, it uses regular Win32 window parenting:

  • Finds the primary taskbar window, Shell_TrayWnd, or a secondary monitor's taskbar window, Shell_SecondaryTrayWnd, based on PreferredMonitorIdentity.
  • Creates or receives a normal framework Window from the application.
  • Changes the window style from popup-style top-level window to child window.
  • Calls SetParent to place the window under the taskbar.
  • Detects which screen edge the taskbar sits on by comparing the taskbar window with its monitor.
  • Calculates the available space along the taskbar between the taskbar buttons and the notification area, taking taskbar alignment (left or top, or center) into account.
  • Moves and clips the hosted window to that rectangle with SetWindowPos and SetWindowRgn.

On current Windows 11 builds, the taskbar child HWND hierarchy alone does not expose reliable button widths, and the taskbar content may be left-aligned or centered. Deskband11Lib solves this with UI Automation:

  • Button detection. UI Automation precisely targets the Start button (AutomationId = StartButton), the optional Widgets button, and the contiguous taskbar app button group.
  • Alignment detection. The library reads the TaskbarAl registry value and falls back to inferring alignment from the Start button position.
  • Gap selection. When centered, it picks the more spacious of the two free gaps around the Start button group, so content never overlaps the Start button, app buttons, Widgets button, or the notification area.
  • Secondary monitors. Where the notification area has no dedicated HWND, UI Automation also locates the clock and notification cluster (AutomationId = SystemTrayIcon / NotifyItemIcon) to find where the free space ends.

Options

All options live in Deskband11Lib.Core.TaskbarContentHostOptions and are shared across all facades.

Option Default Description
PreferredWidth 360 Desired content length along the taskbar in effective pixels: the width on a bottom or top taskbar, the height on a left or right taskbar. Set to double.MaxValue for stretch mode: the instance fills remaining space after Fixed-width instances are served. See Taskbar Position.
AllowFixedSlotResize true When true and the available space is too small to serve every resizable Fixed slot at its requested PreferredWidth, those slots shrink proportionally to their PreferredWidth instead of being starved to zero. Set to false to keep priority-ordered first-served behavior.
PreferredHeight 48 Desired content size across the taskbar in effective pixels: the height on a bottom or top taskbar, the width on a left or right taskbar. Capped by the taskbar thickness; set to double.MaxValue to fill it.
AnimateLayoutChanges true Animates taskbar host position and size changes.
HighRefreshRateMode false When enabled along with AnimateLayoutChanges, matches the layout animation timer interval to the target monitor's current refresh rate instead of the default 60 FPS.
LayoutAnimationDuration 500 Layout animation duration in milliseconds.
LayoutAnimationEasing EasingFunctions.CircleOut Easing delegate (Func<double, double>) for layout animation. Built-in non-overshooting functions are provided by Deskband11Lib.Core.EasingFunctions.
Placement Auto Selects placement.<br>• Auto: When centered, picks the more spacious free gap around the Start button group. Left gap wins → far-left edge (same as LeftEdge); right gap wins → before the notification area. Falls back to BeforeNotificationArea when left-aligned.<br>• LeftEdge: When centered, places content at the far left edge, right after the Widgets button. Falls back to BeforeNotificationArea when left-aligned.<br>• BeforeNotificationArea: Always places content next to the notification area.<br>• BeforeStartButton: Places content next to the Start button. Falls back to BeforeNotificationArea when not centered.<br>On a left or right taskbar, the same values are read from top to bottom: LeftEdge is the top end, and "before" means above.
TrackTaskbarButtons true Enables UI Automation based taskbar button measurement.
TrackNotificationArea true Keeps content away from the notification area.
PreferredMonitorIdentity 0 Selects which taskbar to host on. 0 uses the primary taskbar (Shell_TrayWnd). 1 uses the first secondary monitor's taskbar (Shell_SecondaryTrayWnd), 2 the next, and so on, ordered left-to-right by screen position. Falls back to the primary taskbar when the requested secondary monitor's taskbar is not present.
ManualSlotPriority 65535 Controls ordering when multiple instances share the same taskbar area. Lower values place the instance earlier (further from the notification area when left-aligned). Instances with the same value are ordered by arrival time. Default 65535 means auto-ordering by arrival.
LayoutRefreshInterval 500 ms Refresh interval for ongoing taskbar layout updates.

Taskbar Alignment

Deskband11Lib detects whether the Windows 11 taskbar is left-aligned or centered by reading the TaskbarAl registry value, falling back to inferring the alignment from the Start button position. Call GetTaskbarAlignment() on a TaskbarContentHost to get a TaskbarAlignment (Left, Center, or Unknown). The detected alignment drives Placement = Auto. On a left or right taskbar, Left means the icons are aligned to the top.

Built-in Easing Functions

Deskband11Lib.Core.EasingFunctions provides these easing functions for LayoutAnimationEasing:

  • EasingFunctions.Linear
  • EasingFunctions.SineIn / SineOut / SineInOut
  • EasingFunctions.QuadraticIn / QuadraticOut / QuadraticInOut
  • EasingFunctions.CubicIn / CubicOut / CubicInOut
  • EasingFunctions.QuarticIn / QuarticOut / QuarticInOut
  • EasingFunctions.QuinticIn / QuinticOut / QuinticInOut
  • EasingFunctions.ExponentialIn / ExponentialOut / ExponentialInOut
  • EasingFunctions.CircleIn / CircleOut / CircleInOut

You can also pass any Func<double, double> delegate for custom easing.

Sample Projects

The snippets above show the core API shape, but a real taskbar companion should follow the sample projects for window lifetime, startup ordering, Explorer restart recovery, and framework-specific hosting details. Start from the sample that matches your UI stack:

  • Deskband11Lib.WinUI.Sample for WinUI 3 and Windows App SDK apps.
  • Deskband11Lib.Wpf.Sample for WPF apps, including the transparent borderless host window setup.

Requirements

  • Windows 11.
  • The target framework must be compatible with your chosen UI framework.
  • WinUI 3 requires Windows App SDK.
  • WPF requires UseWPF=true in the project file.

Project Development

dotnet restore
dotnet build Deskband11Lib.slnx -c Debug
dotnet publish Deskband11Lib.WinUI.Sample\Deskband11Lib.WinUI.Sample.csproj -c Release -r win-x64

Acknowledgements

Special thanks to zadjii and Deskband11. The core idea of bringing application content into the Windows 11 taskbar comes from that project, which inspired Deskband11Lib.

Deskband11Lib is supported by the FOSS for All Microgrants 2026 program. Thanks to FOSS for All and every donor who helps sustain the free and open source ecosystem.

License

Deskband11Lib is licensed under the MIT License.

Author

Created by Howon Lee (airtaxi).

Product Compatible and additional computed target framework versions.
.NET net10.0-windows10.0.26100 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Deskband11Lib.Core:

Package Downloads
Deskband11Lib.Wpf

WPF facade for hosting rich application content inside the Windows 11 taskbar.

Deskband11Lib.WinUI

WinUI 3 facade for hosting rich application content inside the Windows 11 taskbar.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.5.1 90 11/11/2026
1.5.0 104 11/9/2026
1.4.5 116 11/7/2026
1.4.4 121 11/2/2026
1.4.3 125 10/29/2026
1.4.2 568 8/13/2026
1.4.1 133 8/13/2026
1.4.0 138 8/13/2026
1.3.9 224 7/29/2026
1.3.8 161 7/16/2026
1.3.7 127 7/16/2026
1.3.6 144 7/15/2026
1.3.5 142 7/13/2026
1.3.4 168 7/7/2026
1.3.3 137 7/6/2026
1.3.2 139 7/6/2026
1.3.1 147 6/26/2026
1.3.0 161 6/26/2026
1.2.0 153 6/22/2026
1.1.3 143 6/21/2026
Loading failed