How can i use the BusyIndicator without having any content inside?

Mar 1, 2011 at 7:31 PM

Hello guys,

I am trying to make my main form Busy without showing the BusyIndicator itself - means I would like my main form to to get Grey and busy

How can i do that?

I tried using:

VisualStateManager.GoToState(this, "Busy", true);

another question is how can i make the busy indicator to be placed in the middle of the program width and program height and not in the middle of the parent form.

 

Thanks in advanced,

Din.

Mar 1, 2011 at 7:39 PM
Edited Mar 1, 2011 at 7:39 PM

You would need to re-template the BusyIndicator control.  To place the BusyIndicator in the center of the parent form you must wrap all content within the busy indicator.  For example:

<Window ....>
<Grid x:Name="Parent">
     <extToolkit:BusyIndicator ....>
     All child content ......
     </extToolkit:BuyIndicator>
</Grid>
</Window>
Mar 1, 2011 at 9:59 PM
Edited Mar 1, 2011 at 9:59 PM

I didn't get it.. How can i make a form just greyed out and disabled? (without using the BusyIndicator / using the BusyIndicator but showing no content inside the control.

Heres something i tried:

 

<extToolkit:BusyIndicator IsBusy="True">
            <extToolkit:BusyIndicator.BusyContentTemplate>
                <DataTemplate>
                </DataTemplate>
            </extToolkit:BusyIndicator.BusyContentTemplate>
            <extToolkit:BusyIndicator.ProgressBarStyle>
                <Style TargetType="ProgressBar">
                    <Setter Property="Visibility" Value="Collapsed"/>
                </Style>
            </extToolkit:BusyIndicator.ProgressBarStyle>
        </extToolkit:BusyIndicator>

 

I also tried a value "Hidden" instead of "Collapsed" ProgressBar

Mar 1, 2011 at 10:14 PM

This is not how the control is meant to behave, so you will need to re-template the control.  Similar to:

    <Window.Resources>
        <Style TargetType="extToolkit:BusyIndicator">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="extToolkit:BusyIndicator">
                        <Grid>
                            <ContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <Rectangle x:Name="Overlay" Style="{TemplateBinding OverlayStyle}"/>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <Trigger Property="IsBusy" Value="False">
                                <Setter TargetName="Overlay" Property="Visibility" Value="Hidden" />
                            </Trigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </Window.Resources>

Now just use the busy indicator normally and this style will override the default one.

Mar 1, 2011 at 10:49 PM

Oh sweet! thanks :D