public void ef_Changed(EditableField sender, string value) { (sender.Tag as ContactDetail).Value = value; ContactList.UpdateContactDetail((sender.Tag as ContactDetail)); FillContactListbox(); FillDetails(); }
public void FillDetails() { mainWindow.ContactDetails.Children.Clear(); if (CurrentContact == null) return; EditableField efn = new EditableField(); efn.Changed += ContactName_Changed; efn.Label.Content = CurrentContact.Name; efn.Label.FontSize = 32; efn.Tag = CurrentContact; efn.Deletable = false; mainWindow.ContactDetails.Children.Add(efn); Label ll = new Label(); ll.Content = "Group"; ll.FontWeight = FontWeights.Bold; mainWindow.ContactDetails.Children.Add(ll); EditableField eff = new EditableField(); eff.Changed += ContactGroup_Changed; eff.Label.Content = ContactList.FindGroupById(CurrentContact.Group_ID); eff.Tag = CurrentContact; eff.Deletable = false; mainWindow.ContactDetails.Children.Add(eff); if (CurrentContact.Details == null) CurrentContact.Details = new List<ContactDetail>(); foreach (ContactDetail scd in CurrentContact.Details) { Label l = new Label(); l.Content = scd.Name; ; l.FontWeight = FontWeights.Bold; mainWindow.ContactDetails.Children.Add(l); EditableField ef = new EditableField(); ef.Label.Content = scd.Value; ef.Changed += ef_Changed; ef.Deleted += ef_Deleted; ef.Tag = scd; mainWindow.ContactDetails.Children.Add(ef); } }
private void ContactName_Changed(EditableField arg1, string arg2) { Controller.ContactList.InvalidateContactList(); }
private void EditableField_Deleted(EditableField obj) { Controller.CurrentContact.Details.Remove(obj.Tag as ContactDetail); ((ContactDetail)obj.Tag).Destroy(); GroupGraph.Update(); }
void ef_Deleted(EditableField obj) { CurrentContact.Details.Remove(obj.Tag as ContactDetail); ContactList.RemoveDetail((obj.Tag as ContactDetail)); FillDetails(); }
void ContactName_Changed(EditableField sender, string value) { Contact c = sender.Tag as Contact; c.Name = value; ContactList.UpdateContact(c); FillContactListbox(); FillDetails(); }
void ContactGroup_Changed(EditableField sender, string value) { Contact c = sender.Tag as Contact; c.Group_ID = ContactList.GetGroupByName(value).ID; ContactList.UpdateContact(c); FillContactListbox(); FillDetails(); }