I have a list of items displayed as a ListBox.
<ListView ItemsSource="{Binding ListOfSomeItems}">
<ListView.View>
<GridView>
<GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}"/>
<GridViewColumn Header="Status">
<GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsReceived}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
Now there is 2 user cases I need to implement:
1) When user mark an Item as received (the CheckBox get checked) I need to update the item. How should I bind the checked event to ICommand in my ViewModel?
2) When user tries to remove received flag (un-checks the checkBox) a pop up should be provided with an option to cancel the operation (if someone clicked the checkBox by accident) or to provide a note for a reason. That note along with the Item that been unchecked should be sent to different ICommand in VM.
Any suggestions?
Thanks in advance
UPDATE:
My viewModel do implements INoftiyPropertyChanged but I do not have property for the single item. The property is nested in complex class: something like Account.Holders[x].Requirements[y].IsReceived.
Then in command handler you can analyze passed in value of the
IsReceivedas command parameter.