private void ListViewMenu_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (PageContentFrame.Content == null && ListViewMenu.SelectedIndex != 0) { return; } if (ListViewMenu.SelectedItem is MenuItemSeparator) { if (selectedEntry != null) { ListViewMenu.SelectedItem = selectedEntry; } } else { var entry = ListViewMenu.SelectedItem as MenuEntry; if (entry != null && entry != selectedEntry) { selectedEntry = entry; if (string.IsNullOrEmpty(entry.EventName) == false) { EngagementAgent.Instance.SendEvent(entry.EventName); } if (SplitViewModeStateGroup.CurrentState == NarrowState) { SplitView.IsPaneOpen = false; } PageContentFrame.Navigate(entry.TargetPage, PageContentFrame); } } }
public void NavigateToCustom(Type type) { PageContentFrame.Navigate(type); selectedEntry = viewModel?.MenuEntries?.Where(e => e is MenuEntry).FirstOrDefault(e => type.Equals(((MenuEntry)e).TargetPage)) as MenuEntry; }