1
page2.xaml我有兩個頁面:的Page1.xaml和page2.xaml。我在page1.xaml上創建了一個按鈕;在其點擊事件中,我導航到page2.xaml。當我運行該應用程序時,它失敗,調試器將我放入App.xaml.cs。下面是我的代碼:導航要在Windows Phone 8
private void RootFrame_NavigationFailed(object sender, NavigationFailedEventArgs e)
{
if (Debugger.IsAttached)
{
// A navigation has failed; break into the debugger
Debugger.Break();
}
}
我page1.xaml.cs後面的代碼是:
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
// Sample code to localize the ApplicationBar
//BuildLocalizedApplicationBar();
}
private void btnDownloded_Click(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/DownloadedBooksPortrait.xaml", UriKind.Relative));
}
}
首先檢查你的..私人無效RootFrame_NavigationFailed(對象發件人,NavigationFailedEventArgs E) { 如果(Debugger.IsAttached) { //一種導航已失敗發送者指針通過放異常的類型;闖入調試器 Debugger.Break(); } } 當你得到這個錯誤..comment以下關於錯誤..並確保你的xaml代碼是正確的.. – loop