private void ResetMessagesCollection() { foreach (var message in MessagesCollection.ToList()) { MessagesCollection.Remove(message); } if (SelectedContact != null) { PopulateMessageCollection(); } }
private void DeleteSelectedContact() { IMService.DeleteContact(LoggedInUser, GetSelectedUser()); foreach (var contact in ContactsCollection.ToList()) { if (contact.Username == SelectedContact.Username) { ContactsCollection.Remove(contact); } } foreach (var message in MessagesCollection.ToList()) { MessagesCollection.Remove(message); } ResetContactsDetails(); }