/// <summary> /// Adds a new reference rs view model for the given rs node. /// </summary> /// <param name="node">Rs node.</param> public void AddReferenceRSNode(ReferenceRSNode node) { // verify that node hasnt been added yet foreach (ReferenceRSNodeViewModel viewModel in this.referenceRSNodeVMs) if (viewModel.ReferenceRSNode.Id == node.Id) return; ReferenceRSNodeViewModel vm = new ReferenceRSNodeViewModel(this.ViewModelStore, node, this); this.referenceRSNodeVMs.Add(vm); foreach (ReferenceRSNodeViewModel viewModel in this.referenceRSNodeVMs) viewModel.UpdateNodePosition(); OnPropertyChanged("HasReferenceNodes"); }
/// <summary> /// Constuctor. /// </summary> /// <param name="viewModelStore">The store this view model belongs to.</param> /// <param name="referenceNode">Reference node.</param> /// <param name="parent">Parent.</param> public ReferenceNodeViewModel(ViewModelStore viewModelStore, ReferenceNode referenceNode, ReferenceRSNodeViewModel parent) : base(viewModelStore, referenceNode, parent.Parent) { this.parentTreeNode = parent; }
/// <summary> /// Constuctor. /// </summary> /// <param name="viewModelStore">The store this view model belongs to.</param> /// <param name="shapeRelationshipNode">ShapeRelationshipNode.</param> /// <param name="parent">Parent.</param> public ShapeRelationshipNodeViewModel(ViewModelStore viewModelStore, ShapeRelationshipNode shapeRelationshipNode, ReferenceRSNodeViewModel parent) : base(viewModelStore, shapeRelationshipNode.RelationshipShapeClass) { this.shapeRelationshipNode = shapeRelationshipNode; this.parentTreeNode = parent; }