DrawnUi.Wpf
1.10.6.21
See the version list below for details.
dotnet add package DrawnUi.Wpf --version 1.10.6.21
NuGet\Install-Package DrawnUi.Wpf -Version 1.10.6.21
<PackageReference Include="DrawnUi.Wpf" Version="1.10.6.21" />
<PackageVersion Include="DrawnUi.Wpf" Version="1.10.6.21" />
<PackageReference Include="DrawnUi.Wpf" />
paket add DrawnUi.Wpf --version 1.10.6.21
#r "nuget: DrawnUi.Wpf, 1.10.6.21"
#:package DrawnUi.Wpf@1.10.6.21
#addin nuget:?package=DrawnUi.Wpf&version=1.10.6.21
#tool nuget:?package=DrawnUi.Wpf&version=1.10.6.21
DrawnUI for WPF
DrawnUi.Wpf hosts the DrawnUI rendering engine inside a WPF window. One DrawnUiElement is a
normal FrameworkElement; everything inside it is drawn with SkiaSharp, on the GPU through ANGLE
or in software, and takes part in WPF XAML, {Binding}, styles and triggers.
Windows only, .NET 9 and .NET 10 (net9.0-windows, net10.0-windows).
Install
dotnet add package DrawnUi.Wpf
For games add DrawnUi.Wpf.Game: the DrawnGame base class shared with the MAUI, OpenTK, Blazor and
WASM game addons, hosted through new DrawnUiElement(() => new RescalingCanvas { ... }).
Startup
Register fonts once, before the first element is shown (for example in App.OnStartup). Font
files, images, Lottie and .sksl shader files are read from next to the executable, so mark them
as content in the app project:
Super.UseDrawnUi()
.ConfigureFonts(fonts => fonts
.AddFont("fonts/OpenSans-Regular.ttf", "FontText")
.AddFont("fonts/OpenSans-Semibold.ttf", "FontText", FontWeight.SemiBold))
.Build();
<ItemGroup>
<Content Include="fonts\**;images\**;shaders\**">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
The same DrawnUiStartupSettings a MAUI app uses go through .WithSettings(...) before Build():
DesktopWindow sizes the window hosting the first element, UseDesktopKeyboard feeds every key
pressed in that window to KeyboardManager, Logger receives Super.Log, Startup runs once after
initialization. .ConfigureStyles(...) and .PreloadAssets(...) are on the same builder.
A drawn canvas in XAML
<Window xmlns:draw="http://schemas.appomobi.com/drawnUi/2023/draw" ...>
<draw:DrawnUiElement RenderingMode="Accelerated">
<draw:SkiaStack Spacing="16" HorizontalOptions="Fill" VerticalOptions="Center">
<draw:SkiaLabel Text="{Binding Greeting}" FontSize="16" TextColor="#9BE15D" />
<draw:SkiaButton Text="Poke" WidthRequest="220" CommandTapped="{Binding PokeCommand}" />
</draw:SkiaStack>
</draw:DrawnUiElement>
</Window>
Every DrawnUI bindable property is mirrored by a WPF dependency property, so bindings, Style
setters and triggers work on drawn controls. The window's DataContext flows into the drawn tree.
Colors, thickness and corner radius accept the WPF string forms ("#RRGGBB", "16,16,4,4").
Or build the tree in C# (see the fluent extensions) and assign it to Content; with
ContentBuilder the tree is rebuilt on every C# Hot Reload.
Element properties
| Property | Values | Notes |
|---|---|---|
RenderingMode |
Default, Accelerated, AcceleratedRetained |
Software (WriteableBitmap) or GPU through ANGLE on a shared Direct3D texture. Read when the element loads. The first frame is pre-rendered on the CPU so content shows before the GPU is up |
Gestures |
Enabled (default), Lock, Disabled |
Enabled: input a drawn control did not use bubbles on to WPF (a wheel keeps scrolling a hosting ScrollViewer). Lock: the canvas keeps every event. Disabled: no input |
Content / ContentBuilder |
drawn root | ContentBuilder re-runs after C# Hot Reload |
Rendering is idle-gated: nothing is painted while the drawn tree is clean.
What works on this head
- All drawn controls, layouts, caching, animations, Lottie, GIF, sprites, SVG, shaders, virtualized lists.
- Mouse (every button, with
PointerData), wheel, context menu, keyboard throughKeyboardManager. SkiaEditorwith clipboard (Ctrl+A/C/X/V), Home/End, Up/Down, IME text input.- Multi-touch with pinch and rotate through
MultitouchTracker(see limits). - Accessibility: every node of the accessibility snapshot is a UI Automation peer; Tab / Shift+Tab walk interactive nodes with a focus ring, Enter or Space activates, Escape leaves.
SkiaShellfor drawn navigation: pages, tabs, popups, modals, toasts,IVisibilityAwarecallbacks.- C# Hot Reload under Visual Studio, Rider and
dotnet watch.
Known limitations
- Touch and pen were implemented against the WPF touch events but not yet exercised on touch hardware; pen pressure is not read.
- XAML Hot Reload for drawn controls is untested; C# Hot Reload is.
- Editor Shift+arrow and Ctrl combinations were tested in code only.
Samples
In the repository, src/Wpf/Samples:
- HelloWpf — the full demo, one page per feature: cells, images, SVG, shapes, text, layouts, looks, snapping, animations, shell, editor, keyboard, scroll, shaders, sprites, transforms, reorder, accessibility.
- WpfSandbox — a XAML window with
{Binding}to a view model and a WPF style, referencing the head from source. - WpfPackageDemo — the same window consuming the NuGet package; copy it to start a new app.
- WpfPong — the Pong game shared with the OpenTK and WebAssembly samples, hosted in a WPF window through the
DrawnUi.Wpf.Gameaddon: aDrawnGameloop, keyboard and mouse input, aRescalingCanvasthat keeps the game's aspect ratio when the window resizes.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0-windows7.0 is compatible. net10.0-windows was computed. net10.0-windows7.0 is compatible. |
-
net10.0-windows7.0
- AppoMobi.Gestures (>= 3.11.1)
- AppoMobi.Specials (>= 10.0.2)
- Avalonia.Angle.Windows.Natives (>= 2.2.0.20230930)
- CommonMark.NET (>= 0.15.1)
- EasyCaching.InMemory (>= 1.9.2)
- Microsoft.Extensions.Http.Polly (>= 9.0.6)
- SkiaSharp.HarfBuzz (>= 4.148.0)
- SkiaSharp.Skottie (>= 4.148.0)
- Svg.Skia (>= 4.9.0)
-
net9.0-windows7.0
- AppoMobi.Gestures (>= 3.11.1)
- AppoMobi.Specials (>= 10.0.2)
- Avalonia.Angle.Windows.Natives (>= 2.2.0.20230930)
- CommonMark.NET (>= 0.15.1)
- EasyCaching.InMemory (>= 1.9.2)
- Microsoft.Extensions.Http.Polly (>= 9.0.6)
- SkiaSharp.HarfBuzz (>= 4.148.0)
- SkiaSharp.Skottie (>= 4.148.0)
- Svg.Skia (>= 4.9.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on DrawnUi.Wpf:
| Package | Downloads |
|---|---|
|
DrawnUi.Wpf.Game
Base class for implementing a game with SkiaSharp inside a WPF window |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.10.6.22-pre2 | 71 | 10/5/2026 |
| 1.10.6.22-pre1 | 76 | 10/4/2026 |
| 1.10.6.21 | 87 | 9/28/2026 |
| 1.10.6.20 | 92 | 9/25/2026 |
| 1.10.6.19 | 90 | 9/25/2026 |
| 1.10.6.18 | 92 | 9/25/2026 |
| 1.10.6.17-preview.1 | 57 | 9/23/2026 |