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?