Silverlight互动触发器 [英] Silverlight interaction trigger
本文介绍了Silverlight互动触发器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在vs2010中创建了一个页面.其中包含这样的交互触发器..
I created one page in vs2010.It contains interaction trigger like this..
<MediaElement x:Name="mediaElement" Grid.Row="0" Grid.Column="0" Source="{Binding SelectedVideoProperty}" AutoPlay="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MediaOpened">
<i:InvokeCommandAction Command="{Binding MediaOpenedCommand}" CommandParameter="{Binding ElementName=mediaElement}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</MediaElement>
Viewmodel包含代码.当我运行时,该事件没有触发.
Viewmodel contains the codes.While I''m running, that event is not firing.
推荐答案
您需要具有代理数据源并绑定来自代理数据源的命令通过添加代理数据源的静态资源.
you need to have a proxy datasource and bind the command from the proxy datasource by adding a static resource of your proxy data source.
这篇关于Silverlight互动触发器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文