question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Question: Why MenuItems does not found on NavigationViewItem

See original GitHub issue

(I am using Visual Studio Chinese translated, the sentence below is translated which may be difference than Oringinal.) When I typed these code, editor tells me Unexpected symbol "MenuItems"

<NavigationViewItem Content="Nav Item">
  <NavigationViewItem.MenuItems>
  </NavigationViewItem.MenuItems>
</NavigationViewItem>

Why and what happens? I even changed my IDE from VS to JB, it’s still not working And also, this is not working

<Page  ... xmlns:muxc="using:Windows.UI.Xaml.Controls" ... >
   ...
  <Grid>
    <muxc:NavigationViewItem Content="Nav Item">
      <muxc:NavigationViewItem.MenuItems>
      </muxc:NavigationViewItem.MenuItems>
    </muxc:NavigationViewItem>
  </Grid>
</Page>

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:10 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
chingucodingcommented, Apr 30, 2021

You will need to add a reference to the Microsoft.UI.Xaml NuGet package and follow the installation steps outlined in the packages readme.

1reaction
huoyaoyuancommented, May 1, 2021

What version of WinUI are you using?

So the awnser is effectively that you haven’t install and aren’t actually using WinUI. Or, you are using system UWP which can be also called WinUI 1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

UWP: NavigationView.MenuItems results empty if ...
The parameter of Collapse method is NavigationViewItem , and we could not pass MenuItems element (data source type) into it directly. We need ......
Read more >
NavigationView.MenuItems and navigation - Microsoft Q&A
The issue is related to the linq that you used to get the NavigationViewItem . Actually, you could directly get the invoked item...
Read more >
NavigationViewItem Class (Windows.UI.Xaml.Controls)
Returns any base value established for a dependency property, which would apply in cases where an animation is not active. (Inherited from DependencyObject)....
Read more >
Navigating in a WinUI 3 Desktop application
We will cover navigating from a menu item to an application page, navigating to a menu item from code behind, retrieving the current...
Read more >
WinUI NavigationView hierarchical generated MenuItems ...
Hi, beginner/hobbyist here,. I have a NavigationView to manage navigation inside the app, and I managed to bind some hierarchical data (just ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found