Skip to content

Instantly share code, notes, and snippets.

@damirarh
Created June 23, 2013 10:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save damirarh/5844618 to your computer and use it in GitHub Desktop.
Save damirarh/5844618 to your computer and use it in GitHub Desktop.
<ListView IsItemClickEnabled="True"
ItemsSource="{Binding Items}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="ItemClick">
<i:InvokeCommandAction Command="{Binding ItemClickedCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ListView>
public ViewModel()
{
Items = new List<string> {"Item 1", "Item 2", "Item 3"};
ItemClickedCommand = new DelegateCommand(ItemClicked);
}
public void ItemClicked()
{
// react to the event
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment