Hi, i have a WPF Application with a LoginWindow to access,so i create a Splash Screen for this Login window as follow :
- in App.xaml
< Application x:Class="WPF.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Startup="Application_Startup"
/>
-in App.xaml.cs:
private void Application_Startup(object sender, StartupEventArgs e)
{
Login login = new Login();
login.Show();
}
-and in Login.xaml.cs if the log in is succesful :
PrimaryWindow mainWindow= new PrimaryWindow ();
Application.Current.MainWindow = mainWindow;
this.Close();
mainWindow.Show();
.This code is right but sincerely with my poor knowledge i don't know that's a good method to apply for a Login Window or not and i don't know if this method can be "dangerous" for my application that store data from a database and has many features , so i ask you if my way is good or not and if you have a better way can you suggest or show me that?
Thanks for your attention.
Have a lucky day.