NavigationViewItem does not render MenuItems beyond the 2nd nesting level

Open
#1,754 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
csharp
Domain
desktop, frontend

Research direction

Start at the NavigationViewItem control and its rendering or template code, then reproduce the provided three-level MenuItems example with PaneDisplayMode="Left". Confirm the level-3 item is present in the data but not displayed, and consider the documented expectation that deeper items render recursively or the nesting limitation is explicitly documented.

Written by the indexing model from the issue text.

Description

bug
Describe the bug

When nesting NavigationViewItem.MenuItems three or more levels deep in a NavigationView with PaneDisplayMode="Left", only the first two levels are rendered and expandable. Level 3+ items are never displayed, even though they are correctly present in the data (MenuItems.Count confirms this via debugging), and even when IsExpanded = true is explicitly set on the level-2 parent item.

To Reproduce
new NavigationViewItem
{
    Content = "Level 1",
    MenuItems =
    {
        new NavigationViewItem
        {
            Content = "Level 2",
            MenuItems =
            {
                new NavigationViewItem
                {
                    Content = "Level 3", // never rendered
                    TargetPageType = typeof(SomePage),
                }
            }
        }
    }
}
Expected behavior

NavigationViewItem should support at least the same nesting behavior recursively at any depth, or the limitation should be explicitly documented.

Screenshots
Image
OS version

Windows 11

.NET version

.NET 8

WPF-UI NuGet version

4.3.0

Additional context

No response

Dominant language
C#
Stars
9.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lepoco/wpfui

All issues in lepoco/wpfui

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.