Find storyboard object to bind events
Posted: 17 Apr 2015, 02:49
[Had this in another thread but decided to break it into it's own and deleted the question in the other thread.]
How would I do this for Storyboards? I tried:
But it came back null. I'm trying to link the Completed event via this dynamic way but can't get the control itself. The storyboard doesn't seem to be a child of UIElement so I tried the topmost parent they had.
How would I do this for Storyboards? I tried:
Code: Select all
DependencyObject* object = uiRenderer->GetXAML()->FindName<DependencyObject>("LogoStoryBoard");
Code: Select all
<Grid x:Name="window"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="600" Width="800">
<Grid.Resources>
<Storyboard x:Key="LogoStoryBoard">
...
<Grid.Triggers>
<EventTrigger RoutedEvent="FrameworkElement.Loaded">
<BeginStoryboard Storyboard="{StaticResource LogoStoryBoard}"/>
</EventTrigger>
</Grid.Triggers>