2
嗨,我是一個新手,Windows Phone7也是如此。在這裏,我有透視控制作爲根,我試圖導航到另一個頁面使用服務的URI。在Windows Phone 7導航中的NullReferenceException
以下是一段代碼,其我使用從樞軸到導航到另一個視圖
然後我創建被叫的Page1.xaml
在我寫像代碼的mainpage.cs另一頁:
PivotItem p = new PivotItem();
p.Header = "Home";
p.Content = new page1();
main.Items.Add(p);
所以這裏樞應用有其作爲第1頁內容
我的問題是:如果 創建按鈕在頁面1中導航到稱爲page2的另一個頁面。
NavigationService.Navigate(new Uri("/Page2.xaml",UriKind.Relative));
但是當我嘗試導航,應用程式死機了,我得到了錯誤日誌如下 (從列表框中seleciton這個錯誤改)
System.NullReferenceException at activity name(Object Sender, SelectionChangedEventArgs e) at
System.Windows.Controls.Prmitive.Selector/OnSelctionChanged