Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,676 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I want to set a read-only property of the App class, so you have to do it in its ctor., as far a I know, when you call Process.Start(startInfo) to pass startInfo.AgumentList, you have these arguments available in the Application Startup event or when you override OnStartup, but I need them in Main(string[] args) like shown below, please can anybody help me?.
public partial class App : Application
{
public string Name { get; }
[STAThread] static void Main(string[] args)
{
var myApp = new App(args[0]);
myApp.Run()
}
public App(string name)
{
Name = name;
}
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
Window window = new MainWindow();
window.Show();
}
}
Main(string[] args) also gets startInfo.AgumentList when calling Process.Start(startInfo)