.net – Xamarin Forms – Navigate to another page

.net – Xamarin Forms – Navigate to another page

You just need hide the Navigationbar in your LoginPage and MainPage.

public App()
{
    InitializeComponent();
    
    if (!isUserLoggedIn)
    {
        MainPage =  new NavigationPage(new LoginPage());
    }
    else
    {
        MainPage = new NavigationPage(MainPage());
    }
}

LoginPage.xaml.cs:

public LoginPage()
    {
        InitializeComponent();
        NavigationPage.SetHasNavigationBar(this, false);
    }

//When user authenticated
App.Current.MainPage = new NavigationPage(MainPage());

MainPage.xaml.cs:

public MainPage()
    {
        InitializeComponent();
        NavigationPage.SetHasNavigationBar(this, false);
    }

.net – Xamarin Forms – Navigate to another page

Leave a Reply

Your email address will not be published.