You are viewing help content for pre-release software. This document and the features it describes are subject to change. Switch to the current version.

LoadingDecorator Class

A container control for displaying long-loading content. Once the content is fully loaded, the loading indicator disappears and the content becomes visible.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v20.2.dll

Declaration

public class LoadingDecorator :
    Decorator
Public Class LoadingDecorator
    Inherits Decorator

Remarks

The LoadingDecorator is a container control that displays a loading indicator during data/content loading. The Loading Decorator uses the Wait Indicator control to inform that loading is in progress. The Loading Decorator disappears when the content is loaded.

LoadingDecoratorDemo

NOTE

The Wait Indicator works within the main application's UI thread. UI freezes may affect the Wait Indicator animation.

Wrap the content with the dx:LoadingDecorator tag to add the LoadingDecorator to an application:

<Window xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"...>
<Grid>
    ...
    <dx:LoadingDecorator>
        <!--Content-->
    </dx:LoadingDecorator>
</Grid>
</Window>

View Example: How to add the Loading Decorator to the MVVM Application

View Example: How to build-in the ProgressBar into the LoadingDecorator

Lock Modes

Use the LoadingDecorator.OwnerLock property to specify which part of an applications is locked while the LoadingDecorator content loads:

Value Image Description
Full ownermode-full Blocks the entire window.
InputOnly ownermode-inputonly Blocks the entire window's input. The window's title bar stays active, and you can move the window.
LoadingContent ownermode-loading-content Blocks only the LoadingDecorator's content.
None ownermode-none Nothing is blocked.

View Example: How to use the Loading Decorator's OwnerLock property

Customization

Content

Use LoadingDecorator.SplashScreenTemplate and LoadingDecorator.SplashScreenDataContext properties to customize the LoadingDecorator's content, layout, and appearance.

The following code sample sets the Loading Decorator's text to Loading...Please wait:

<dx:ThemedWindow 
    ...
    xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"/>
...
    <dx:LoadingDecorator>
        <dx:LoadingDecorator.SplashScreenTemplate>
            <DataTemplate>
                <dx:WaitIndicator DeferedVisibility="True" Content="Loading...Please wait"/>
            </DataTemplate>
        </dx:LoadingDecorator.SplashScreenTemplate>
        <!--Content-->
    </dx:LoadingDecorator>
...
</dx:ThemedWindow>

Loading Decorator Customization - Custom Text

TIP

Set the WaitIndicator's Content property to "" (empty string) to hide the Loading Decorator's text.

Position

Use the LoadingDecorator.SplashScreenLocation property to specify the Loading Decorator position.

<Grid>
    ...
    <dx:LoadingDecorator SplashScreenLocation="CenterContainer">
        <!--Content-->
    </dx:LoadingDecorator>
</Grid>

You can set the LoadingDecorator.SplashScreenLocation property to the following values:

Value Description
CenterWindow Locates the splash screen in the window center.
CenterScreen Locates the splash screen in the screen center.
CenterContainer Locates the splash screen in the container center.

Border

Use the following properties to specify the border highlight effect:

<dx:LoadingDecorator ... BorderEffect="Default" BorderEffectColor="Red">
    <!--Content-->
</dx:LoadingDecorator>

LoadingDecoratorHighlighting

Fade Animation

Use the following properties to customize fade effects:

The following code sample sets the Fade In and Fade Out animation time to 400 milliseconds:

<dx:LoadingDecorator FadeInDuration="0:0:0:0.4" FadeOutDuration="0:0:0:0.4">
    <!--Content-->
</dx:LoadingDecorator>
See Also