I am trying to create a WPF application that takes command line arguments. If no arguments are given, the main window should pop up. In cases of some specific command line a
You can use the below in app.xaml.cs
file :
private void Application_Startup(object sender, StartupEventArgs e)
{
MainWindow WindowToDisplay = new MainWindow();
if (e.Args.Length == 0)
{
WindowToDisplay.Show();
}
else
{
string FirstArgument = e.Args[0].ToString();
string SecondArgument = e.Args[1].ToString();
//your logic here
}
}