Commit 1737b74
* fix(dialog): resolve ContentDialog XamlRoot from in-tree placeholder (#246)
ShowContentDialog mounted dialog content into a detached subtree, then
read contentUi.XamlRoot — which is always null because the content was
never attached. ShowAsync() then threw on the null XamlRoot, the empty
catch swallowed the error, and apps saw no dialog. Workaround was to
manually .Set(d => d.XamlRoot = ...).
Resolve XamlRoot from the in-tree placeholder (which the reconciler
already returned to the parent), falling back to PrimaryWindow. For the
mount-time IsOpen=true case the placeholder isn't attached yet, so defer
via Loaded. ApplySetters runs last so caller .Set(...) still wins.
Adds two regression fixtures (mount-time and state-flip paths) that
verify the dialog appears as a popup via GetOpenPopupsForXamlRoot.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* Address CR: defer on anchor.XamlRoot=null, re-read current element, log swallowed errors
- ShowContentDialog: only consult anchor.XamlRoot at mount-time; defer to
Loaded whenever the anchor isn't attached, so dialogs mounted in a
secondary window can't be misrouted to PrimaryWindow's XamlRoot. The
PrimaryWindow fallback is now only a last resort after Loaded.
- In the Loaded handler, re-read the current element from the anchor's
Tag and bail unless IsOpen is still true — guards against a stale show
if state flipped back to false (or the element was replaced) before
the placeholder attached.
- Revert ShowContentDialog from internal to private (no external caller).
- Log ShowAsync exceptions via Debug.WriteLine instead of silently
swallowing, matching the rest of the framework's best-effort pattern.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2bec028 commit 1737b74
5 files changed
Lines changed: 130 additions & 9 deletions
File tree
- src/Reactor/Core
- tests/Reactor.AppTests.Host/SelfTest
- Fixtures
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1732 | 1732 | | |
1733 | 1733 | | |
1734 | 1734 | | |
1735 | | - | |
| 1735 | + | |
1736 | 1736 | | |
1737 | 1737 | | |
1738 | 1738 | | |
1739 | | - | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
| 1757 | + | |
| 1758 | + | |
| 1759 | + | |
| 1760 | + | |
| 1761 | + | |
| 1762 | + | |
| 1763 | + | |
| 1764 | + | |
| 1765 | + | |
| 1766 | + | |
1740 | 1767 | | |
1741 | 1768 | | |
1742 | 1769 | | |
1743 | 1770 | | |
1744 | 1771 | | |
1745 | | - | |
1746 | 1772 | | |
1747 | 1773 | | |
1748 | 1774 | | |
1749 | 1775 | | |
| 1776 | + | |
| 1777 | + | |
1750 | 1778 | | |
1751 | 1779 | | |
1752 | 1780 | | |
1753 | | - | |
1754 | | - | |
1755 | 1781 | | |
1756 | 1782 | | |
1757 | 1783 | | |
1758 | | - | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
1759 | 1789 | | |
1760 | 1790 | | |
1761 | 1791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2426 | 2426 | | |
2427 | 2427 | | |
2428 | 2428 | | |
2429 | | - | |
| 2429 | + | |
2430 | 2430 | | |
2431 | 2431 | | |
2432 | 2432 | | |
| |||
Lines changed: 85 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
323 | 408 | | |
324 | 409 | | |
325 | 410 | | |
| |||
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| 352 | + | |
| 353 | + | |
352 | 354 | | |
353 | 355 | | |
354 | 356 | | |
| |||
1137 | 1139 | | |
1138 | 1140 | | |
1139 | 1141 | | |
| 1142 | + | |
| 1143 | + | |
1140 | 1144 | | |
1141 | 1145 | | |
1142 | 1146 | | |
| |||
0 commit comments