DevExpress WPF入门指南:如何自动或手动添加DXSplashScreen控件
《DevExpress v17.2 版本更新公开课》点击报名
DevExpress WPF 的 DXSplashScreen 控件在应用加载的时候显示一个启动界面。添加DXSplashScreen后,会默认生成一个XAML文件,当然,你也可以根据自己的需求自定义XAML文件。
添加DXSplashScreen到项目中
1.右键单击 Solution Explorer 中的项目,并选择 Add DevExpress Item | New Item..

2.在弹出的 DevExpress Template Gallery 中单击 DXSplashScreen 项目。

添加DXSplashScreen后,会生成一个XAML文件。如果想自定义加载界面,修改XAML文件即可。
如何自动调用DXSplashScreen
DXSplashScreen可以在窗口加载时自动调用,然后在窗口初始化完毕后自动关闭,要实现这个功能,只需要在主窗口的XAML文件添加如下代码:
dxc:DXSplashScreen.SplashScreenType="{x:Type local:SplashScreenWindow1}"
dxc 和 local声明如下:
xmlns:local="clr-namespace:WpfApplication7"
xmlns:dxc="http://schemas.devexpress.com/winfx/2008/xaml/core"
但是这样做有个缺陷就是无法控制进度条的进程,要控制进程,就要用另一种方式:手动调用DXSplashScreen。
如何手动调用DXSplashScreen
你也可以手动控制合适显示和隐藏DXSplashScreen控件,这要通过DXSplashScreen类的一个静态方法来实现。
举个例子,下面的代码打开看一个应用程序的加载界面:
下面的代码关闭加载界面:
using DevExpress.Xpf.Core;
namespace WpfApplication7 {
public partial class MainWindow : Window {
public MainWindow() {
InitializeComponent();
this.Loaded += new RoutedEventHandler(MainWindow_Loaded);
}
void MainWindow_Loaded(object sender, RoutedEventArgs e) {
DXSplashScreen.Close();
this.Activate();
}
}
}
默认情况下,DXSplashScreen包含一个进度条,表示应用程序加载的进度,下面的代码就可以实现手动控制进度:
// Developer Express Code Central Example:
// How to manually invoke and close DXSplashScreen
//
// This example shows how to manually invoke and close DXSplashScreen. By default,
// DXSplashScreen contains a progress bar, indicating the progress of the
// application load. This example also shows how you can manually change the
// progress in code.
//
// You can find sample updates and versions for different programming languages here:
// http://www.devexpress.com/example=E3243 using DevExpress.Xpf.Core;
using System.Windows; namespace DXSplashScreenSample {
public partial class App : Application {
protected override void OnStartup(StartupEventArgs e) {
base.OnStartup(e);
DXSplashScreen.Show<SplashScreenView>();
}
}
}
===============================================================
DevExpress v17.2发布,更多精彩预告请持续关注DevExpress中文网!
扫描关注DevExpress中文网微信公众号,及时获取最新动态及最新资讯

DevExpress WPF入门指南:如何自动或手动添加DXSplashScreen控件的更多相关文章
- DevExpress WPF入门指南:跟随 Items Source 向导完成数据绑定
Items Source Wizard Items Source Configuration Wizard允许在设计时执行数据绑定.跟随这个向导可以自动生成XAML数据绑定代码. 下面就来展示下如何使 ...
- DevExpress WPF入门指南:DXWindow应用
[DevExpress v17.2 版本更新公开课]点击免费报名 DevExpress WPF Window control有一点非常棒,就是可以和其他视觉主题保持统一性.DXWindow class ...
- DevExpress WPF入门指南:加载动画的应用
LoadingDecorator是一个容器控件用于显示 long-loading 的内容.内容还没加载完成的时候会显示一个加载指示器,加载完成后指示器消失,如下图所示: 开启LoadingDecora ...
- DevExpress WPF v19.1新版亮点:PDF Viewer等控件新功能
行业领先的.NET界面控件DevExpress 日前正式发布v19.1版本,本站将以连载的形式介绍各版本新增内容.在本系列文章中将为大家介绍DevExpress WPF v19.1中新增的一些控件及部 ...
- DevExpress WPF v19.1:Data Grid/Tree List等控件功能增强
行业领先的.NET界面控件DevExpress 日前正式发布v19.1版本,本站将以连载的形式介绍各版本新增内容.在本系列文章中将为大家介绍DevExpress WPF v19.1中新增的一些控件及部 ...
- DevExpress WPF v19.1新版亮点:Data Editors等控件新功能
行业领先的.NET界面控件DevExpress 日前正式发布v19.1版本,本站将以连载的形式介绍各版本新增内容.在本系列文章中将为大家介绍DevExpress WPFv19.1中新增的一些控件及部分 ...
- DevExpress WPF入门指南:绑定编辑器对话框
绑定编辑器对话框 每个Smart Tag属性既可以设置也可以绑定.如下图所示,点击绑定按钮打开绑定对话框: 如果属性已经绑定,binging按钮会显示为黄色,绑定的文本会显示在相应的属性行. 绑定So ...
- DevExpress WPF入门指南:Smart Tag扩展功能
Smart Tag提供了一些扩展功能用于简化指定某些属性的程序,比如下面这几项: Application Theme Data Context Image Gallery Convert to DXW ...
- 【翻译转载】【官方教程】Asp.Net MVC4入门指南(2):添加一个控制器
2. 添加一个控制器 · 原文地址:http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-c ...
随机推荐
- HDU1556 Color the ball(差分数组)题解
Color the ball Time Limit: 9000/3000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) T ...
- Ubuntu 12.04 安装JDK
为了在Ubuntu上安装好eclipse,按照步骤先进行JDK的安装. (1) 新建java文件夹 命令行操作: (2) 下载解压JDK安装包后无法移动文件夹至File System 移动时提示:Pe ...
- HDU 1711 Number Sequence(KMP模板)
http://acm.hdu.edu.cn/showproblem.php?pid=1711 这道题就是一个KMP模板. #include<iostream> #include<cs ...
- 告诉你什么是javascript的回调函数
函数也是对象 想弄明白回调函数,首先的清楚地明白函数的规则.在javascript中,函数是比较奇怪的,但它确确实实是对象.确切地说,函数是用Function()构造函数创建的Function对象.F ...
- Python -- Scrapy 命令行工具(command line tools)
结合scrapy 官方文档,进行学习,并整理了部分自己学习实践的内容 Scrapy是通过 scrapy 命令行工具进行控制的. 这里我们称之为 “Scrapy tool” 以用来和子命令进行区分. 对 ...
- charles的破解方法
http://blog.csdn.net/tech4j/article/details/53509329 mac下的charles遇到的问题. http://blog.csdn.net/songzhu ...
- Eclipse 打包Web项目
使用插件fatjar Fat jar插件 http://kurucz-grafika.de/fatjar eclipse菜单栏 help->install new software...-> ...
- php程序突然不能用file_get_contents()访问远程网址了?
php程序用file_get_contents("http://www.***.com"),一直以来好好的,突然间就不能链接远程网址了,在shell下可以ping通远程网址,可是用 ...
- 44 CSS 浮动 模态框 定位
一.浮动 float : 浮动的盒子不占原来的位置,其下方的盒子会上移 父盒子会发生塌陷现象.同一级盒子right浮动,同级左边的盒子需要左浮动,right浮动的盒子才能上来 由于浮动框不在文档的普通 ...
- 『PyTorch』第十一弹_torch.optim优化器
一.简化前馈网络LeNet import torch as t class LeNet(t.nn.Module): def __init__(self): super(LeNet, self).__i ...