예제 #1
0
파일: App.xaml.cs 프로젝트: Ozerich/labs
 public void ef_Changed(EditableField sender, string value)
 {
     (sender.Tag as ContactDetail).Value = value;
     ContactList.UpdateContactDetail((sender.Tag as ContactDetail));
     FillContactListbox();
     FillDetails();
 }
예제 #2
0
파일: App.xaml.cs 프로젝트: Ozerich/labs
        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);
            }
        }
예제 #3
0
 private void ContactName_Changed(EditableField arg1, string arg2)
 {
     Controller.ContactList.InvalidateContactList();
 }
예제 #4
0
 private void EditableField_Deleted(EditableField obj)
 {
     Controller.CurrentContact.Details.Remove(obj.Tag as ContactDetail);
     ((ContactDetail)obj.Tag).Destroy();
     GroupGraph.Update();
 }
예제 #5
0
파일: App.xaml.cs 프로젝트: Ozerich/labs
 void ef_Deleted(EditableField obj)
 {
     CurrentContact.Details.Remove(obj.Tag as ContactDetail);
     ContactList.RemoveDetail((obj.Tag as ContactDetail));
     FillDetails();
 }
예제 #6
0
파일: App.xaml.cs 프로젝트: Ozerich/labs
 void ContactName_Changed(EditableField sender, string value)
 {
     Contact c = sender.Tag as Contact;
     c.Name = value;
     ContactList.UpdateContact(c);
     FillContactListbox();
     FillDetails();
 }
예제 #7
0
파일: App.xaml.cs 프로젝트: Ozerich/labs
        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();
        }
예제 #8
0
 private void EditableField_Deleted(EditableField obj)
 {
     Controller.CurrentContact.Details.Remove(obj.Tag as ContactDetail);
     ((ContactDetail)obj.Tag).Destroy();
     GroupGraph.Update();
 }
예제 #9
0
 private void ContactName_Changed(EditableField arg1, string arg2)
 {
     Controller.ContactList.InvalidateContactList();
 }