title: WPF app with Ninject
body: <p>I'm lost with Ninject in WPF. </p>
  
  <p>I'm initializing it in App.xaml but the ITest property in MainWindow.xaml (even with the InjectAttribute) is not getting resolved and remains null.</p>
  
  <pre><code>public partial class App : Application
  {
      protected override void OnStartup(StartupEventArgs e)
      {    
          IKernel kernel = new StandardKernel();
          kernel.Bind&lt;ITest, Test&gt;();
          base.OnStartup(e);
      }
  }
  </code></pre>
  
  <p>I googled a bit and found out that it doesn't work that way. In trying to find a solution, I ended up with creating IMainWindow with nothing else but "void Show();" and adding it to the MainWindow.</p>
  
  <pre><code>public partial class App : Application
  {
      protected override void OnStartup(StartupEventArgs e)
      {    
          IKernel kernel = new StandardKernel();
          kernel.Bind&lt;ITest, Test&gt;();
  
          kernel.Bind&lt;IMainWindow, MySolution.MainWindow&gt;();
          kernel.Get&lt;IMainWindow&gt;().Show();
  
          base.OnStartup(e);
      }
  }
  </code></pre>
  
  <p>For this, I'm getting a NullReferenceException on the line with .Get</p>
  
  <p>I also tried this:</p>
  
  <pre><code>public partial class App : Application
  {
      protected override void OnStartup(StartupEventArgs e)
      {    
          IKernel kernel = new StandardKernel();
          kernel.Bind&lt;ITest, Test&gt;();
  
          MainWindow = new MySolution.MainWindow(kernel);
          //then kernel.Inject(this); in the MainWindow constructor 
          MainWindow.Show();
  
          base.OnStartup(e);
      }
  }
  </code></pre>
  
  <p>Now I'm getting a NullReferenceException at the .Inject line in the MainWindow.</p>
  
  <p>I found another various solutions but they seemed heavyweight and I gave up testing all of them and trying which one works.</p>
  
  <p>Any help please?</p>