示例#1
0
        private void grid_SelectedCellsChanged(object sender, SelectedCellsChangedEventArgs e)
        {
            AElement obj = grid.SelectedItem as AElement;

            if (obj == null)
            {
                return;
            }
            tree.Items.Clear();
            obj.AddChildsToTree(tree.Items);
            foreach (var it in tree.Items)
            {
                ExpandAll(it as TreeViewItem);
            }
        }
示例#2
0
 public override void AddChildsToTree(ItemCollection items)
 {
     if (target == null)
     {
         items.Add(new TreeViewItem()
         {
             Header = "<ref not loaded>"
         });
         return;
     }
     if (isRecursing)
     {
         return; // Infinite recursion
     }
     isRecursing = true;
     target.AddChildsToTree(items);
     isRecursing = false;
 }