opening a list item (on sample main page)

Hi,

I have a master-detail form created.

When I launch up, I want it to go to login (within the menu). The problem is, it goes straight to the menu page (maybe because it is at the top of the list?). Is there anyway I can get it to go to the login page (within the main menu) on launch? I can't change the startup page because it messes up the menu functionality.

Thank you all in advance

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited August 14

    Create a bool property in App.cs and check the value in the itemsPage. Detect if the user has logged in before loading the itemsPage. If not, navigation to login_page.

    public ItemsPage()
    {
        if (App.Is_Login == false)
        {
            Navigation.PushAsync(new Page1());
        }
    
        InitializeComponent();
    }
    
    public partial class App : Application
    {
        public static bool Is_Login;
        public App()
        {
            InitializeComponent();
    
            DependencyService.Register<MockDataStore>();
            MainPage = new MainPage();
        }
    }
    
Sign In or Register to comment.