ControlStoryboardAction in the View that triggered by event in the ViewModel
<i:Interaction.Triggers>
<i:EventTrigger EventName="DownloadStartedEvent">
<ei:ControlStoryboardAction/>
</i:EventTrigger>
<i:Interaction.Triggers>
DownloadStartedEvent is some public event on my ViewModel. I want this trigger on my Vie开发者_运维技巧w to start a StoryBoard when the DownloadStartedEvent on the ViewModel is fired. Is there a way to achieve that ?
It should work when you bind the EventName to the event of the DataContext (aka. your viewmodel)
<i:Interaction.Triggers>
<i:EventTrigger EventName="{Binding DownloadStartedEvent}">
<ei:ControlStoryboardAction/>
</i:EventTrigger>
<i:Interaction.Triggers>
精彩评论