One way is to have a property in the view model named IsLoadingData. You can then bind it to the Visibility property of the control that hosts the animation using the BooleanToVisibilityConverter.
Visibility={Binding
Path=IsLoadingData,
Converter={StaticResource BooleanToVisibilityConverter}}
This control can then use the ControlTemplate to launch the storyboard containing the animation when the VisibilityProperty parameter is set to true.
<ControlTemplate.Triggers>
<Trigger Property="IsVisible" Value="True">
<Trigger.EnterActions>
<BeginStoryboard
x:Name="Storyboard0"
Storyboard="{StaticResource Animation0}"
/>
</Trigger.EnterActions>
</Trigger>
</ControlTemplate.Triggers>
. , .