Good afternoon!
I did this once in Xamarin.Android but can't make it work in Xamarin.Forms:
My first page (LoginServerView) consists of only an Entry where the user will type down the server he wants to access. Once the server is saved, he can click "Next" and go to a different page (LoginDataView) where his username and password will be asked. He can then log in and use the app.
The second time he uses the app however I want to check if the server has already been saved (I'm currently using Properties to keep the string in check). If the validation is true, then instead of opening LoginServerView again, I want to send the user directly to LoginDataView. When that happens, I also want to get rid of the back button and instead force the user to click on a ToolbarItem if he wants to change the server (Which shouldn't be needed once he's written it down first). However, if I force LoginDataView to load first, my Toolbaritems disappear and the BackButton appears, even though I set NavigationPage.HasNavigationBar="False"on xaml.
I tried to post images but it won't let me. If the explanation is confusing, I can't try again.
Below is my code for App:
public App()
{
InitializeComponent();
if (Current.Properties.ContainsKey("Servidor"))
{
MainPage = new NavigationPage(new LoginServerView(0)); //Tells the LoginServerView to immediatelly open LoginDataView
}
else
MainPage = new NavigationPage(new LoginServerView(1)); //Tells the LoginServerView to load and wait for User input
}
I don't understand what I'm doing wrong. Both processes go through the same methods so why am I getting a different output?
Thank you!