lepoco / lepoco/wpfui

Cannot add Navigation view items during Runtime

Open
#907 12 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Describe the bug

I am trying to add new Items based on configuration after the user open the app but the issue is I cannot see that the item is been added to the navigation view. The code I have now:

            var item = AppDataUtilities.AddAppItem(appData);
            navigationView.MenuItems.Add(item);
            navigationView.UpdateLayout();
To Reproduce

Add NavigationViewItem during runtime, like event.

Expected behavior

NavigationView able to react the changes.

Screenshots

No response

OS version

Windows 11
VS 2022

.NET version

.Net 8

WPF-UI NuGet version

3.0.0 preview4

Additional context

No response

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.

Research direction

Start by reproducing the reported runtime addition through NavigationView.MenuItems.Add(item) in the NavigationView control. Check how NavigationView handles MenuItems changes and UpdateLayout(), then verify that a newly added NavigationViewItem becomes visible after the change.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.