2
<i:Interaction.Triggers>
   <i:EventTrigger EventName="DownloadStartedEvent">
       <ei:ControlStoryboardAction/>
   </i:EventTrigger>
<i:Interaction.Triggers>

DownloadStartedEventは、私のViewModelの公開イベントです。ViewModelのDownloadStartedEventが発生したときに、ビューのこのトリガーでStoryBoardを開始したいと思います。それを達成する方法はありますか?

4

1 に答える 1

1

EventNameをDataContext(別名:ビューモデル)のイベントにバインドすると機能するはずです。

<i:Interaction.Triggers>
  <i:EventTrigger EventName="{Binding DownloadStartedEvent}">
   <ei:ControlStoryboardAction/>
  </i:EventTrigger>
<i:Interaction.Triggers>
于 2011-07-29T05:32:24.160 に答える