Skip to content

Instantly share code, notes, and snippets.

@programmation
Created August 5, 2015 23:10
Show Gist options
  • Select an option

  • Save programmation/95a70b0f4a4b70cb3760 to your computer and use it in GitHub Desktop.

Select an option

Save programmation/95a70b0f4a4b70cb3760 to your computer and use it in GitHub Desktop.
// http://forums.xamarin.com/discussion/comment/144204/#Comment_144204
// Projects is an ObservableCollection
<ListView x:Name="projectListView"
ItemsSource="{Binding Projects}"
SelectedItem="{Binding SelectedProject, Mode=TwoWay}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell x:Name="textCell"
Text="{Binding Name}"
Detail="{Binding LastTestRun}">
<TextCell.ContextActions>
<MenuItem Text="Edit"
BindingContext="{Binding Source={x:Reference projectListView}, Path=BindingContext}"
Command="{Binding EditProject}"
CommandParameter="{Binding Source={x:Reference textCell}, Path=BindingContext}" />
</TextCell.ContextActions>
</TextCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment