Skip to main content
A newer version of this page is available. .

SplashScreenService Class

Allows you to display splash screens.

Namespace: DevExpress.Mvvm.UI

Assembly: DevExpress.UI.Xaml.v21.1.dll

NuGet Package: DevExpress.Uwp.Controls

Declaration

public class SplashScreenService :
    ViewServiceBase,
    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.

Example

using Windows.UI.Xaml.Controls;

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

Inheritance

Object
DependencyObject
DevExpress.Mvvm.UI.Interactivity.AttachableObjectBase
DevExpress.Mvvm.UI.Interactivity.Behavior
DevExpress.Mvvm.UI.Interactivity.Behavior<FrameworkElement>
DevExpress.Mvvm.UI.ServiceBaseGeneric<FrameworkElement>
ServiceBase
ViewServiceBase
SplashScreenService
See Also