2016-04-05 54 views
0
使用EventToCommand(Catel)

下了Windows Phone 8.1的Silverlight下面的代码就像一个魅力如何UWP应用

<i:Interaction.Triggers> 
<i:EventTrigger EventName="Loaded"> 
    <interactivity:EventToCommand Command="{Binding ApplyCommand}" 
         DisableAssociatedObjectOnCannotExecute="True" 
            PassEventArgsToCommand="True" /> 
</i:EventTrigger> 
</i:Interaction.Triggers> 

是存在的任何方式下的通用应用程序(Windows 10)的工作?

+0

我建议你更改标题,这其实无关与Catel,但与UWP。建议将是“如何在UWP应用程序中使用EventToCommand” –

回答

1

EventToCommand在UWP(WinRT)中不可用。你可以(或应该)用这个来代替:通过的NuGet

1.安装行为SDK 2.使用此代码

<Interactivity:Interaction.Behaviors> 
    <Core:EventTriggerBehavior EventName="Loaded"> 
     <Core:InvokeCommandAction Command="{Binding ApplyCommand}" /> 
    </Core:EventTriggerBehavior> 
</Interactivity:Interaction.Behaviors>