Ticket T459315
Visible to All Users

How to show WaitIndicator over other controls

created 8 years ago

I would like to use one wait control centered/overlayed over other controls that has a messages set in a viewmodel for when the application is loading or saving data.  I thought the WaitIndicator is the way to go but since it is not a container I'm not sure how I can use it to overlay controls.  I tried to use the LoadDecorator (see below) but when I set the IsSplashScreenShown (by setting ShowWait in view model) the LoadDecorator appears but hangs the applications.

XAML
<dx:LoadingDecorator Grid.Row="0" Grid.Column="0" IsSplashScreenShown="{Binding ShowWait}" SplashScreenDataContext="{Binding}"> <dx:LoadingDecorator.SplashScreenTemplate> <DataTemplate> <dx:WaitIndicator DeferedVisibility="True" Content="{Binding WaitMessage}"/> </DataTemplate> </dx:LoadingDecorator.SplashScreenTemplate>

Thanks,

Ted

Answers approved by DevExpress Support

created 8 years ago

Hello Ted,

You are correct - the WaitIndicator is not a container, and to show it over other controls, you need to use a container that supports showing its children one over another. For example, use the standard Grid for this purpose:

XAML
<Grid> <TextBlock Text="WaitIndicator" VerticalAlignment="Center" HorizontalAlignment="Center" /> <dx:WaitIndicator DeferedVisibility="True" Visibility="{Binding IsBusy, Converter={dx:BooleanToVisibilityConverter}}" VerticalAlignment="Center" HorizontalAlignment="Center"/> </Grid>

As for our LoadingDecorator, it operates as a container and shows the WaitIndicator until the content is loaded. It also supports showing the WaitIndicator when its IsSplashScreenShown property is set to True.

I suggest that you review the corresponding documentation articles to learn more about these controls:

Wait Indicator
Loading Decorator

I've also prepared a simple sample to illustrate how both of these controls work. Please refer to the attachment.
Let me know if you have additional questions.

Thanks,
Andrey

    Comments (2)

      I want to show the WaitInditor before I fetch data from database and then hide it: I use following codes but it doesn't work:
      IsBusy = true;
      WCF.GetData();
      Show DEV Chart();
      IsBusy = false;

      I have no idea why it doesn't work, can any one help?

      Andrey K (DevExpress Support) 8 years ago

        Hello,

        I see that you have created a separate thread regarding this question: Show LoadingDecorator for purpose?. Let's continue discussing this issue there.

        Thanks,
        Andrey

        Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

        Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.