title: Change Main in WPF project
body: <p>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:</p>
  
  <p>I have provided this main method:</p>
  
  <pre><code>[System.STAThreadAttribute()]
  [System.Diagnostics.DebuggerNonUserCodeAttribute()]
  public static void Main()
  {
      Model model= new Model();
      Controller controller = new Controller(model);
      MainWindow window = new MainWindow(controller, model);
  }
  </code></pre>
  
  <p>This method is run, but I cant see anything visual.
  I think I miss something from the following normal main code:</p>
  
  <pre><code>Application.App app = new Application.App();
  app.InitializeComponent();
  app.Run();
  </code></pre>
  
  <p>I have tried overriding OnStartUp witht the same code, but that throws an exception.
  If you have other solutions I am willing to hear. I just can't see why my MainWindow has to be created first.</p>