WPF SplashScreen , how to make splashscreen showing longer

后端 未结 4 1770
梦如初夏
梦如初夏 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:11

    You can use, as Jake Glines wrote, System.Threading

    using System.Threading;
    
    public MainWindow()
    {           
      SplashScreen splash = new SplashScreen("splash.jpg");
      splash.Show(true);
      Thread.Sleep(1500);           
      InitializeComponent();
    }
    

    Or you can use timer/progressbar on it, and make it depend on real loading, not just imaginary.

提交回复
热议问题