Exemplo n.º 1
0
 private void OnRefreshClick(object sender, RoutedEventArgs e)
 {
     treeView.Items.Clear();
     foreach (Contact contact in Contact.GetContacts())
     {
         ContactTreeNode contactTreeNode = new ContactTreeNode(contact);
         treeView.Items.Add(contactTreeNode);
     }
 }
Exemplo n.º 2
0
        private void OnAddContactClick(object sender, RoutedEventArgs e)
        {
            Contact contact = new Contact {
                FirstName = "New", LastName = "Contact"
            };
            ContactTreeNode contactTreeNode = new ContactTreeNode(contact);

            treeView.Items.Add(contactTreeNode);
            contactTreeNode.IsSelected = true;
        }
Exemplo n.º 3
0
        private void treeView_SelectedItemChanged(object sender, RoutedEventArgs e)
        {
            detailPanel.Children.Clear();

            ContactTreeNode contactTreeNode = treeView.SelectedItem as ContactTreeNode;

            if (contactTreeNode != null)
            {
                detailPanel.Children.Add(new ContactControl(contactTreeNode.Contact));
            }
        }
Exemplo n.º 4
0
        protected override void OnInitialized(EventArgs e)
        {
            base.OnInitialized(e);

            Entity.Initialize();

            foreach (Contact contact in Contact.GetContacts())
            {
                ContactTreeNode contactTreeNode = new ContactTreeNode(contact);
                treeView.Items.Add(contactTreeNode);
            }
        }