I have an animation with this trigger setup in LoadingAnimation.xaml:
<UserControl.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard x:Name="ProgressAnimation_BeginStoryboard" Storyboard="{StaticResource ProgressAnimation}"/>
</EventTrigger>
</UserControl.Triggers>
In my MainWindow.xaml, I have this inside a grid:
<control:LoadingAnimation x:Name="loadingAnimation" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Grid.Row="7" Grid.ColumnSpan="2" />
I understand that I can start the storyboard with the following code:
Storyboard storyboard = Application.Current.MainWindow.FindResource("ProgressAnimation") as Storyboard;
storyboard.Begin();
But how can I use "FindResource() when my storyboard is in a different class?