override OnStartup in WPF
问题 For some reason I can't get this to work at all. I have read from various sources that I can override OnStartup in a WPF application and it will fire off as the App is created. However, no matter what I do, nothing is happening. Here is the code. public partial class App : Application { protected override void OnStartup(StartupEventArgs e) { // My code goes here, but nothing ever happens. base.OnStartup(e); } } Obviously I am missing something. Sadly the MSDN page doesn't offer much insight