Change default startup page for windows phone 8.1 app

前端 未结 1 499
陌清茗
陌清茗 2021-02-14 21:44

I created a new Basic Page called PivotPage.xaml in the Windows Phone 8.1 project of the universal app solution. When I go to App.xaml under the Shared partitio

1条回答
  •  遇见更好的自我
    2021-02-14 22:08

    Try this

    WP 8.1 Universal Project

    -> Add New Item -> Blank Page
    -> Name it MyPivotPage.xaml


    MyPivotPage.xaml

    
    
        
            
                
                
                    
                
    
                
                
                    
                
            
        
    
    

    Change "YOUR_NAMESPACE" to your namespace :)

    Then in App.xaml.cs

    #if WINDOWS_PHONE_APP
    if (!rootFrame.Navigate(typeof(MyPivotPage), e.Arguments))
    {
        throw new Exception("Failed to create initial page");
    }
    #endif
    #if WINDOWS_APP
    if (!rootFrame.Navigate(typeof(MainPage), e.Arguments))
    {
        throw new Exception("Failed to create initial page");
    }       
    #endif
    

    Clean your solution
    Set your WP 8.1 Universal as your default startup project
    Deploy to your device

    0 讨论(0)
提交回复
热议问题