WP8根框架更改

时间:2013-05-13 14:29:25

标签: c# windows-phone-8

我试图改变代码背后的根框架:

    // 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 ...               
        }

...我需要更改根框架(但清单中没有)。 有谁有任何想法?答案或提示非常感谢。

1 个答案:

答案 0 :(得分:1)

当app刚刚初始化时,您可以使用另一个框架。只需修改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
}