I have 2 pages: 1.MainPage.xaml - authorization window 2.Page2.xaml - page where the user gets after successfully passing authorization to MainPage.xaml There is a local SQLite database where information about the users of the application is stored who was last logged in There is get_user_auth () - returns the ID of the last user authorized. There is a method that, if there is an authorized user, goes from the page MainPage to Page2

void auto_auth() { int globaluserid = MS.get_user_auth(); if (globaluserid > 0) { Frame.Navigate(typeof(Page2), globaluserid); } } 

QUESTION:

How to make the application run the page Page2 instead of the start page MainPage provided MS.get_user_auth ()> 0?

    2 answers 2

    I solved my problem as follows

     public MainPage() { this.InitializeComponent(); this.NavigationCacheMode = NavigationCacheMode.Required; this.Loaded += (a, b) => { auto_auth(); }; } 

      If you are doing Windows Phone 8.0, then the start page is always MainPage.xaml. If you are doing for Windows Phone 8.1, then in the file App.xaml.cs you can change to install any start page.