Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ProgressBar > Animate IsIndeterminate

Not answered Animate IsIndeterminate

Feed from this thread
  • Stephane avatar

    Posted on Dec 9, 2010 (permalink)

    Hello,

    I can't animate IsIndeterminate property on a RadProgressBar. I have a custom control with a ProgressBar in it. The custom control has severals VisualState and I want to change the IsIndeterminate property according to the state of the control.

    Here is my code :
    <VisualState x:Name="InProgress">
                                            <Storyboard>
                                                <DoubleAnimation To="1" Duration="0:0:0.5" Storyboard.TargetName="progressbar_Status" Storyboard.TargetProperty="(UIElement.Opacity)"></DoubleAnimation>
                                                <DoubleAnimation To="1" Duration="0:0:1" Storyboard.TargetName="label_StatusMessage" Storyboard.TargetProperty="(UIElement.Opacity)"></DoubleAnimation>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="progressbar_Status" Storyboard.TargetProperty="(RadProgressBar.IsIndeterminate)" BeginTime="0:0:0">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:2" Value="True" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
    <VisualState x:Name="InProgress">
                                            <Storyboard>
                                                <DoubleAnimation To="1" Duration="0:0:0.5" Storyboard.TargetName="progressbar_Status" Storyboard.TargetProperty="(UIElement.Opacity)"></DoubleAnimation>
                                                <DoubleAnimation To="1" Duration="0:0:1" Storyboard.TargetName="label_StatusMessage" Storyboard.TargetProperty="(UIElement.Opacity)"></DoubleAnimation>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="progressbar_Status" Storyboard.TargetProperty="(RadProgressBar.IsIndeterminate)" BeginTime="0:0:0">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:2" Value="True" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>

    <VisualState x:Name="InProgress">
                                            <Storyboard>
                                                <DoubleAnimation To="1" Duration="0:0:0.5" Storyboard.TargetName="progressbar_Status" Storyboard.TargetProperty="(UIElement.Opacity)"></DoubleAnimation>
                                                <DoubleAnimation To="1" Duration="0:0:1" Storyboard.TargetName="label_StatusMessage" Storyboard.TargetProperty="(UIElement.Opacity)"></DoubleAnimation>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="progressbar_Status" Storyboard.TargetProperty="(RadProgressBar.IsIndeterminate)" BeginTime="0:0:0">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:2" Value="True" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
    <VisualState x:Name="InProgress">
                                            <Storyboard>
                                                <DoubleAnimation To="1" Duration="0:0:0.5" Storyboard.TargetName="progressbar_Status" Storyboard.TargetProperty="(UIElement.Opacity)"></DoubleAnimation>
                                                <DoubleAnimation To="1" Duration="0:0:1" Storyboard.TargetName="label_StatusMessage" Storyboard.TargetProperty="(UIElement.Opacity)"></DoubleAnimation>
                                                <ObjectAnimationUsingKeyFrames Storyboard.TargetName="progressbar_Status" Storyboard.TargetProperty="(RadProgressBar.IsIndeterminate)" BeginTime="0:0:0">
                                                    <DiscreteObjectKeyFrame KeyTime="0:0:2" Value="True" />
                                                </ObjectAnimationUsingKeyFrames>
                                            </Storyboard>
                                        </VisualState>
    <VisualState x:Name="InProgress">
      <Storyboard>
        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="progressbar_Status" Storyboard.TargetProperty="(RadProgressBar.IsIndeterminate)" BeginTime="0:0:0">
          <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="True" />
        </ObjectAnimationUsingKeyFrames>
      </Storyboard>
    </VisualState>

    I have tried with "TargetProperty="IsIndeterminate", but doesn't working neither. Can you help me ?

    Thanks

    Reply

  • Kiril Stanoev Kiril Stanoev avatar

    Posted on Dec 9, 2010 (permalink)

    Hello Stephane,

    You can try the following:

    <Grid x:Name="LayoutRoot" Background="White">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="CommonStates">
                <VisualState x:Name="InProgress">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="progressBar1"
                                Storyboard.TargetProperty="IsIndeterminate">
                            <DiscreteObjectKeyFrame KeyTime="0">
                                <DiscreteObjectKeyFrame.Value>
                                    <System:Boolean>True</System:Boolean>
                                </DiscreteObjectKeyFrame.Value>
                            </DiscreteObjectKeyFrame>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <StackPanel Width="200" HorizontalAlignment="Center" VerticalAlignment="Center">
            <telerik:RadProgressBar x:Name="progressBar1" Height="30" />
            <Button Content="Go To Indeterminate" Click="Button_Click" />
        </StackPanel>
    </Grid>

    private void Button_Click(object sender, RoutedEventArgs e)
    {
        VisualStateManager.GoToState(this, "InProgress", false);
    }

    Let me know if it helps.

    Kind regards,
    Kiril Stanoev
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight

    Reply

  • Stephane avatar

    Posted on Dec 9, 2010 (permalink)

    Thank you, it works.

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > ProgressBar > Animate IsIndeterminate
Related resources for "Animate IsIndeterminate"

Silverlight ProgressBar Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]