Microsoft.UI.Reactor.Advanced
0.1.0-preview.13
Prefix Reserved
dotnet add package Microsoft.UI.Reactor.Advanced --version 0.1.0-preview.13
NuGet\Install-Package Microsoft.UI.Reactor.Advanced -Version 0.1.0-preview.13
<PackageReference Include="Microsoft.UI.Reactor.Advanced" Version="0.1.0-preview.13" />
<PackageVersion Include="Microsoft.UI.Reactor.Advanced" Version="0.1.0-preview.13" />
<PackageReference Include="Microsoft.UI.Reactor.Advanced" />
paket add Microsoft.UI.Reactor.Advanced --version 0.1.0-preview.13
#r "nuget: Microsoft.UI.Reactor.Advanced, 0.1.0-preview.13"
#:package Microsoft.UI.Reactor.Advanced@0.1.0-preview.13
#addin nuget:?package=Microsoft.UI.Reactor.Advanced&version=0.1.0-preview.13&prerelease
#tool nuget:?package=Microsoft.UI.Reactor.Advanced&version=0.1.0-preview.13&prerelease
Microsoft.UI.Reactor.Advanced
Optional Reactor components with heavier native and graphics dependencies — a Win2D canvas family for immediate-mode drawing, the D3-derived charting subsystem, the docking / dock-layout subsystem, a CommonMark markdown renderer, and a virtualized data grid, all inside a Reactor element tree.
About
Microsoft.UI.Reactor.Advanced extends Microsoft.UI.Reactor with components that pull in larger native or graphics stacks: a Win2D canvas family (manual, animated, and virtual) that lets you draw with CanvasDrawingSession directly from a declarative Reactor component; the Microsoft.UI.Reactor.Charting subsystem — a C# port of the D3 primitives plus ready-made chart components and chart accessibility; the Microsoft.UI.Reactor.Docking subsystem — a Visual-Studio-style docking host with floating windows, tear-off tabs, splitters, and layout persistence; the Microsoft.UI.Reactor.Markdown subsystem — a CommonMark renderer (C# md4c port) that turns markdown into a Reactor element tree; and a virtualized, editable data grid (Microsoft.UI.Reactor.Controls DataGrid) with typed columns, sorting/filtering, paging, and column resize/reorder.
This package is intentionally separate from the core framework so that apps which don't need Win2D, charting, docking, markdown, or the data grid keep their trim/AOT closure and native payload isolated. The relocated types keep their existing namespaces (Microsoft.UI.Reactor.Charting / .Docking / .Markdown, and the data-grid records in Microsoft.UI.Reactor.Controls), so moving to this package is a package reference with no source change — except the DSL entry points that lived in the shared core Factories partial: the Markdown(...) factory and the data grid's DataGrid(...) / Column(...) / AutoColumns(...) factories move into Microsoft.UI.Reactor.Advanced.Factories (add using static Microsoft.UI.Reactor.Advanced.Factories;).
How to Use
Install the package alongside Microsoft.UI.Reactor:
dotnet add package Microsoft.UI.Reactor.Advanced
Drop a Win2D canvas into any component. The onDraw callback runs on the UI thread with a CanvasDrawingSession; pass a redrawKey to trigger invalidation when your state changes:
using Microsoft.UI.Reactor;
using Microsoft.UI.Reactor.Core;
using Windows.UI;
using static Microsoft.UI.Reactor.Factories; // core DSL
using static Microsoft.UI.Reactor.Advanced.Factories; // Win2D DSL
internal sealed class CanvasDemo : Component
{
public override Element Render()
{
var (radius, setRadius) = UseState(40f);
return VStack(12,
Win2DCanvas(
onDraw: (session, args) =>
{
session.Clear(Colors.Black);
session.FillCircle(120, 120, radius, Colors.DeepSkyBlue);
},
redrawKey: radius),
Button("Grow", () => setRadius(radius + 10f))
).Padding(24);
}
}
When radius changes, the new redrawKey tells Reactor to invalidate the canvas and redraw.
Key Features
Win2DCanvas— manual-invalidate canvas (CanvasControl); redraws when itsredrawKeychanges.Win2DAnimatedCanvas— game-loop canvas (CanvasAnimatedControl) whose update and draw callbacks run on the Win2D game thread.Win2DVirtualCanvas— virtualized canvas (CanvasVirtualControl) for very large drawing surfaces.- Async resource creation — overloads accept an
onCreateResourcescallback tracked by Win2D for loading bitmaps and other device resources. - Isolated native payload — keeps Win2D out of the core framework's trim/AOT closure.
- Charting (
Microsoft.UI.Reactor.Charting) — a C# port of the D3 primitives (scales, shapes, layouts, color/format/interpolate) plus high-levelChartscomponents and chart accessibility. Import withusing static Microsoft.UI.Reactor.Charting.Charts;. - Docking (
Microsoft.UI.Reactor.Docking) — a Visual-Studio-style docking host: dockable tool windows and documents, floating windows, tear-off tabs, splitters, keyboard navigation, and JSON layout persistence. Register the native renderer withDockingNativeInterop.Register(reconciler). - Markdown (
Microsoft.UI.Reactor.Markdown) — a CommonMark renderer (C# port of the md4c parser) that turns a markdown string into a Reactor element tree. TheMarkdown(...)factory ships inMicrosoft.UI.Reactor.Advanced.Factories, so addusing static Microsoft.UI.Reactor.Advanced.Factories;. - Data grid (
Microsoft.UI.Reactor.ControlsDataGrid) — a virtualized, editable data grid with typed columns, sorting/filtering, paging, and column resize/reorder. TheDataGrid(...)/Column(...)/AutoColumns(...)factories ship inMicrosoft.UI.Reactor.Advanced.Factories, so addusing static Microsoft.UI.Reactor.Advanced.Factories;; the element/column records keep theirMicrosoft.UI.Reactor.Controlsnamespace.
Main Types
Win2DCanvas(...)— factory for a manual-invalidate Win2D canvas.Win2DAnimatedCanvas(...)— factory for an animated game-loop canvas.Win2DVirtualCanvas(...)— factory for a virtualized canvas.Win2DCanvasElement— immutable element produced byWin2DCanvas.
Best Practices
- Drive redraws with
redrawKey. Pass the state that affects the drawing (or a composite of it) asredrawKey. The canvas only invalidates when the key changes, so avoid allocating a new key object on every render when nothing changed. - Create device resources in
onCreateResources, notonDraw. Load bitmaps and other GPU resources in the resource callback so they survive device-lost events; theonDrawcallback should stay allocation-free and fast. - Mind the thread for animated canvases.
Win2DAnimatedCanvasinvokesonUpdate/onDrawon the Win2D game thread, not the UI thread. Don't touch Reactor component state directly from those callbacks — pass data in throughdrawStateand marshal back with athreadSafe: truestate setter if you need to update the UI. - Keep Win2D optional. Reference this package only from the projects that need it so apps that don't draw keep a smaller trim/AOT closure and native payload.
Additional Documentation
Related Packages
Microsoft.UI.Reactor— the core declarative WinUI 3 framework (required).Microsoft.UI.Reactor.Devtools— optional developer-loop devtools host.Microsoft.UI.Reactor.ProjectTemplates—dotnet newtemplates.
Feedback & Contributing
Microsoft.UI.Reactor.Advanced is part of the open-source Reactor project. File issues, ask questions, and contribute on GitHub. See CONTRIBUTING.md to get started.
Support Policy
This package is currently released as a preview and is provided under the MIT License. APIs may change between preview releases.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-windows10.0.22621 is compatible. |
-
net10.0-windows10.0.22621
- Microsoft.Graphics.Win2D (>= 1.4.0)
- Microsoft.UI.Reactor (>= 0.1.0-preview.13)
- Microsoft.WindowsAppSDK.WinUI (>= 2.1.0)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Microsoft.UI.Reactor.Advanced:
| Package | Downloads |
|---|---|
|
Microsoft.UI.Reactor.Devtools
Optional devtools host for Microsoft.UI.Reactor. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.13 | 102 | 8/5/2026 |
| 0.1.0-preview.12 | 834 | 7/15/2026 |
| 0.1.0-preview.11 | 1,628 | 6/18/2026 |
| 0.1.0-preview.10 | 78 | 6/18/2026 |
| 0.1.0-preview.5 | 121 | 6/12/2026 |
| 0.1.0-preview.4 | 111 | 6/11/2026 |
| 0.1.0-preview.3 | 84 | 6/10/2026 |