SplashScreenService Class

Allows you to display splash screens.

Namespace: DevExpress.Mvvm.UI

Assembly: DevExpress.UI.Xaml.v18.2.dll

Declaration

public class SplashScreenService :
    ViewServiceBase,
    ISplashScreenService
Public Class SplashScreenService
    Inherits ViewServiceBase
    Implements ISplashScreenService

Remarks

You can use splash screens to provide an end-user with information about the progress of certain processes in your application.

SplashScreenGif

To add a splash screen to the application, define the SplashScreenService in the Interaction.Behaviors collection.

xmlns:dxmvvmui="using:DevExpress.Mvvm.UI"
xmlns:dxmvvmi="using:DevExpress.Mvvm.UI.Interactivity"

<dxmvvmi:Interaction.Behaviors>
    <dxmvvmui:SplashScreenService />    
</dxmvvmi:Interaction.Behaviors>

Then, access the attached SplashScreenService in your ViewModel by using the ViewModelBase.GetService method and invoke the ISplashScreenService.ShowSplashScreen method to show the splash screen.

public class MainViewModel : ViewModelBase {

    public ICommand ShowSplashScreenCommand { get; private set; }

    public ISplashScreenService DefaultSplashScreenService {
        get {
            return this.GetService<ISplashScreenService>();
        }
    }

    public MainViewModel() {
        ShowSplashScreenCommand = new DelegateCommand(OnShowSplashScreenCommandExecute);        
    }

    private async void OnShowSplashScreenCommandExecute() {
        DefaultSplashScreenService.ShowSplashScreen();
        await Task.Delay(4000);
        DefaultSplashScreenService.HideSplashScreen();
    }
}

Use the SplashScreenService.SplashScreenType property to specify the type of view containing a splash screen that needs to be shown.

Important

SplashScreenService works only when the DXFrame or HamburgerMenuFrame is used.

Examples

using Windows.UI.Xaml.Controls;

namespace App1 {
    public sealed partial class MainPage : Page {
        public MainPage() {
            this.InitializeComponent();
        }
    }
}

Inheritance

Object
DevExpress.Mvvm.UI.Interactivity.AttachableObjectBase
DevExpress.Mvvm.UI.Interactivity.Behavior
DevExpress.Mvvm.UI.Interactivity.Behavior<Windows.UI.Xaml.FrameworkElement>
DevExpress.Mvvm.UI.ServiceBaseGeneric<Windows.UI.Xaml.FrameworkElement>
ServiceBase
ViewServiceBase
SplashScreenService

Implements

DevExpress.Mvvm.UI.Interactivity.IAttachableObject
See Also