private void CommentListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (CommentListView.SelectedItem != null) { Comment comment = (Comment)CommentListView.SelectedItem; CommentListView.SelectedItem = null; if (comment.ChannelProfile.ChannelIndex == App.USER_IDX) { MessageBoxResult rsltMessageBox = MessageBox.Show("Are you sure to delete this comment?", "Delete comment", MessageBoxButton.YesNo, MessageBoxImage.Question); switch (rsltMessageBox) { case MessageBoxResult.Yes: ViewModel.DeleteComment(comment.Index); break; case MessageBoxResult.No: break; } } } }