Always annoyed me how C# wants to do the startup for you. So now I am trying to make my own main method. It\'s not working:
I have provided this main method:
You're right: you need to instantiate an Application and call Run on it. (You'd do this in Main.) To make it show your window when it runs, there are three options:
MainWindow w = ...; new MyApp().Run(w);
myApp.StartupUri = new Uri(...); myApp.Run();
myApp.Startup += (...) => new MainWindow().Show();
Examples of manual startup code are shown in MSDN under the Application.Run() and Application.Run(Window) entries - these should get you started! The Run() overload also discusses why Application.Run is needed and what it does e.g. starting the dispatcher loop.