DrawnUi.Wpf 1.10.6.21

There is a newer prerelease version of this package available.
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
                    
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="DrawnUi.Wpf" Version="1.10.6.21" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="DrawnUi.Wpf" Version="1.10.6.21" />
                    
Directory.Packages.props
<PackageReference Include="DrawnUi.Wpf" />
                    
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 DrawnUi.Wpf --version 1.10.6.21
                    
#r "nuget: DrawnUi.Wpf, 1.10.6.21"
                    
#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 DrawnUi.Wpf@1.10.6.21
                    
#: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=DrawnUi.Wpf&version=1.10.6.21
                    
Install as a Cake Addin
#tool nuget:?package=DrawnUi.Wpf&version=1.10.6.21
                    
Install as a Cake Tool

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 through KeyboardManager.
  • SkiaEditor with 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.
  • SkiaShell for drawn navigation: pages, tabs, popups, modals, toasts, IVisibilityAware callbacks.
  • 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.Game addon: a DrawnGame loop, keyboard and mouse input, a RescalingCanvas that keeps the game's aspect ratio when the window resizes.

Docs: https://drawnui.net/articles/wpf/

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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