title: C# WPF MVVM Window OnLoad Binding
body: <p>My Code behind looks like this...</p>
  
  <pre><code>public partial class MainWindow : Window
  {
      public MainWindow()
      {
          InitializeComponent();
          DataContext = new MainWindowViewModel();
      }
  }
  </code></pre>
  
  <p>My ViewModel looks like this...</p>
  
  <pre><code>class MainWindowViewModel : INotifyPropertyChanged
  {
      public MainWindowViewModel()
      {
          bool flag = Application.Current.MainWindow.IsInitialized;
  
          if (flag)
          {
              // Do something...
          }
  
      }
  </code></pre>
  
  <p>I guess my question is....Does this conform to the MVVM design pattern? The only other way to do this is <a href="https://stackoverflow.com/questions/3408069/how-to-fire-a-command-when-a-window-is-loaded-in-wpf">How to fire a Command when a window is loaded in wpf</a></p>
  
  <p>I don't know why, but I don't want to use mvvm-light or any other boilerplate code..</p>