private void MenuItem_Click_Delete(object sender, RoutedEventArgs e) { MessageBoxResult result = MessageBox.Show("Are you sure about deleting conversation.", "Delete Conversation ?", MessageBoxButton.OKCancel); if (result == MessageBoxResult.Cancel) { return; } ListBoxItem selectedListBoxItem = this.myListBox.ItemContainerGenerator.ContainerFromItem((sender as MenuItem).DataContext) as ListBoxItem; if (selectedListBoxItem == null) { return; } ConversationListObject convObj = selectedListBoxItem.DataContext as ConversationListObject; convMap.Remove(convObj.Msisdn); // removed entry from map App.ViewModel.MessageListPageCollection.Remove(convObj); // removed from observable collection ConversationTableUtils.deleteConversation(convObj.Msisdn); // removed entry from conversation table MessagesTableUtils.deleteAllMessagesForMsisdn(convObj.Msisdn); //removed all chat messages for this msisdn }