Reputation: 509
The code below under the Windows Phone 8.1 Silverlight works like a charm
<i:Interaction.Triggers>
<i:EventTrigger EventName="Loaded">
<interactivity:EventToCommand Command="{Binding ApplyCommand}"
DisableAssociatedObjectOnCannotExecute="True"
PassEventArgsToCommand="True" />
</i:EventTrigger>
</i:Interaction.Triggers>
Is exist any way to work under Universal Application (Windows 10)?
Upvotes: -1
Views: 979
Reputation: 5724
EventToCommand is not available in UWP (WinRT). You can (or should) use this instead:
1.Install the Behaviors sdk via NuGet
2.Use this code
<Interactivity:Interaction.Behaviors>
<Core:EventTriggerBehavior EventName="Loaded">
<Core:InvokeCommandAction Command="{Binding ApplyCommand}" />
</Core:EventTriggerBehavior>
</Interactivity:Interaction.Behaviors>
Upvotes: 2