有没有办法为 WPF 应用程序显示启动画面? [英] Is there a way to show a splash screen for WPF application?

查看:42
本文介绍了有没有办法为 WPF 应用程序显示启动画面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

欺骗:WPF 动画启动画面

我想为我的 WPF 应用程序显示启动画面.我想要做的是在从文件加载字典时显示它(加载大约需要 5-6 秒).有没有办法在 WPF 中实现这一目标?我会很感激一些教程,因为这比我发布的其他问题要复杂一些.

I would like to show a splash screen for my WPF application. what I want to do is to show it while I load dictionary from a file (it takes about 5-6 seconds to load). Is there a way to achieve this in WPF? I would appreciate some tutorial, since this is a little bit more complicated then other questions I posted.

推荐答案

参见 WPF 3.5 SP1:启动画面

或者在 VS2010 中点击 Solution ExplorerAdd ->New Item,从已安装模板列表中选择 WPFSplash Screen 应位于列表底部的中间.

Or within VS2010 click on the Solution Explorer do Add -> New Item, select WPF from the list of installed templates and Splash Screen should be on the bottom of the list in the middle.

注意:在构造函数之后和主窗口Window_Loaded回调之前/时,初始屏幕被移除.我将我所有的初始化都移到了主窗口构造函数中,这很好用,而且非常简单.

Note: The splash screen is removed after the constructor and before/when the main window Window_Loaded callback. I moved all of my initialisation into the main window constructor and it works a treat, and is very easy.

这篇关于有没有办法为 WPF 应用程序显示启动画面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆