I have a treeview where I can click on items. I am using MVVM light toolkit and the EventToCommand and would like to know which item was chosen. How can I pass this to my viewmodel?
<interact:Interaction.Triggers>
<interact:EventTrigger EventName="SelectedItemChanged">
<cmd:EventToCommand Command="{Binding Path=DataContext.SimpleCommand, RelativeSource={RelativeSource AncestorType={x:Type TreeView}}, Mode=OneWay}"
CommandParameter="{Binding SelectedItems, ElementName=mainTreeView}"
/>
</interact:EventTrigger>
</interact:Interaction.Triggers>
http://www.galasoft.ch/mvvm/#intro With the newest version, you can get the EventArgs of the fired event directly in the ViewModel to handle it.