Skip to content

MoveOwnershipToLayoutFromElementFactory assert is failing with NavigationView #4691

Open

Description

@MartinZikmund

Current behavior

Assert is failing in the MoveOwnershipToLayoutFromElementFactory method when HierarchicalNavigationViewMarkup sample is opened. The assert has been temporarily commented out.

Expected behavior

Should not fail.

How to reproduce it (as minimally and precisely as possible)

Workaround

Environment

Nuget Package:

  • Uno.UI / Uno.UI.WebAssembly / Uno.UI.Skia
  • Uno.WinUI / Uno.WinUI.WebAssembly / Uno.WinUI.Skia
  • Uno.SourceGenerationTasks
  • Uno.UI.RemoteControl / Uno.WinUI.RemoteControl
  • Other:

Nuget Package Version(s):

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Skia
    • WPF
    • GTK (Linux)
    • Tizen
  • Windows
  • Build tasks
  • Solution Templates

IDE:

  • Visual Studio 2017 (version: )
  • Visual Studio 2019 (version: )
  • Visual Studio for Mac (version: )
  • Rider Windows (version: )
  • Rider macOS (version: )
  • Visual Studio Code (version: )

Relevant plugins:

  • Resharper (version: )

Anything else we need to know?

Activity

  1. added
    kind/bug
    triage/untriaged
    and removed
    triage/untriaged
    on Dec 8, 2020
  2. added
    project/items 🧾
    on Dec 9, 2020
  3. added
    difficulty/tbd
    on Feb 15, 2021
  4. added
    difficulty/challenging 🤯
    and removed
    difficulty/tbd
    on Jun 2, 2021
  5. changed the title [-]MoveOwnershipToLayoutFromElementFactory assert is failing with NavigationView[/-] [+]`MoveOwnershipToLayoutFromElementFactory` assert is failing with `NavigationView`[/+] on Jun 1, 2023
  6. added
    project/navigation-lifecycle 🧬
    on Jun 1, 2023
  7. github-actions commented on Jul 28, 2025

    @github-actions
    Contributor

    Hey there — just a heads-up that this issue has been quiet for over a year. If there’s no update or comment in the next 10 days, it’ll be closed automatically. Feel free to remove the stale label or drop a note to keep it open.

  8. added
    stale
    on Jul 28, 2025
  9. removed
    stale
    on Jul 28, 2025
  10. MartinZikmund commented on Apr 8, 2026

    @MartinZikmund
    MemberAuthor

    Repro generator

    Runtime test(s) added in branch dev/mazi/repro/4691:

    • src/Uno.UI.RuntimeTests/Tests/Microsoft_UI_Xaml_Controls/Given_NavigationView.cs → When_HierarchicalNavigationView_Loaded_Then_NoOwnershipAssertFailure

    ⚠️ The test(s) pass on current master — the hierarchical NavigationView loads and expands without crashing. The underlying VirtualizationInfo.MoveOwnershipToLayoutFromElementFactory assertion (line 91 of VirtualizationInfo.cs) is still commented out with a reference to this issue. The test exercises 3-level deep hierarchical NavigationView items with expansion, which is the scenario that originally triggered the assert. The test is provided as a regression test and starting point — re-enabling the assert in VirtualizationInfo.cs would be needed to verify the ownership state machine invariant is actually correct.

  11. self-assigned this
    on Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

difficulty/challenging 🤯has-repro-branchkind/bugproject/items 🧾project/navigation-lifecycle 🧬

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions