Reputation: 2261
I create aplication with Master Detail Page. I am trying do loginPage. When i run app it create master detail page and go to login page. I head read this is one way to add loginPage to Master Detail Page. But i dont know how to block possibilyty back to Master Detail Page.
This is how it looks in Master Detail Page
public MainPage()
{
InitializeComponent();
Navigation.PushAsync(new LoginPage());
}
public MainPage(string login)
{
userLogin = login;
InitializeComponent();
}
Is this a good way to create login page in my app?
Upvotes: 1
Views: 59
Reputation: 18861
There are two possible ways to implement it.
You can block the back button of your login page .
in your login page:
public LoginPage()
{
InitializeComponent();
//...
NavigationPage.SetHasBackButton(this, false);
}
I suggest that you can firstly set the MainPage
of App as your login page , and change it to the MasterDetailPage
after login .
//login finished
App.Current.MainPage = new MainPage();
Upvotes: 3