I am trying to execute something like this:
<DataTemplate.Triggers> <EventTrigger RoutedEvent="{Binding MyEvent}"> <BeginStoryboard Storyboard="{StaticResource MyAnimation}" /> </EventTrigger> </DataTemplate.Triggers>
MyEvent is an event from my DataContext.
This does not work because RoutedEvent cannot be a Binding expression. Any idea how to do this? Actually I need some combination of EventTrigger and DataTrigger ...
Solution with Blend SDK:
<Interactivity:Interaction.Triggers> <Interactivity:EventTrigger SourceObject="{Binding}" EventName="MyEvent"> <ei:ControlStoryboardAction ControlStoryboardOption="Play"> <ei:ControlStoryboardAction.Storyboard> <Storyboard> .... </Storyboard> </ei:ControlStoryboardAction.Storyboard> </ei:ControlStoryboardAction> </Interactivity:EventTrigger> </Interactivity:Interaction.Triggers>
source share