Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: Resources resolution and layout improvements (backport #19187) #19221

Merged
merged 17 commits into from
Jan 14, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Don't invoke ApplyTemplate for collapsed elements
(cherry picked from commit 2fa51b2)
  • Loading branch information
jeromelaban authored and mergify[bot] committed Jan 14, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit f8851757e893cb321fa60d2eaf3b5d0ba08a8a6a
24 changes: 0 additions & 24 deletions src/Uno.UI/UI/Xaml/UIElement.Layout.crossruntime.cs
Original file line number Diff line number Diff line change
@@ -245,7 +245,6 @@ private void DoMeasure(Size availableSize)
if (this.Visibility == Visibility.Collapsed)
{
m_desiredSize = default;
RecursivelyApplyTemplateWorkaround();
return;
}

@@ -330,29 +329,6 @@ internal bool ShouldApplyLayoutClipAsAncestorClip()
//&& !GetIsScrollViewerHeader(); // Special-case: ScrollViewer Headers, which can zoom, must scale the LayoutClip too
}

private void RecursivelyApplyTemplateWorkaround()
{
// Uno workaround. The template should NOT be applied here.
// But, without this workaround, VerifyVisibilityChangeUpdatesCommandBarVisualState test will fail.
// The real root cause for the test failure is that FindParentCommandBarForElement will
// return null, that is because Uno doesn't yet properly have a "logical parent" concept.
// We eagerly apply the template so that FindParentCommandBarForElement will
// find the command bar through TemplatedParent
if (this is Control thisAsControl)
{
thisAsControl.ApplyTemplate();

// Update bindings to ensure resources defined
// in visual parents get applied.
this.UpdateResourceBindings();
}

foreach (var child in _children)
{
child.RecursivelyApplyTemplateWorkaround();
}
}


public void Arrange(Rect finalRect)
{