在App.Xaml.cs
更改起始頁:
private void Application_Launching(object sender, LaunchingEventArgs e)
{
Uri nUri = new Uri("/SecondPage.xaml", UriKind.Relative);
((App)Application.Current).RootFrame.Navigate(nUri);
}
在Property\WMAppManifest.xml
文件中設置靜態啓動頁面
<DefaultTask Name ="_default" NavigationPage="SecondPage.xaml"/>
編輯
試試:
private void Application_Launching(object sender, LaunchingEventArgs e)
{
Uri nUri = new Uri("/GamePage.xaml", UriKind.Relative);
RootFrame.Navigate(nUri);
}
和Property\WMAppManifest.xml
明確NavigationPage:
<DefaultTask Name ="_default" NavigationPage=""/>
嗨@nirmus。 ((App)Application.Current中有錯誤).Root..'。它說'MyApplication.App.RootFrame.Get'不能用實例引用訪問。使用類型名稱代替 – user2799350
它必須工作。發佈你的代碼,也許你做了一些其他的錯誤 – nirmus
我只是複製/粘貼你的代碼到應用程序啓動。當我寫'((App)Application.Current)「時,'RootFrame'不會出現在intellisense中。 – user2799350