Skip to content

Fix ContentDialog theme forwarding and default inheritance - #1389

Open
kusutoriクスとり (kusutori) wants to merge 1 commit into
microsoft:mainfrom
kusutori:fix/content-dialog-theme
Open

kusutoriクスとり (kusutori) wants to merge 1 commit into
microsoft:mainfrom
kusutori:fix/content-dialog-theme

Conversation

@kusutori

Copy link
Copy Markdown
Contributor

Summary

Forward .RequestedTheme(...) to the real ContentDialog instead of only its placeholder. When unset, follow the declaration site's ActualTheme, including live changes and local/multi-window overrides.

The binding is detached on close/unmount. Explicit Default remains explicit, native .Set(...) callbacks run last, and the guide documents the behavior. No new public API.

Linked issue

Fixes #1388

Test plan

Real WinUI fixtures compare the visible dialog's theme and text foreground against a plain native ContentDialog. They cover Light/Dark/Default, both opening paths, live updates, override removal, secondary windows, draft preservation and teardown.

Targeted run Result
Unchanged baseline + same tests 27/74 checks fail; native positive controls pass
Fixed JIT / Native AOT 74/74 checks pass in each
MSIX All 4 theme fixtures pass (10 runner tests including guards)
Existing ContentDialogLive regressions All 9 fixtures pass

Removing initial forwarding, update forwarding or the theme-change subscription makes the corresponding tests fail. Framework Release build passed; Tonarink integration was also verified manually.

Risk / breaking changes

Unset dialogs now follow their declaration's effective theme rather than the application fallback. Targeted validation only, not the full solution/CI suite; ARM64 and combined AOT+MSIX were not tested locally.

@azchohfi

Copy link
Copy Markdown
Collaborator

kusutoriクスとり (@kusutori) A couple of conflicts with main.

@kusutori

Copy link
Copy Markdown
Contributor Author

Rebase is done and tests have passed.

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ContentDialog does not receive RequestedTheme or inherit its declaration theme

2 participants