Let me ask this question with a pseudo code:
<Window>
<ListView ItemsSource="{Binding PersonCollection}">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel>
<TextBlock Text="{Binding Path=Name}" />
<TextBlock Text="{Binding Path=Age}" />
<TextBlock Text="/" />
<CheckBox Command="{Binding PersonSelectedCommand}" /> <!-- Where "PersonSelectedCommand" is a public command property available in ViewModel object (lets say "Contacts" in this context)-->
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</Window>
Where
"Contacts" the ViewModel object set as the DataContext for the window.
"Contacts" has "PersonCollection" , public ICommand PersonSelectedCommand properties.
"PersonCollection" is List
"Person" has Name, Age properties
Currently this is not working as CheckBox is trying to find and bind the ICommand "PersonSelectedCommand" property of object "person", which does not exists!
How will bind the CheckBox to the ICommand "PersonSelectedCommand" property of object "Contact"
Thanks and regards
123Deveopler