ModernWpf
ModernWpf copied to clipboard
NavigationView event not thrown
Hi,
I'm fight with a NavigationView, maybe I forget something...
So I have create a NavigationView, but I'm not able to get something with ItemInvoked or SelectionChanged.
Code used :
<ui:NavigationView x:Name="NavView" Grid.Row="1"
Loaded="NavView_Loaded"
ItemInvoked="NavView_ItemInvoked"
SelectionChanged="NavView_SelectionChanged"
IsBackButtonVisible="Collapsed"
PaneDisplayMode="Left"
IsPaneOpen="False"
OpenPaneLength="140"
IsTabStop="True">
<ui:NavigationView.MenuItems>
<ui:NavigationViewItem Tag="home"
Content="Accueil">
<ui:NavigationViewItem.Icon >
<ui:FontIcon FontFamily="Segoe MDL2 Assets" Glyph=""/>
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItemSeparator/>
<ui:NavigationViewItem Tag="search"
Content="Recherche">
<ui:NavigationViewItem.Icon >
<ui:FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ui:NavigationViewItem Tag="create"
Content="Créer">
<ui:NavigationViewItem.Icon >
<ui:FontIcon FontFamily="Segoe MDL2 Assets" Glyph="" />
</ui:NavigationViewItem.Icon>
</ui:NavigationViewItem>
<ScrollViewer Grid.Row=" 1">
<ui:Frame x:Name="ContentFrame"
Grid.Row="1"
Padding="12,0,12,24"
IsTabStop="False"
NavigationFailed="ContentFrame_NavigationFailed">
</ui:Frame>
</ScrollViewer>
</ui:NavigationView>
Then I use this :
private void NavView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args)
{
Debug.Print("NavView SelectionChanged");
}
private void NavView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
{
Debug.Print("NavView ItemInvoked");
}
But the event is never thrown when I click on the different NavigationViewItem
Can you help me ?
Thanks
Same here, can't trigger ItemInvoked event nor SelectionChanged event without C# code manual trigs.
I set MouseLeftUp event on every NavViewItem to bypass this issue.
I can't seem to reproduce this issue; both events fire using the provided code. Could you please share a repro project?