public void ContactWindow_Loaded(object sender, RoutedEventArgs e) { BusinessLayer.ConversationManager cm = new BusinessLayer.ConversationManager(); IList<EntityLayer.Contact> contacts = cm.getContacts(); ViewModel.Contact.ContactsModelView cmv = new ViewModel.Contact.ContactsModelView(contacts); ListContact.DataContext = cmv; }
private void MenuItem_Delete_Click(object sender, RoutedEventArgs e) { BusinessLayer.ConversationManager cm = new BusinessLayer.ConversationManager(); if (ListContact.SelectedItem != null) { cm.removeContact(((ContactModelView)ListContact.SelectedItem).Contact); IList<EntityLayer.Contact> contacts = cm.getContacts(); ViewModel.Contact.ContactsModelView cmv = new ViewModel.Contact.ContactsModelView(contacts); ListContact.DataContext = cmv; } }