Currently I am creating a basic log-in UI. I have a Login window/screen and main window.
The main window has few buttons and one of them is to switch to the login window. Same with the log-in window, it has a button in order to go back to the main.
I am trying to switch between the windows but for some reason it only switches once meaning if the user starts at main, can go to log-in but can't change back and the other way around.
I have tried to add another window and check if it has something to do with going back to where I came from but its not related.
here is the c# code (if wpf needed let me know) -
Main Window :
private void LoginNav_Click(object sender, RoutedEventArgs e)
{
//Switching the current window content to the login window
this.Content = new LoginScreen().Content;
}
Log-in window:
private void BackButton_Click(object sender, RoutedEventArgs e)
{
// Switching current to Main window
this.Content = new MainWindow().Content;
}
When debugging it goes into the function "performs" it but nothing changes.
Anybody got an idea how to fix it? (or a more efficient way to do that)
Thanks in advance