How to style BusyIndicator to be invisible?

3 posts, 1 answers
  1. Anders
    Anders avatar
    80 posts
    Member since:
    Dec 2010

    Posted 12 Oct 2011 Link to this post

    Hi telerik,

    I have an application with dockable windows. to 'protect' windows that might be undocked during long-running operations, I have applied BusyIndicators to each individual window. The BusyIndicators are linked to a singleton viewmodel and it works perfectly.

    As for the visual part of the BusyIndicator, I only want it in the main window.

    Can you advice me on how to style the BusyIndicator on child windows to make the progress/busy indicator invisible?

    Thanks,

    Anders, Denmark
  2. Answer
    Dani
    Admin
    Dani avatar
    848 posts

    Posted 13 Oct 2011 Link to this post

    Hello Anders,

    Accomplishing what you wish is quite easy. You just need to reduce the control template of RadBusyIndicator to a single ContentControl. Please, consider the following example:

    <Window
        x:Class="WpfApplication1.MainWindow"
        x:Name="Window"
        Title="MainWindow"
        Width="640" Height="480">
        <Window.Resources>
            <ControlTemplate x:Key="RadBusyIndicatorTemplate" TargetType="telerik:RadBusyIndicator">
                <ContentControl x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" 
                IsEnabled="False" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
            </ControlTemplate>              
        </Window.Resources>
      
        <Grid x:Name="LayoutRoot">
            <telerik:RadBusyIndicator Margin="176,89,148,53" IsBusy="True" Template="{StaticResource RadBusyIndicatorTemplate}">
                <telerik:RadButton Content="Test" Width="200" VerticalAlignment="Center" HorizontalAlignment="Center" />
            </telerik:RadBusyIndicator>         
        </Grid>
    </Window>

    I hope this helps.

    Regards,
    Dani
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Anders
    Anders avatar
    80 posts
    Member since:
    Dec 2010

    Posted 17 Oct 2011 Link to this post

    Works like a charm!

    And thanks :)

    Anders
Back to Top