Binding Commands to non-Button Controls

Apr 7, 2011 at 3:16 AM

This is a fantastic light framework I have really enjoyed using however the main limitation I have found is the ability to bind commands to anything other than a button.

Is there any plan to extend the command binding to other controls (such as ListBox's etc)?

Developer
Nov 11, 2011 at 2:55 PM

If you want to bind to events for other controls that wire up to commands in your viewmodel then you can easily accomplish with blend (ie triggers/behaviors)

<i:Interaction.Triggers> 
 <i:EventTrigger EventName="MouseLeftButtonDown"> 
  <i:InvokeCommandAction Command="{Binding MyCommand}" CommandParameter="{Binding}"/>
 </i:EventTrigger>
</i:Interaction.Triggers>