Windows Phone 8.1 Silverlight下面的代码就像魅力一样
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<interactivity:EventToCommand Command="{Binding ApplyCommand}"
DisableAssociatedObjectOnCannotExecute="True"
PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
在Universal Application(Windows 10)下是否存在任何工作方式?
答案 0 :(得分:1)
在UWP(WinRT)中无法使用EventToCommand。您可以(或应该)使用它:
1.通过NuGet安装行为sdk
2.使用此代码
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="Loaded">
<Core:InvokeCommandAction Command="{Binding ApplyCommand}" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>