A Kanban Board control for WPF
See sample
Set IsDarkMode on a board, or bind it to a view-model property:
<kanban:KanbanBoard IsDarkMode="{Binding UseDarkMode}" />The default is false. Changing it at runtime updates the built-in templates
without recreating cards. Each board has its own mode; no application-wide or
Windows theme setting is changed. Both sample windows include a live toggle.
Boards default to the system text brush so a nested light board does not inherit
light text from a dark parent. Set Foreground on the board to customize it.
Standard colors and custom brushes used by the built-in templates are adapted automatically: dark surfaces, light text, and recognizable accent/warning colors. Solid colors and linear/radial gradients retain alpha, opacity, and geometry. Opaque solid text/background pairs in the built-in templates meet a contrast ratio of at least 4.5:1. This guarantee does not apply to transparent surfaces, gradients, images, or arbitrary custom content.
Original property values, shared brushes, and bindings are not modified.
SaveModel() includes IsDarkMode; LoadJsonModel() restores it. Older models
without the property leave the current mode unchanged. Serialized colors remain
the original colors, not their dark-mode projections.
Images, stickers, other brush types (including image/visual brushes), custom
templates, context menus, and the contents of KanbanPlainCard are not
automatically recolored. Custom templates
can opt in using the same markup extension (conv refers to
KC.WPF_Kanban.Converter in assembly WPF-Kanban):
<Border Background="{conv:DarkModeBrush {Binding Background, RelativeSource={RelativeSource TemplatedParent}}}"
TextElement.Foreground="{conv:DarkModeBrush {Binding Foreground, RelativeSource={RelativeSource TemplatedParent}}, Role=Foreground}" />Use the default Background role for surfaces, Foreground for text, and
Accent for icons, lines, and borders. Always supply the original brush, not an
already converted background. The extension follows the inherited board mode,
available as the read-only attached property KanbanBoard.IsDarkModeActive.
The plain-card sample demonstrates explicit opt-in for its custom content.
On Windows with the .NET 10 SDK:
dotnet test Tests\WPF-Kanban.Tests.csproj --configuration ReleaseIf you like my work, please support this project!
Donate via PayPal
or become a Sponsor on GitHub
