I'm using WindowsTemplateStudio, In ShellPage.xaml.cs, I want to detect if the user changed network, app navigate to a specified page.
So I used
Microsoft.Toolkit.Uwp.Connectivity.NetworkHelper.Instance.NetworkChanged += Instance_NetworkChanged;
private async void Instance_NetworkChanged(object sender, EventArgs e)
{
//NavigationService.Navigate(page);
shellFrame.Navigate(typeof(page));
}
But this caused System.Exception. How to handle this, and navigate to a page, thx.