The global variable doesnt show up after login is successful, however it shows up when i refresh the page.
(Class)
public static class Login_information
{
public static int Global_login_id;
public static string User_Firstname ;
public static string User_Lastname;
}
(Loginpage)
private void Button_Pressed(object sender, EventArgs e)
{
if (Password_input.Text == item.Password)
{
DisplayAlert("Login success", "Successfull login", "OK");
Navigation.PushModalAsync(new NavigationBarPage());
Login_information.Global_login_id = item.Id;
Login_information.User_Firstname = item.FirstName;
Login_information.User_Lastname = item.LastName;
}
}
(Profilepage)
public ProfilePage()
{
InitializeComponent();
Update();
Login_name.Text = Login_information.User_Firstname + " " + Login_information.User_Lastname;
}