Repository navigation
feat(windows): view location in window, on screen and relative to a view - #11515
Merged
triniwiz merged 7 commits intoOct 23, 2026
Merged
Conversation
getLocationInWindow and getLocationRelativeTo transform the element's origin through XAML; getLocationOnScreen adds the window's client origin, read off its AppWindow (cached per XamlRoot) by a window-helper util.
|
View your CI Pipeline Execution ↗ for commit 83ee840
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
…g' into fix/windows-view-location # Conflicts: # packages/core/ui/core/view/index.windows.ts
triniwiz
added a commit
that referenced
this pull request
Oct 23, 2026
…11468) * feat(windows): let a parent resolve its children's percentage sizes View gains _setChildPercentSize(child, horizontal, fraction), which returns false. A percentage width or height is handed to the parent's; when it returns true, core leaves the XAML Width/Height unset and skips its own percent sizing. Setting a length clears it (fraction null). * feat(windows): view location in window, on screen and relative to a view (#11515) getLocationInWindow and getLocationRelativeTo transform the element's origin through XAML; getLocationOnScreen adds the window's client origin, read off its AppWindow (cached per XamlRoot) by a window-helper util.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
On Windows,
getLocationInWindow(),getLocationOnScreen()andgetLocationRelativeTo()fall through toViewCommonand returnundefined.What is the new behavior?
The Windows
Viewimplements all three, in DIPs as on Android and iOS:getLocationInWindow(): the element's origin throughTransformToVisual(null).getLocationRelativeTo(other): the origin throughTransformToVisual(other). It returnsundefinedunless both views share aXamlRoot.getLocationOnScreen(): the in-window location plus the window's client-area origin. A newgetClientOriginOnScreen(xamlRoot)util inwindow-helper.windows.tsreads that origin from theAppWindow(outer position plus frame insets, divided by the window scale) and caches each root'sAppWindow.Each call makes one or two native calls, and the origin point is created once.
Stacked on #11468 (base
fix/windows-parent-percent-sizing).Testing:
getActualSize()andgetLocationRelativeTo(): 416/416 pass without the suite's own Windows workarounds.getLocationOnScreen()for the window content matched Win32ClientToScreen(109.6 × 132.8 DIPs).tsc -p packages/core/tsconfig.lib.jsonreports no errors.