2016-03-16 21 views
0

當我點擊,第二頁被加載,但該應用程序崩潰與System.NullReferenceException:試圖訪問一個對象,它是null的成員時,會發生應用崩潰時我導航到另一幀

private async void Forecast_Click(object sender, RoutedEventArgs e) 
{ 
    await 
    CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(
      CoreDispatcherPriority.Normal, 
      () => { 
       Frame.Navigate(typeof(Forecast), null); 
      } 
    ); 
} 
+1

可能的重複http://stackoverflow.com/questions/4660142/what-is-a-nullreferenceexception-and-how-do-i-fix-it –

回答

0

NullReferenceException

這可能發生在您的代碼中。在Debug模式下運行應用程序時重現錯誤,並在遇到異常時查看調用堆棧/當前執行點。那麼你應該清楚你的代碼在哪個語句中嘗試訪問一個對象的成員。

相關問題