How to start a Storyboard from a DataEventTrigger?
I want to start a storyboard when an event from a viewmodel is invoked. What is the best way of doing this?
-
-
sfernandez
Site Admin
- Posts: 3363
- Joined:
Re: How to start a Storyboard from a DataEventTrigger?
Hi, you have to use the ControlStoryboardAction to begin the storyboard:
Code: Select all
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
xmlns:noesis="clr-namespace:NoesisGUIExtensions;assembly=Noesis.GUI.Extensions">
<Grid.Resources>
<Storyboard x:Key="anim" .../>
</Grid.Resources>
<b:Interaction.Triggers>
<noesis:DataEventTrigger Source="{Binding}" EventName="DownloadFinished">
<b:ControlStoryboardAction Storyboard="{StaticResource anim}"/>
</noesis:DataEventTrigger>
</b:Interaction.Triggers>
</Grid>Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest