Repository navigation
Conversation
Uno.UI can't call the ViewExtensions helpers once they move to Uno.UI.Extras, so it gets plain static copies named after the parent they follow: EnumerateVisualParents, EnumerateVisualTreeAncestors, EnumerateLogicalAncestors (renamed from EnumerateAncestors), EnumerateChildren, EnumerateDescendants and EnumerateRawDescendants. Co-Authored-By: Claude Opus 5.5 <[email protected]>
FindName was its only caller. Co-Authored-By: Claude Opus 5.5 <[email protected]>
GetTopLevelParent threw NotImplementedException on every target since the native renderers were removed, so the public BinderReferenceHolder.GetInactiveChildViewBinders and GetInactiveChildInstancesOfType threw as soon as a tracked view was active. Remove them with the other mocks (GetChildren(object), FindFirstChild(FrameworkElement)). Co-Authored-By: Claude Opus 5.5 <[email protected]>
TreeGraph covers it and is public in every build. Removes ShowLocalVisualTree, ShowDescendants, their Get*Details helpers and the Debug-only UIElement.ShowLocalVisualTree(); samples now call TreeGraph. GetVisualAncestry goes with ViewExtensions.cs: Uno.UI uses VisualTreeHelper.EnumerateVisualParents. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Moves ViewExtensions.visual-tree.cs (as VisualTreeExtensions.cs) and PrettyPrint.cs from Uno.UI into Uno.UI.Extras, which already compiled them on WinAppSDK through links. RemoteControl, which reached the internal EnumerateChildren through Uno.UI, now walks the children itself. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Renames Uno.UI.Extensions.ViewExtensions in Uno.UI.Extras to VisualTreeExtensions and makes it public on WinAppSDK too, where 7.0 had made it internal. - EnumerateAllChildren(maxDepth) becomes EnumerateRawDescendants, with no depth limit by default; on WinAppSDK it walks VisualTreeHelper. - The internal EnumerateAncestors becomes the public EnumerateVisualTreeAncestors, replacing GetVisualAncestry. - TryGetDpValue becomes public, and returns false instead of throwing when the value isn't a T. - AsNativeView is removed. - Uno.UI.ViewExtensions (FindFirstChild) is now internal. Co-Authored-By: Claude Opus 5.5 <[email protected]>
TreeGraph is public on every target now, including WinAppSDK. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ShowLocalVisualTree is gone; TreeGraph is public on every target in Uno.UI.Extras. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
TreeGraph, PrettyPrint and EnumerateRawDescendants are public on WinAppSDK now. The TabView sample's tree dump keeps a guard only on the Uno-internal layouter detail, and drops its dead native-view details; the leak test walks the same descendants on every target. Co-Authored-By: Claude Opus 5.5 <[email protected]>
26ddb64 to
a16c5c5
Compare
Only the test projects use it, and Uno.UI.Extras already compiled it on WinAppSDK through a link. Uno.UI.UnitTests gets access to the Extras internals for it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
It's public in Uno.UI.Extras on every target, so WindowHelper no longer needs a different FindFirstChild per platform. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 248951 found UI Test snapshots differences: Details
|
Removes Uno.UI.ViewExtensions and its FindFirstChild, which walked the raw child list. Tests and samples now call DependencyObjectExtensions.FindFirstChild, which walks VisualTreeHelper in the same order and is also compiled into Uno.UI.Extras on WinAppSDK, so the WINAPPSDK-only usings that picked the right FindFirstChild per platform collapse to one. Co-Authored-By: Claude Opus 5.5 <[email protected]>
It searches the whole subtree and returns the element itself first, so the name now says so and pairs with VisualTreeExtensions.FindFirstDescendant. Its unused childLevelLimit and includeCurrent parameters go; the two includeCurrent: false callers use FindFirstDescendant instead. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Calls whose receiver type can never be the requested type now use the public VisualTreeExtensions.FindFirstDescendant, which walks the same descendants without checking the root. FindFirstDescendantOrSelf stays where the receiver itself could be a match. Co-Authored-By: Claude Opus 5.5 <[email protected]>
None of these roots can be the element searched for at runtime. The TextBox caret test also gets a GetCaretPopups helper for its repeated popup query. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Every caller now uses VisualTreeExtensions.FindFirstDescendant. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Tick the box to add this pull request to the merge queue (same as
|
The class is removed, not made internal. Co-Authored-By: Claude Opus 5.5 <[email protected]>
FindFirstChild is gone; FindFirstDescendant and FindFirstAncestor work on every target with a single using. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26705/docs/index.html |
It prints the value itself, except for dependency objects, which print as their type name. FormatData, which nothing used, is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Zero no longer prints as an empty string in grid lengths, grid definitions and brush opacity. - Numbers are formatted with the invariant culture, so a decimal comma can't collide with the separators. - Enables nullable annotations, documents each method, fixes the corner order in FormatCornerRadius's comment and drops unused usings. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The build 248964 found UI Test snapshots differences: Details
|
- The OrThrow methods all return T, take T : class (or FrameworkElement when matching by name) and throw InvalidOperationException. - EnumerateChildren returns nothing for a null node instead of calling VisualTreeHelper with null. - TreeGraph's default details format numbers with the invariant culture. - Uses DependencyObject instead of the _View alias, documents every TreeGraph overload, and drops unused usings and an empty #if block. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Formats each transform kind compactly (Translate, Scale, Rotate, Skew, Composite, Matrix, groups), with "(identity)" when it changes nothing. Co-Authored-By: Claude Opus 5.5 <[email protected]>
DescribeLayout is TreeGraph's default and now only lists values that differ from their defaults (grid cell, constraints, alignment, spacing, opacity, Collapsed). DescribeVisual shows border, background, spacing and a control's current visual states. Both can be passed as describeProperties. Co-Authored-By: Claude Opus 5.5 <[email protected]>
VisualTreeExtensions.TreeGraph.cs holds TreeGraph, the DescribeLayout and DescribeVisual presets and their helpers; the tree walks stay in VisualTreeExtensions.cs. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Prints the element's ancestors root first, one per line and indented like TreeGraph, with the same describers, to see why an element is sized or placed the way it is. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Commented out like the other optional details. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-26705/docs/index.html |
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
|
The build 248975 found UI Test snapshots differences: Details
|
GitHub Issue: related to unoplatform/add-private#61 (a discussion, so nothing to close)
PR Type:
✨ Feature
What changed? 🚀
Since 7.0, the visual tree helpers (
TreeGraph,FindFirstDescendant,FindFirstDescendantOrThrow,PrettyPrint, ...) are internal on WinAppSDK, so WinAppSDK heads can't call them anymore. This PR moves them intoUno.UI.Extrasand makes them public on every target, WinAppSDK included.ViewExtensions.visual-tree.csandPrettyPrint.csmove fromUno.UItoUno.UI.Extras, which already compiled them on WinAppSDK through links. The class is renamedUno.UI.Extensions.VisualTreeExtensions; the namespace doesn't change, so extension-method calls compile as before.PrettyPrintkeeps its name.Uno.UI.ViewExtensions.EnumerateAllChildren(maxDepth)becomesVisualTreeExtensions.EnumerateRawDescendants(maxDepth), with no depth limit by default. It still includes thex:Loadplaceholders on Uno targets; on WinAppSDK it walksVisualTreeHelper.EnumerateAncestorsbecomes the publicEnumerateVisualTreeAncestors, replacingGetVisualAncestry.TryGetDpValuebecomes public, and returnsfalseinstead of throwing when the value isn't of the requested type.AsNativeView, the oldShowLocalVisualTreedump (including the Debug-onlyUIElement.ShowLocalVisualTree()), and the leftover unit-test mocks, includingGetTopLevelParent, which threw on every target and took the publicBinderReferenceHolder.GetInactiveChildViewBinders/GetInactiveChildInstancesOfTypedown with it.VisualTreeHelper, named after the parent they follow:EnumerateVisualParents,EnumerateVisualTreeAncestors,EnumerateLogicalAncestors(renamed fromEnumerateAncestors),EnumerateChildren,EnumerateDescendantsandEnumerateRawDescendants. Behavior is unchanged for those callers, except thatAutoSuggestBoxand the simple-accessibility name aggregation no longer stop at 20 levels.Uno.UI.ViewExtensionsis removed. Its remainingFindFirstChild, which walked the raw child list, was only used by tests and samples; they now callVisualTreeExtensions.FindFirstDescendant, which walks the same descendants throughVisualTreeHelperand exists on WinAppSDK too. The internalDependencyObjectExtensions.FindFirstChildgoes the same way.FindFirstChildusings, the TabView sample's tree dump, the leak test's child walk,WindowHelper.WaitForLoaded).XamlHelper(tests only) also moves toUno.UI.Extras, which already compiled it on WinAppSDK; Extras now grantsInternalsVisibleTotoUno.UI.UnitTestsfor it.PrettyPrint:FormatObjectis renamedFormatValueand the unusedFormatDatais removed; numbers are formatted with the invariant culture; zero no longer prints as an empty string in grid lengths and brush opacity; nullable annotations and doc comments on every method. NewFormatTransformfor render transforms.VisualTreeExtensions: theOrThrowmethods returnT, require a reference type and throwInvalidOperationException; the child walk returns nothing for a null node instead of passing null toVisualTreeHelper; doc comments on everyTreeGraphoverload.TreeGraphgets two public describers,DescribeLayout(the default, which now lists only values that differ from their defaults) andDescribeVisual(border, background, spacing, a control's current visual states), plusBeelineGraph, which prints the path from the root down to an element with the same describers.TreeGraphand its describers live inVisualTreeExtensions.TreeGraph.cs.TreeGraph, its describers andBeelineGraphreplaceShowLocalVisualTreein the visual tree debugging guide, the runtime-test guide points toFindFirstDescendant/FindFirstAncestor, and the 7.1 migration notes cover the changes.Validation (local, Windows):
Given_xLoad,Given_xBind_Binding,Given_ItemsControl,Given_ThemeResource,Given_StaticResource,Given_Explicit_Style,Given_ListViewBase,Given_Selector,Given_XamlReader,Given_AutomationPeerProviderTargets,FindName: all passed.Given_AutoSuggestBox,Given_ComboBox,Given_Flyout*,Given_FrameworkElement_EffectiveViewport,Given_ScrollViewer_ScrollChaining,Given_xLoad,TemplatedParentTests): 260 passed, 0 failed.FindFirstChildcalls changed: 2450 passed, 0 failed.Given_XamlParseContext_AlcResolutiononly runs on a net11.0 build: 12 of 14 pass; the 2 failing rows ofWhen_OwningAppLacksAFrameworkKeyTheHostOverrides_Then_LoadTimeFallbackUsesTheOwningAppfail the same way on master.FindFirstDescendantOrSelflast were rerun after that change: all passed.VisualTreeExtensionscleanup:Given_ComboBox,TemplatedParentTests,Given_ContentPresenter,Given_FrameworkElement_EffectiveViewport: 411 passed, 0 failed.Given_ListViewBasetests that call the defaultTreeGraph(),TemplatedParentTests,Given_ContentPresenter: 296 passed, 0 failed.PackageDiffIgnore.xmlentries were not checked locally against the package diff.PR Checklist ✅
Screenshots Compare Test Runresults.Breaking changes (migration path in
doc/articles/migrating-from-previous-releases.md, "Uno Platform 7.1"):Uno.UI.Extensions.ViewExtensionsandUno.UI.Extensions.PrettyPrintmove fromUno.UI.dlltoUno.UI.Extras.dll(same namespace;ViewExtensionsrenamedVisualTreeExtensions). Extension-method calls compile unchanged; class-qualified calls andusing staticneed the new class name; binaries need recompiling.EnumerateAllChildren→EnumerateRawDescendants(unlimited depth by default, selector overload removed);GetVisualAncestry→EnumerateVisualTreeAncestors().OfType<UIElement>();AsNativeViewremoved.PrettyPrint.FormatObject→FormatValue;PrettyPrint.FormatDataremoved.FindFirstAncestorOrThrow/FindFirstDescendantOrThrowthrowInvalidOperationExceptioninstead ofExceptionand require a reference type.Uno.UI.ViewExtensionsis removed;BinderReferenceHolder.GetInactiveChildViewBinders/GetInactiveChildInstancesOfTyperemoved (they threw).Downstream: uno.toolkit's
LeakTestcallsEnumerateAllChildren(maxDepth: 200)and needs to switch toEnumerateRawDescendantsonce a build with this change is available.🤖 Generated with Claude Code