I see that many people use "base.OnStartup(e)" inside of App.xaml.cs like this:
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
MainWindow app = new MainWindow();
app.Show();
}
Is there a need for it? What is the purpose for it?
It allows any base class logic to run; just like any other usage of base.
Its probably not strictly necessary; but calling a base class's implementation when overriding virtual methods is considered a best practice (unless you actively want to suppress the base behavior).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With