microsoft/microsoft-ui-reactor/reactor-advanced

Claude Code and agent skill by microsoft/microsoft-ui-reactor

Trust tier 4
  • vendor
Source check pending

Checking that the SKILL.md file is still in the repository.

Reactor.Advanced Win2D canvases — choosing Win2DCanvas, Win2DAnimatedCanvas, or Win2DVirtualCanvas; using UseDrawState, UseCanvasResources, UseDrawCommand; and following threading/device-loss rules.

Install

npx vskill@latest install microsoft/microsoft-ui-reactor/reactor-advanced

SKILL.md

The same SKILL.md was published earlier as microsoft/microsoft-ui-reactor/reactor-advanced.

Reactor Advanced

Use this skill when adding immediate-mode Win2D drawing through Microsoft.UI.Reactor.Advanced. The full guide is docs/guide/win2d-canvas.md; the performance sample is samples/apps/particle-storm/.

Pick the right canvas

WorkloadUseWhy
Static or data-driven drawing that changes after state updatesWin2DCanvas.Of(onDraw, redrawKey)Manual invalidation; pass a changing RedrawKey for every value the draw callback reads.
Game loop, physics, particles, visualizers, steady FPSWin2DAnimatedCanvas.Of(onUpdate, onDraw, drawState, isPaused)Win2D owns the tick and calls update/draw on the game thread.
Huge scrollable or tiled surfacesWin2DVirtualCanvas.Of(onRegionDraw, contentSize)Draws only invalidated visible regions; update tiles by changing InvalidateRegions.

Threading cheat sheet

CallbackThreadRule
Win2DCanvas.OnDrawUI threadSafe to read Reactor state captured by render.
Win2DAnimatedCanvas.OnUpdate / .OnDrawWin2D game threadDo not touch WinUI controls. Use thread-safe data or UseState(threadSafe: true) for UI handoff.
Win2DVirtualCanvas.OnRegionDrawUI threadKeep work bounded to the invalidated region.
UseCanvasResources factoryWorker/game threadCreate device resources and return a disposable/recreatable object.

Treat Ref.Current from UseDrawState like a volatile field. Re-read it and make the referenced object safe for any cross-thread mutation. Debug builds add a sentinel that appends docs/guide/win2d-canvas.md#threading to likely WinUI thread-affinity exceptions from animated callbacks.

Reference graph model

Element refs are reactive cells. .Ref(cell) writes the mounted FrameworkElement into the cell and writes null on unmount. Reference properties (TeachingTip.Target, .LabeledBy, .DescribedBy, .FlowsTo, .FlowsFrom, .XYFocus*, and custom descriptor .Reference / .ReferenceList) subscribe to those cells instead of sampling .Current.

Resolution is one-way and push-based: cells enqueue dirty reference edges during commit, then Reactor flushes the dirty set after the tree is stable. Cycles are allowed because each property slot is a one-way edge. List references preserve author declaration order and omit unresolved targets. Advanced authors should use descriptor.Reference for regular controls and binding.Reference only as the bridge for hand-coded handlers.

Hooks and recipes

csharp
var state = ctx.UseDrawState(() => new ParticleField(20_000));
var sprite = ctx.UseCanvasResources<CanvasBitmap>(async device =>
await CanvasBitmap.LoadAsync(device, "Assets/particle.png"));
var draw = ctx.UseDrawCommand(model, static (session, args, m) =>
m.Render(session), deps: [model.Version]);

UseCanvasResources is the device-loss recipe: allocate from the supplied CanvasDevice, draw only when the returned ref is non-null, and let the hook dispose/recreate after CanvasDevice.DeviceLost.

Performance proof

The Particle Storm sample (samples/apps/particle-storm/) is the canonical pattern: pure Reactor chrome controls parameters; Win2DAnimatedCanvas renders the hot particle path; UseDrawState holds the particle buffers; UseCanvasResources owns sprites and other device resources.

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 3 Oct 2026.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
660
Repository forks
57
7-day trend score
37

Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill CERTIFIED badge
[![vskill CERTIFIED](https://verified-skill.com/api/v1/skills/microsoft/microsoft-ui-reactor/reactor-advanced/badge)](https://verified-skill.com/skills/microsoft/microsoft-ui-reactor/reactor-advanced)

Something wrong with this skill or its page? Tell us.