page1.xamlとpage2.xamlの 2 つのページがあります。page1.xaml にボタンを 1 つ作成しました。そのクリック イベントで、page2.xamlに移動します。アプリケーションを実行すると失敗し、デバッガーによってApp.xaml.csにドロップされます。以下は私のコードです:
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));
}
}