Skip to content

Instantly share code, notes, and snippets.

@kennykerr
Last active October 15, 2026 22:40
Show Gist options
  • Select an option

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

Select an option

Save kennykerr/eab2e1a3650d79b7a6a475e9eb58bd46 to your computer and use it in GitHub Desktop.
WinUI wishlist for declarative UI frameworks

WinUI wishlist for declarative UI frameworks

1. Transactional and batched WinUI updates

Issue: microsoft/microsoft-ui-xaml#11968

Let a framework stage property, content, collection, removal, and reparenting operations on a XamlRoot, then commit them atomically.

  • Layout, bindings, lifecycle work, and events must see only committed state.
  • Failure or abort must leave visible UI unchanged.
  • Detached controls must be configurable before attachment.
  • Normal setters and collection operations must join the active update.

Provide a packed ApplyBatch entry point to reduce per-property ABI calls, with one begin and one commit or abort per root update. Specify callback and element-factory timing around commit so renderers can release mutation borrows before reentry.

2. Propagate update origins through notifications

Issue: microsoft/microsoft-ui-xaml#11969

Give each framework update an opaque origin. Carry it through setters, SetValue, ClearValue, content and collection changes, coercion, related-property changes, and delayed semantic events such as TextChanged, ValueChanged, SelectionChanged, and Toggled.

User input and unrelated WinUI work must have no framework origin. Custom controls must be able to read and propagate origins. Dependency-property callbacks alone are insufficient: renderers need to distinguish framework feedback from user input when semantic events arrive.

3. Use the system compositor

Issue: microsoft/microsoft-ui-xaml#11970

Use the inbox Windows.UI.Composition compositor rather than a separate Microsoft.UI.Composition stack. One composition object model would avoid a separately deployed compositor and enable direct visual, surface, animation, and device interoperability with Win32 and other Windows APIs.

4. Publish WinUI behavior metadata

Issue: microsoft/microsoft-ui-xaml#11971

Expose machine-readable property defaults and reset behavior, constraints, coercion, semantic change events, layout effects, structural child slots, collection shape, ordering, ownership, and lifecycle rules. Frameworks should not have to reverse-engineer and maintain these facts per control.

5. Add UIElement.XamlRootChanged(oldRoot, newRoot)

Issue: microsoft/microsoft-ui-xaml#11972

Raise one element-level event for attachment, detachment, and migration between roots. This should replace combinations of Loaded, retries, root queries, and root-level subscriptions used by dialogs, WebView, images, and composition integrations.

6. Report per-element implicit-transition completion

Issue: microsoft/microsoft-ui-xaml#11973

Report the element, property, transition-run ID, and whether that run completed or was canceled. Completion on a reusable transition object is ambiguous. Frameworks need actual run completion, not a dispatcher timer duplicating the configured duration.

7. Add programmatic theme-resource binding

Issue: microsoft/microsoft-ui-xaml#11753

Expose WinUI's existing theme-resource binding engine through an API such as:

FrameworkElement.SetThemeResourceBinding(dependencyProperty, resourceKey)

Preserve native theme and high-contrast re-resolution without requiring generated markup, XamlReader, or synthetic styles to bind a property to a resource.

8. Support transactional virtualized realization

Issue: none

Let frameworks defer realization and recycling callbacks while applying a batch of native changes. Run realization at a defined boundary, after the renderer has released its mutation borrows and before WinUI measures the returned content. Define callback ordering relative to root transaction commit, and cancellation when items are removed or an update is aborted.

Correct layout and scrolling must not require guessed placeholder heights; size estimates should remain optional performance hints.

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