示例#1
0
        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;
        }
示例#2
0
        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;
            }
        }