title: What is the last event to fire when loading a new WPF/C# window?
body: <p>I am trying to load a preferences window for my application and I would like the apply button to initially be disabled, then when a preference is updated, the apply button gets enabled again.  I have some controls data bound to a preferences object and what happens is that <strong>after</strong> the window loads, the combobox events get triggered.  Is there any event that is guaranteed to happen dead last after everything is stable?</p>
  
  <p>Here is what my code looks like (the apply button is always enabled after the window loads):</p>
  
  <pre><code>private void Window_Loaded(object sender, RoutedEventArgs e)
  {
      _preferencesData = new PreferencesDataContext();
      LayoutRoot.DataContext = _preferencesData;
      ButtonApply.IsEnabled = false;
  }
  
  private void ComboBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
  {
      ButtonApply.IsEnabled = true;
  }
  </code></pre>
  
  <p>Is it also interesting to note that this only happens with textboxes and comboboxes, not checkboxes or radiobuttons.</p>