NavigationView - MenuItemsSource Binding issue when used within a UserControl
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When a NavigationView control is set inside a UserControl View, the MenuItemsSource doesn't reflect the binding on the UI
Other properties are correctly set from the same ViewModel (TitleBar Title and IsPaneToggleVisible from the NavigationView control)
The MenuItemsSource property binding functions properly when used directly in the MainWindow as a View.
To Reproduce
See https://github.com/Coloris/wpfsandbox/tree/main
Expected behavior
The Binding should work and the UI display the MenuItems
Screenshots
No response
OS version
Windows 11 22h2 - Version 22621.1848
Visual Studio 2022 - Version 17.6.4
.NET version
7.0
WPF-UI NuGet version
3.0.0-preview.3
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked wpfsandbox reproduction and compare NavigationView.MenuItemsSource binding inside a UserControl with the working MainWindow case. Investigate the NavigationView and UserControl binding context, using the reported TitleBar Title and IsPaneToggleVisible bindings as comparison points. Done means the UI displays the bound menu items when NavigationView is hosted in a UserControl.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100