Select to view content in your preferred language

How do I add a wait indicator?

609
2
Jump to solution
10-12-2012 08:13 AM
ChrisBradberry
Deactivated User
Hey,

I would like to add a wait indicator to a panel -- the same kind that is in the legend sample.  I have the xaml code, but cannot figure out how to call it, or start and stop it.

Thanks, Chris
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
The wait indicator of the legend is created with a StoryBoard repeating forever a rotation animation.

It starts and stops just by making it visible and collapsed.

For example, the BusyIndicator of the legend control is defined this way:
<Grid x:Name="BusyIndicator" Background="Transparent" Margin="3,0"    HorizontalAlignment="Left" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" >  <Grid.Triggers>   <EventTrigger RoutedEvent="Grid.Loaded">    <EventTrigger.Actions>     <BeginStoryboard>      <Storyboard>       <DoubleAnimation Duration="0:0:1" RepeatBehavior="Forever" To="360" Storyboard.TargetName="BusyIndicator"         Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" />      </Storyboard>     </BeginStoryboard>    </EventTrigger.Actions>   </EventTrigger>  </Grid.Triggers>   <Grid.RenderTransform>   <RotateTransform />  </Grid.RenderTransform>  <Ellipse Fill="#1E525252" Margin="11,2,11,20" Width="2" Height="2"/>  <Ellipse Fill="#3F525252" Height="3" Width="3" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,4,5,0" />  <Ellipse Fill="#7F525252" Width="4" HorizontalAlignment="Right" Height="4" VerticalAlignment="Top" Margin="0,9,1,0" />  <Ellipse Fill="#BF525252" Height="5" Width="5" VerticalAlignment="Bottom" Margin="0,0,3,3" HorizontalAlignment="Right" />  <Ellipse Fill="#FF525252" Height="6" Width="6" VerticalAlignment="Bottom" Margin="9,0" /> </Grid>

View solution in original post

0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
The wait indicator of the legend is created with a StoryBoard repeating forever a rotation animation.

It starts and stops just by making it visible and collapsed.

For example, the BusyIndicator of the legend control is defined this way:
<Grid x:Name="BusyIndicator" Background="Transparent" Margin="3,0"    HorizontalAlignment="Left" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5" >  <Grid.Triggers>   <EventTrigger RoutedEvent="Grid.Loaded">    <EventTrigger.Actions>     <BeginStoryboard>      <Storyboard>       <DoubleAnimation Duration="0:0:1" RepeatBehavior="Forever" To="360" Storyboard.TargetName="BusyIndicator"         Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" />      </Storyboard>     </BeginStoryboard>    </EventTrigger.Actions>   </EventTrigger>  </Grid.Triggers>   <Grid.RenderTransform>   <RotateTransform />  </Grid.RenderTransform>  <Ellipse Fill="#1E525252" Margin="11,2,11,20" Width="2" Height="2"/>  <Ellipse Fill="#3F525252" Height="3" Width="3" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,4,5,0" />  <Ellipse Fill="#7F525252" Width="4" HorizontalAlignment="Right" Height="4" VerticalAlignment="Top" Margin="0,9,1,0" />  <Ellipse Fill="#BF525252" Height="5" Width="5" VerticalAlignment="Bottom" Margin="0,0,3,3" HorizontalAlignment="Right" />  <Ellipse Fill="#FF525252" Height="6" Width="6" VerticalAlignment="Bottom" Margin="9,0" /> </Grid>
0 Kudos
ChrisBradberry
Deactivated User
Thanks Dominique.  I really like the simple solutions.

Chris
0 Kudos