public ComponentTreeViewViewModel(CoatOfArmComponent root) { RootForTreeView = new ObservableCollection<CoatOfArmComponent> { root }; //_searchCommand = new SearchFamilyTreeCommand(this); }
/// <summary> /// Removes the child. If it exists in the collection /// </summary> /// <param name="child">The child.</param> public virtual void RemoveChild(CoatOfArmComponent child) { if (Children == null) return; Children.Remove(child); }
/// <summary> /// Adds the child to the list of children (the child is added only if it does not already exist). /// </summary> /// <param name="child">The child.</param> public virtual void AddChild(CoatOfArmComponent child) { if (Children != null && !Children.Any(ch => ch == child)) Children.Add(child); }