I have a need to trigger a NavigationView.SelectionChanged event in code (C++) to take the user to a specific page that I already done in XAml. The Navigation for my app works just fine. I have several pages available on a Top nav bar, including Settings. Here is a pic.
Here is the view of Settings nav bar.
During start up, I check a dB to see if Factory Settings are present. If not, I want to take the user to that page. This happens on the main Page where I am showing a modal message box that they need to set Factory settings.
I followed the example from MS of how to code a complete Navigation for my UWP app, what I don't know how to do is make the navigation event happen.
Here are the functions I implemented for both the Main Page and Settings page. I can show my code, but it is working. Remember this an event I am trying to fire in code.
void ContentFrame_NavigationFailed(IInspectable const& sender, NavigationFailedEventArgs const& args); void NavView_Loaded(IInspectable const& sender, RoutedEventArgs const& args); void NavView_SelectionChanged(IInspectable const& sender, NavigationViewSelectionChangedEventArgs const& args); void NavView_Navigate(wstring navItemTag, NavigationTransitionInfo const& transitionInfo); void NavView_BackRequested(NavigationView const& sender, NavigationViewBackRequestedEventArgs const& args); void CoreDispatcher_AcceleratorKeyActivated(CoreDispatcher const& sender, AcceleratorKeyEventArgs const& args); void CoreWindow_PointerPressed(CoreWindow const& sender, PointerEventArgs const& args); void System_BackRequested(IInspectable const& sender, BackRequestedEventArgs const& args); bool TryGoBack(void); void On_Navigated(IInspectable const& sender, NavigationEventArgs const& args);
Thank you for your help.