0

When I click, the second page is loaded, but the application crashes with System.NullReferenceException:

private async void Forecast_Click(object sender, RoutedEventArgs e)
{
    await
    CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
            CoreDispatcherPriority.Normal,
            () => {
                Frame.Navigate(typeof(Forecast), null);
            }
    );
}
Emmet
  • 6,192
  • 26
  • 39

1 Answers1

0

A NullReferenceException occurs when trying to access a member of an object which is null.

This is likely happening within your code. Reproduce the error while running your application in Debug mode, and view the call stack/current point of execution when you encounter the exception. It should then be clear to you in which statement your code is trying to access a member of a null object.

Jeremy
  • 714
  • 4
  • 13