898 questions
You can first open the Login Form (Login here) :
protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args)
{
m_window = new Login();
m_window.Activate();
}
and in Login Form you can display the Main window when it is closed on OK Button (if User/Password is OK) :
this.Closed += Login_Closed;
private Window m_window;
private void Login_Closed(object sender, WindowEventArgs args)
{
m_window = new MainWindow();
m_window.Activate();
}
Test :
T