Hello,
Welcome to 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 via the args.InvokedItemContainer property.
Please change the NavView_ItemInvoked method a little bit. Like this:
private void NavView_ItemInvoked(muxc.NavigationView sender, muxc.NavigationViewItemInvokedEventArgs args)
{
if (args.IsSettingsInvoked)
{
ContentFrame.Navigate(typeof(TestPage));
}
else
{
// find NavigationViewItem with Content that equals InvokedItem
// this line of code is the problem.
//var item = sender.MenuItems.OfType<muxc.NavigationViewItem>().First(x => (string)x.Content == (string)args.InvokedItem);
// directly get the item
muxc.NavigationViewItem item = args.InvokedItemContainer as muxc.NavigationViewItem;
NavView_Navigate(item);
}
}
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.