Skip to content

Instantly share code, notes, and snippets.

@kennykerr
Last active August 31, 2026 19:09
Show Gist options
  • Select an option

  • Save kennykerr/7a9d69871bd5775adad6c0c215deee73 to your computer and use it in GitHub Desktop.

Select an option

Save kennykerr/7a9d69871bd5775adad6c0c215deee73 to your computer and use it in GitHub Desktop.

WinUI wishlist for declarative UI frameworks

Validated against the current C# Reactor and windows-reactor implementations.

Design requirement: a coarse-grained ABI

These features should add only one begin call and one commit or abort call per root update. Normal property and collection operations should join the active update automatically, and event handlers should be able to read its origin without casting or querying the sender. Avoid token-bearing overloads or transaction calls for every property.

The transaction API should also provide a packed ApplyBatch entry point for property and tree operations. This is what removes WinUI's existing property-by-property ABI traffic, rather than merely avoiding new overhead. Using it should be optional: planned renderers can submit a batch, while direct renderers can use the ambient transaction.

1. Transactional XAML updates

Allow a framework to stage property writes, clears, content changes, collection changes, removal, and reparenting on a XamlRoot, then publish them together. Layout, bindings, lifecycle work, and public events should see only the committed state. Failure or abort should leave visible XAML unchanged. Detached controls must be configurable before being attached to the target root. Imperative operations such as focus, dialogs, WebView initialization, and animation startup can remain outside the transaction.

windows-reactor already plans updates, but WinUiRuntime::apply executes each command sequentially. It should keep that architecture and submit each plan through ApplyBatch, gaining atomic publication with far fewer ABI calls.

C# Reactor mutates controls while recursively reconciling. It could keep that direct model and wrap each top-level reconcile in a transaction rather than adopting Rust's command interpreter.

2. Propagate an update origin through notifications

Give each update an opaque origin and carry it through normal setters, SetValue, ClearValue, content and collection changes, coercion, related-property changes, delayed delivery, and semantic events such as TextChanged, ValueChanged, SelectionChanged, and Toggled. User input and unrelated WinUI work should have no framework origin. Custom controls should be able to participate.

windows-reactor could remove much of its generated property-to-event feedback table and its exact, normalized, and suppressed-event tracking.

C# Reactor could remove suppression counters and scopes, expected-value matching, controlled-property echo state, coercion exceptions, and much of its WriteSuppressed plumbing.

The origin must reach semantic control events, not only dependency-property callbacks. Transactions hide partial state; origins let frameworks identify their own notifications after that state is published.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment