我想在视图模型中处理我的View(PhoneApplicationPage
)的Page_Loaded事件。过去通过以下方式完成:
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<Command:EventToCommand Command="{Binding LoadedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
此方法使用MVVM Light EventToCommand
。
但他的方法不再适用,并给出以下错误:
无法将“EventToCommand”类型的值添加到集合或 'TriggerActionCollection'类型的字典。
在WP7.1中,将视图事件绑定到视图模型的方法的正确MVVM方法是什么?