WPF Disable Splash Screen Programmatically -
i have wpf application optionally accepts command line parameters. 1 of these parameters specifies "silent mode" (no ui). how can disable presentation of splash screen @ startup based on parameter?
you should explicitly create instance of class splashscreen, , show/hide based on program arguments, instead of using splashscreen build action generate splash screen.
you need set build action of splash screen image resource instead of splashscreen.
for example:
private void onstartup(object sender, startupeventargs e) { if (showsplashscreenargument) { splashscreen splashscreen = new splashscreen("yoursplashscreen.bmp"); splashscreen.show(); } // loading code here.. mainwindow mainwindow = new mainwindow(); if (showsplashscreenargument) { // close splash.. splashscreen.close(); } mainwindow.show(); }