WPF SplashScreen , how to make splashscreen showing longer

后端 未结 4 1819
梦如初夏
梦如初夏 2021-01-22 09:38

I found only one way to make splash display time longer.

That is changing ApplicationDefinition to Page and configuration it\'s time.

But I need ApplicationDefin

4条回答
  •  情书的邮戳
    2021-01-22 10:00

    Another approach is to find the App.g.cs file and its Main():

           public static void Main() {
                SplashScreen splashScreen = new SplashScreen("splash.jpg");
                splashScreen.Show(true);
                Thread.Sleep(3000);           
                someNameSpace.App app = new someNameSpace.App();
                app.Run();
           }
    

    Where the only newly added field is Thread.Sleep(3000);, which will delay the showing of the splash screen by 3 seconds.

提交回复
热议问题