This is a migrated thread and some comments may be shown as answers.

BusyIndicator Exception!

2 Answers 94 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Syed Danish
Top achievements
Rank 1
Syed Danish asked on 18 May 2011, 08:23 AM
Hi there,

I've applied the following styles to the BusyIndicator but this is showing me an exception. Let me know what is wrong in the style.

<ResourceDictionary
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:System="clr-namespace:System;assembly=mscorlib">
    <LinearGradientBrush x:Key="BusyIndicatorBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="White" Offset="0"/>
        <GradientStop Color="#A9DCDADA" Offset="1"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="BusyIndicatorBorderBrush" Color="#FFD0D0D0"/>
    <LinearGradientBrush x:Key="BusyIndicatorIndeterminateBackground" EndPoint="0.5,1" StartPoint="0.5,0">
        <GradientStop Color="#FFB0FF2B" Offset="0"/>
        <GradientStop Color="#FFD3FFA9" Offset="1"/>
        <GradientStop Color="#FFE5FFCD" Offset="0.248"/>
        <GradientStop Color="#FFA6FF2B" Offset="0.5"/>
    </LinearGradientBrush>
    <SolidColorBrush x:Key="BusyIndicatorIndeterminateBorderBrush" Color="#FF91DA16"/>
    <RadialGradientBrush x:Key="BusyIndicatorIndeterminateCommetFill" Center="0.5,-0.23" GradientOrigin="0.8,0.25" RadiusY="0.68" RadiusX="0.68">
        <GradientStop Color="#BFFFFFFF" Offset="0"/>
        <GradientStop Color="#00FFFFFF" Offset="1"/>
        <GradientStop Color="#21FFFFFF" Offset="0.65"/>
    </RadialGradientBrush>
    <SolidColorBrush x:Key="BusyIndicatorProgressBackground" Color="#FFA5FE5E"/>
    <Style x:Key="BusyIndicatorProgressBarStyle" TargetType="telerik:RadProgressBar">
        <Setter Property="Margin" Value="15 15 15 5"/>
        <Setter Property="IsIndeterminate" Value="True"/>
        <Setter Property="Maximum" Value="100"/>
        <Setter Property="Orientation" Value="Horizontal"/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadProgressBar">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Determinate"/>
                                <VisualState x:Name="Indeterminate">
                                    <Storyboard RepeatBehavior="Forever">
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="IndeterminateDonut">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00" Value="Visible"/>
                                        </ObjectAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(RotateTransform.Angle)" Storyboard.TargetName="IndeterminateDonut">
                                            <SplineDoubleKeyFrame KeyTime="00:00:01" Value="360"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Path x:Name="IndeterminateBackgroundDonut" Fill="{StaticResource BusyIndicatorIndeterminateBackground}" Height="44" RenderTransformOrigin="0.5 0.5" Stroke="{StaticResource BusyIndicatorIndeterminateBorderBrush}" Width="44">
                            <Path.Data>
                                <GeometryGroup FillRule="EvenOdd">
                                    <EllipseGeometry Center="22 22" RadiusY="20" RadiusX="20"/>
                                    <EllipseGeometry Center="22 22" RadiusY="14" RadiusX="14"/>
                                </GeometryGroup>
                            </Path.Data>
                        </Path>
                        <Path x:Name="IndeterminateDonut" Fill="{StaticResource BusyIndicatorIndeterminateCommetFill}" Height="44" RenderTransformOrigin="0.5 0.5" Visibility="Collapsed" Width="44">
                            <Path.Data>
                                <GeometryGroup FillRule="EvenOdd">
                                    <EllipseGeometry Center="22 22" RadiusY="20" RadiusX="20"/>
                                    <EllipseGeometry Center="22 22" RadiusY="14" RadiusX="14"/>
                                </GeometryGroup>
                            </Path.Data>
                            <Path.RenderTransform>
                                <TransformGroup>
                                    <RotateTransform/>
                                </TransformGroup>
                            </Path.RenderTransform>
                        </Path>
                        <Grid x:Name="ProgressBarTrack" Height="24" RenderTransformOrigin="0.5 0.5" Width="24">
                            <Grid.Clip>
                                <EllipseGeometry Center="12 12" RadiusY="12" RadiusX="12"/>
                            </Grid.Clip>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RenderTransform>
                                <RotateTransform Angle="-90"/>
                            </Grid.RenderTransform>
                            <Rectangle x:Name="SkipValueSpacer"/>
                            <Rectangle x:Name="ProgressBarIndicator" Grid.Column="1" Fill="{StaticResource BusyIndicatorProgressBackground}"/>
                        </Grid>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <SolidColorBrush x:Key="BusyIndicatorBusyOverlayBrush" Color="#88FFFFFF"/>
    <Style x:Key="RadBusyIndicatorStyle1" TargetType="telerik:RadBusyIndicator">
        <Setter Property="BusyContent" Value="Loading..."/>
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="DisplayAfter" Value="00:00:00.1"/>
        <Setter Property="Background" Value="{StaticResource BusyIndicatorBackground}"/>
        <Setter Property="BorderBrush" Value="{StaticResource BusyIndicatorBorderBrush}"/>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="ProgressBarStyle" Value="{StaticResource BusyIndicatorProgressBarStyle}"/>
        <Setter Property="telerik:AnimationManager.AnimationSelector">
            <Setter.Value>
                <telerik:AnimationSelector>
                    <telerik:FadeAnimation AnimationName="Hide" Direction="Out" TargetElementName="Indicator"/>
                    <telerik:FadeAnimation AnimationName="Show" Direction="In" TargetElementName="Indicator"/>
                </telerik:AnimationSelector>
            </Setter.Value>
        </Setter>
        <Setter Property="OverlayStyle">
            <Setter.Value>
                <Style TargetType="Rectangle">
                    <Setter Property="Fill" Value="{StaticResource BusyIndicatorBusyOverlayBrush}"/>
                </Style>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadBusyIndicator">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="VisibilityStates">
                                <VisualState x:Name="Hidden">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Indicator">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Overlay">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Collapsed</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Visible">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Indicator">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Overlay">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <Visibility>Visible</Visibility>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="BusyStatusStates">
                                <VisualState x:Name="Idle">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>True</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Busy">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetProperty="(Control.IsEnabled)" Storyboard.TargetName="Content">
                                            <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                <DiscreteObjectKeyFrame.Value>
                                                    <System:Boolean>False</System:Boolean>
                                                </DiscreteObjectKeyFrame.Value>
                                            </DiscreteObjectKeyFrame>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <ContentControl x:Name="Content" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsEnabled="False" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        <Rectangle x:Name="Overlay" Style="{TemplateBinding OverlayStyle}"/>
                        <Border x:Name="Indicator" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="2" HorizontalAlignment="Center" MinWidth="180" VerticalAlignment="Center" Width="155">
                            <StackPanel>
                                <telerik:RadProgressBar x:Name="ProgressBar" IsIndeterminate="{TemplateBinding IsIndeterminate}" Style="{TemplateBinding ProgressBarStyle}" Value="{TemplateBinding ProgressValue}"/>
                                <ContentPresenter ContentTemplate="{TemplateBinding BusyContentTemplate}" Content="{TemplateBinding BusyContent}" HorizontalAlignment="Center" Margin="15 5 15 15"/>
                            </StackPanel>
                        </Border>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style></ResourceDictionary>


Thanks,
Syed Danish

2 Answers, 1 is accepted

Sort by
0
Syed Danish
Top achievements
Rank 1
answered on 20 May 2011, 02:48 PM
Any update with this issue guys?!
0
Boyan
Telerik team
answered on 24 May 2011, 12:11 PM
Hello Syed Danish,

I have some problems reproducing the error. I created a sample application with RadBusyIndicator only and the style you provided but it is working fine at my side and no error is thrown. I have attached the project I used. Do you get the same error with it? Also some info what is the error would be of help.

Best wishes,
Boyan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
BusyIndicator
Asked by
Syed Danish
Top achievements
Rank 1
Answers by
Syed Danish
Top achievements
Rank 1
Boyan
Telerik team
Share this question
or