I’m currently trying to learn WPF, and am writing a simple application to test some concepts which I’ve learned.
Basically once my application is run, a window is to be presented, acting as a login screen. Once the user enters his details and pressed the login button, the window is to be closed and a new one is to be opened.
What would be the best approach for this? I recall having a number of problems doing something similar with WinForms, especially with window closing and disposing.
How can this be done?
One approach is to have the “new one” be the main window of the app. Then in code behind for the “new one”‘s constructor you could show the login window. if login succeeds then newOne launches. If it fails then the app quits.