public void AddExistingComponent(BusinessRuleComponentVO comp) { if (_selectedNode is BusinessRuleNodeVO) { BusinessRuleNodeVO parentNode = (BusinessRuleNodeVO)_selectedNode; if (parentNode.ComponentList == null) { parentNode.ComponentList = new ObservableCollection <BusinessRuleComponentVO>(); } //If the comp has no children then add them so the tree can update. if (comp.Children == null) { comp.Children = new ObservableCollection <BusinessRuleComponentVO>(); } RulesHelper.PopulateComponentHeirarchy(comp); parentNode.ComponentList.Add(comp); _tracker.ChangedRules.Add(parentNode); _tracker.SaveChangesToWorkingFile(); ControlHelper.TreeViewHelper.ExpandAndSelectTreeItem(this.treeRules, comp); } }