in my wpf application, I want to show the login form and if the user enters the correct username and password, window1 will be displayed. i user this code in my app.xmal:
<Application x:Class="Acountant.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Startup="Application_Startup">
and this code in app.xmal.cs:
private void Application_Startup(object sender, StartupEventArgs e) { LoginFRM f = new LoginFRM(); if (f.ShowDialog() == true) { var frm = new Window1(); frm.ShowDialog(); } }
but my application is closed!
source share