public static void InsertMessage(Message message, ref ObservableCollection <Message> messageThread, out string error) { error = string.Empty; messageThread.Add(message); ContactFacade.InsertRecentConversation(message); // Insert message into the database here }
public static void DeleteMessage(Message message, ref ObservableCollection <Message> messageThread, out string error) { error = string.Empty; messageThread.Remove(message); var correspondent = ContactFacade.GetCorrespondent(message, out error); ContactFacade.DeleteRecentConversation(correspondent, out error); // Delete message from the database here }