2016-05-24 7 views
0

タイトルはかなり質問を説明します。eventriggerの動作でコマンドを実行する方法はありますか?

<i:Interaction.Triggers> 
    <i:EventTrigger EventName="SizeChanged"> 
     <i:InvokeCommandAction> 
      <i:InvokeCommandAction.Command> 
       <Binding Source="{StaticResource eventBindingHelper}" Path="DataC.SizeChangedCommand"></Binding> 
      </i:InvokeCommandAction.Command> 
      <i:InvokeCommandAction.CommandParameter> 
       <Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType={x:Type igDP:LabelPresenter}}"/> 
      </i:InvokeCommandAction.CommandParameter> 
     </i:InvokeCommandAction> 
    </i:EventTrigger> 
</i:Interaction.Triggers> 

それはのviewmodelにバインドされます場合は作品を結合コマンド:

は、私は、テンプレートのビューには、以下の持っています。しかし、私はそれを行動に結びつけたいと思っています。私は方法を見つけることができません。

答えて

0

行動SDKへの参照を追加することを確認し、その後、次の操作を実行できます。

<Interactivity:Interaction.Behaviors> 
    <Core:EventTriggerBehavior EventName="Tapped" SourceObject="{Binding ElementName="Control to trigger"}"> //Bind behaviour the the element you want to trigger 
    <Core:InvokeCommandAction Command="{Binding Command}" CommandParameter="{Binding parameter}"/> // Bind command and parameter to behaviour 
    </Core:EventTriggerBehavior> 
</Interactivity:Interaction.Behaviors> 

次にあなたが欲しいなどのコントロールをトリガするEventTriggerBehaviourでEventNamesを切り替えることができます。

関連する問題