title: Lightweight processing animation resource in WPF?
body: <p>I have created a circular processing animation similar to the one seen on the Chrome browser tab... i want to use it throughout my application and therefore decide to put it as a resource.. however.. i would like to know what is the best way/practice to use this animation resource easily in my app... below is the xaml code for my processing animation.
  should it be used as a DataTemplate or ControlTemplate?</p>
  
  <pre><code>&lt;Grid&gt;
  &lt;Grid.Resources&gt;
    &lt;Storyboard x:Key="LoadingAnimation" RepeatBehavior="Forever"&gt;
    &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(c:Arc.EndAngle)" Storyboard.TargetName="arc"&gt;
      &lt;EasingDoubleKeyFrame KeyTime="0" Value="90"/&gt;
      &lt;EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="-90"/&gt;
      &lt;EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="-270"/&gt;
    &lt;/DoubleAnimationUsingKeyFrames&gt;
    &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(c:Arc.StartAngle)" Storyboard.TargetName="arc"&gt;
      &lt;EasingDoubleKeyFrame KeyTime="0" Value="-90"/&gt;
      &lt;EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="-270"/&gt;
      &lt;EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="-450"/&gt;
    &lt;/DoubleAnimationUsingKeyFrames&gt;
  &lt;/Storyboard&gt;
  &lt;/Grid.Resources&gt;
  &lt;Grid.Triggers&gt;
    &lt;EventTrigger RoutedEvent="FrameworkElement.Loaded"&gt;
    &lt;BeginStoryboard Storyboard="{StaticResource LoadingAnimation}"/&gt;
  &lt;/EventTrigger&gt;
  &lt;/Grid.Triggers&gt;
  
  &lt;c:Arc x:Name="arcbackground" StartAngle="0" EndAngle="359.9"  Stroke="#FFE0E0E0"  StrokeThickness="8"/&gt;
  &lt;c:Arc x:Name="arc" Stroke="{StaticResource BlueGradientBrush}"  StrokeThickness="8"/&gt;
  </code></pre>
  
  <p></p>