Search This Blog

Wednesday, May 1, 2013

Splash Screen - Easy Way

I wanted to let you know about another small usability improvement, which may come in handy for your new XAF apps. This is about displaying custom splash forms in your WinForms application. As you probably know, currently you need to provide your own ISplash interface implementation for that purpose. This is not very difficult, but it could be easier, because there is a ready-to-use component in our WinForms suite that may help you.

Let me quote myself from the Support Center thread to describe the aforementioned improvement further:

"Starting with version 13.1, I have made it easier to use the splash forms powered by the SplashScreenManager component from our XtraEditors library.
Now, you can create a custom splash form via the built-in 'DXperience v1X.X Splash Screen' or 'DXperience v1X.X Loading Panel' item templates and then tell XAF to use it by configuring your WinApplication descendant as follows:

[C#]FeatureCenterWindowsFormsApplication xafApplication = new FeatureCenterWindowsFormsApplication(); xafApplication.SplashScreen = new DevExpress.ExpressApp.Win.Utils.DXSplashScreen(typeof(SplashScreen1));

Alternatively, you can display a static image as a splash. To do this, add a required image (say MySplashImage.png) into your executable project and set its BuildAction to EmbeddedResource. After that, you can use the following code:

[C#]FeatureCenterWindowsFormsApplication xafApplication = new FeatureCenterWindowsFormsApplication(); xafApplication.SplashScreen = new DevExpress.ExpressApp.Win.Utils.DXSplashScreen("MySplashImage.png");

If a parameterless DXSplashScreen constructor is used, then the default wait form (DevExpress.ExpressApp.Win.Utils.DXSplashScreenForm) is displayed.


The DXSplashScreen class can also be used to display a splash image or provide a "live" splash notifying users about current progress.
Refer to the
%Public%\Documents\DXperience 13.1 Demos\eXpressApp Framework\FeatureCenter\CS\\FeatureCenter.Module.Win\Splash\SplashController.cs file for more details on how this can be customized."

Check the following video to see how this works in action:

View on »

No comments:

Post a Comment