Skip to main content

SplashScreenManagerService

  • 2 minutes to read

The SplashScreenManagerService allows you to add the SplashScreenManager functionality to MVVM-compliant applications.

Add Service

To use the SplashScreenManagerService, add it to the view’s Interaction.Behaviors collection. You can use the Smart Tag as described in the Quick Actions or as shown in the code snippet below.

<UserControl x:Class="DXSampleSplashScreenService.View.MainView" 
    ...
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core" 
    xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm">
    <dxmvvm:Interaction.Behaviors>
        <dx:SplashScreenManagerService/>
    </dxmvvm:Interaction.Behaviors>
    ...
</UserControl>

The service creates and shows splash windows in a separate thread.

Specify Splash Screen View

Use the PredefinedSplashScreenType property to specify which one of the three predefined splash screen styles to display.

The following predefined splash screen styles are available:

  • Themed

    DevExpress themed splash screen fo WPF

  • Fluent

    DevExpress wait indicator fo WPF

  • WaitIndicator

    DevExpress themed splash screen fo WPF

Tip

You can implement your own splash screen view based on a SplashScreenWindow. Refer to the How to: Create a Custom Splash Screen tutorial for details. In this scenario, set the SplashScreenManagerService.SplashScreenType property to the custom splash screen view type.

Show Splash Screen From View Model

To show and hide the splash screen from your View Model, access the service and use the SplashScreenManagerService.Show and SplashScreenManagerService.Close methods correspondingly.

Tip

A detailed description on how to obtain a service from a View Model (which is a POCO object or a ViewModelBase descendant) is available here: Services in POCO objects and Services in ViewModelBase descendants.

[POCOViewModel]
public class MainViewModel {
    protected ISplashScreenManagerService SplashScreenManagerService { get { return this.GetService<ISplashScreenManagerService>();} }
    public void Display() {
        SplashScreenManagerService.Show();
        //...
        SplashScreenManagerService.Close();
    }
}

Edit Splash Screen Data

Access the SplashScreenManagerService.ViewModel to specify splash screen data and content.

public void Display() {
    SplashScreenManagerService.ViewModel = new DXSplashScreenViewModel();
    SplashScreenManagerService.ViewModel.Subtitle = "Powered by DevExpress";
    SplashScreenManagerService.ViewModel.Logo = new Uri("../../Images/Logo.png", UriKind.Relative);
    SplashScreenManagerService.Show();
    //...
    SplashScreenManagerService.Close();
}

Options

To display a splash screen on top of a UI element, specify this element as the Owner property value and set the StartupLocation property to CenterOwner. Set the TrackOwnerPosition property to true to keep the splash screen above the owner when the user drags the owner.

Use the InputBlock property to specify the input restriction mode.

Example

View Example: How to use the SplashScreenManagerService