此代码中的“RootFrame =”行,所有这些都是自动生成的:
private void InitializePhoneApplication()
{
if (phoneApplicationInitialized)
return;
// Create the frame but don't set it as RootVisual yet; this allows the splash
// screen to remain active until the application is ready to render.
RootFrame = new PhoneApplicationFrame();
RootFrame.Navigated += CompleteInitializePhoneApplication;
// Handle navigation failures
RootFrame.NavigationFailed += RootFrame_NavigationFailed;
// Handle reset requests for clearing the backstack
RootFrame.Navigated += CheckForResetNavigation;
// Ensure we don't initialize again
phoneApplicationInitialized = true;
}
...失败:
*System.TypeInitializationException 未被用户代码处理 HResult=-2146233036 消息=“TaSLS_PhoneApp.App”的类型初始化程序引发了异常。Source=TaSLS_PhoneApp
TypeName=TaSLS_PhoneApp.App StackTrace:在 TaSLS_PhoneApp.App.set_RootFrame(PhoneApplicationFrame 值)在 TaSLS_PhoneApp.App.InitializePhoneApplication() 在 TaSLS_PhoneApp.App..ctor() InnerException: System.NotImplementedException HResult=-2147467263 消息=方法或操作未执行。Source=Windows StackTrace:在 Windows.Storage.ApplicationData.get_RoamingSettings() 在 TaSLS_PhoneApp.App..cctor() InnerException:*