Skip to content

Keep page in NavigationPage's logical tree until animation is complete - #21751

Merged
MrJul merged 2 commits into
AvaloniaUI:mainfrom
MrJul:fix/navigationpage-logicalchildren
Jul 11, 2026
Merged

Keep page in NavigationPage's logical tree until animation is complete#21751
MrJul merged 2 commits into
AvaloniaUI:mainfrom
MrJul:fix/navigationpage-logicalchildren

Conversation

@MrJul

@MrJul MrJul commented Jul 10, 2026

Copy link
Copy Markdown
Member

What does the pull request do?

This PR fixes NavigationPage, which was removing the page it's transitioning away from the logical tree, causing visible issues such as unapplied styles and broken bindings briefly visible during the transition. Worse, it caused issues such as #21737, where every item in a ListBox was measured with a 0 height (due to the content presenter being empty), causing the viewport to be able to incorrectly contain everything, breaking virtualization.

The page is now kept in the logical tree until the transition is complete.

Unit tests have been added.

Fixed issues

@avaloniaui-bot

Copy link
Copy Markdown

You can test this PR using the following package version. 12.2.999-cibuild0067420-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@MrJul
MrJul added this pull request to the merge queue Jul 11, 2026
Merged via the queue into AvaloniaUI:main with commit bc3001b Jul 11, 2026
11 checks passed
@MrJul
MrJul deleted the fix/navigationpage-logicalchildren branch July 11, 2026 07:46
MrJul added a commit that referenced this pull request Jul 29, 2026
#21751)

* Keep page in NavigationPage's logical tree until animation is complete

* Share templates in NavigationPageTests
@MrJul MrJul added backported-12.1.x and removed backport-candidate-12.1.x Consider this PR for backporting to 12.1 branch labels Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NavigationPage PageTransition causes severe GC/jank when navigating away from ControlCatalog ListBoxPage

3 participants