2013-05-13 46 views
0

我試圖在代碼改變根框架背後:WP8根幀變化

// Do not add any additional code to this method 
    private void CompleteInitializePhoneApplication(object sender, NavigationEventArgs e) 
    { 
     // Set the root visual to allow the application to render 
     if (RootVisual != RootFrame) 
     { 
      RootVisual = RootFrame; // here or somewhere before ...    
     } 

...我需要改變根幀(但沒有在明顯)。 有沒有人有任何想法?答案或提示,非常感謝。

+0

爲什麼要更改RootFrame? – 2013-05-13 15:08:41

+0

您是否收到錯誤? – lhan 2013-05-13 16:13:41

+0

好的。我在清單中有一個起始頁面......沒錯,但在首次啓動應用程序後,我需要設置其他頁面,如起始頁面 – 2013-05-13 16:29:46

回答

1

當應用程序剛初始化時,您可以使用另一個框架。只需修改InitializePhoneApplication()方法App.xaml.cs

private void InitializePhoneApplication() 
{ 
    if (phoneApplicationInitialized) 
     return; 

    // Instead of creating a PhoneApplicationFrame, use your own 
    RootFrame = new YourSuperCoolFrame(); 
    RootFrame.Navigated += CompleteInitializePhoneApplication; 

    ... // rest of the original code 
}