How do I use a window as splash screen in WPF?

让人想犯罪 __ 提交于 2019-12-11 08:27:09

问题


I would like to use a regular window for splash screen, so no PNG splash screen but a normal window where I can add some bitmaps on.

What is the best way: to keep in app.xaml the loading of the main screen and put the splash screen in the constructor or somewhere in an event handler?

The splash scren itself is quite easy, just has some labels, a link, a few images and just waits a few seconds before closing, no actions to be done while waiting.


回答1:


Specifically for a splash screen, it is very important to make use of the functionality introduced in .NET 3.5 for this purpose. If you simply use a vanilla Window it can take quite some time for the WPF stack to initialize, and in the interim the user will not be seeing any feedback for their "launch the app" action.

Of course this does not satisfy the requirements of the question ("use a regular window"), but if it's not acceptable I would recommend using an different technology than WPF entirely because of the problem mentioned above.




回答2:


I have myself designed my WPF app dynamic splash screen in which there was an animation, dynamic software Number which changed for each and every software, a label which was updated every 1/2 ms to show some random filename in the sofware directory.

To be frank i used this link to create mine

http://www.codeproject.com/Articles/38291/Implement-Splash-Screen-with-WPF

There are other links which i can provide you

http://www.codeproject.com/Articles/116875/WPF-Loading-Splash-Screen http://www.olsonsoft.com/blogs/stefanolson/post/A-better-WPF-splash-screen.aspx



来源:https://stackoverflow.com/questions/10497395/how-do-i-use-a-window-as-splash-screen-in-wpf

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!