开发者

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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜