Set start page in Windows Phone 8.1 universal app

て烟熏妆下的殇ゞ 提交于 2019-12-06 17:34:26

In App.xaml.cs look for

protected override void OnLaunched(LaunchActivatedEventArgs e)
{
    // ...

    // launch codes
    // insert here

    // Ensure the current window is active
    Window.Current.Activate();
}

My launch code detects to see if they're on the Phone or not, so I have a starting page that is different for each platform

#if WINDOWS_PHONE_APP
    if (!rootFrame.Navigate(typeof(PhonePage), e.Arguments))
    {
        throw new Exception("Failed to create initial page");
    }
#endif
#if WINDOWS_APP
    if (!rootFrame.Navigate(typeof(DesktopPage), e.Arguments))
    {
        throw new Exception("Failed to create initial page");
    }       
#endif
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!