My app’s main UI is in MainWindow.xaml.
Firstly – what is causing this to be the window the application opens on startup. It does not appear to be defined as a “starup object” and there does not appear to be any code that specifically launches this window.
I can make my login window appear when the app starts by in the loaded event of MainWindow.xaml defining a new “login.xaml” and telling it to show as a dialog. However, if I do this then MainWindow does not appear until Login has been closed.
What I want to achieve is when my app starts, the MainWindow appears and then on top of that the Login window is displayed modally.
How can this be done?
The startup of the
MainWindowis defined inApp.xamlby default when creating a project in VS:Creating the dialogue in the
Loadedevent should work, just don’t do it in the constructor where it is not yet loaded.