Changing NavigationView.MenuItemsSource crashes

0

I need to change the NavigationView menu depending on the page I navigate to.

<ux:NavigationView x:Name="NavView" MenuItemsSource="{x:Bind MainMenu, Mode=OneWay}">

MainMenu is a dependency property of type List<ux.NavigationViewItemBase>. Everything is still fine when I fill it in my constructor:

MainMenu = GetMenuItems().ToList();

But when I try to change it later:

ContentFrame.Navigate(item.PageType, null, transitionInfo);
MainMenu = GetMenuItems().ToList();

my app crashes with 0xC0000005: Access violation reading location 0x00000000. in NavigationView.cpp at line 924.

Is it completely forbidden to change the menu items later or did I hit another problem somehow?

uwp-xaml
asked on Stack Overflow Dec 1, 2020 by Gábor

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0