/// <summary> /// Updates the link between the main shape and the dependency shape. /// </summary> /// <param name="shape"></param> /// <param name="bSource"></param> protected virtual void UpdateLink(GraphicalDependencyShape shape, bool bSource) { GraphicalDependencyLinkShape linkShape = new GraphicalDependencyLinkShape(this.Store); linkShape.Element = shape.Element; linkShape.SourceAnchor = new SourceAnchor(this.Store); if (bSource) { linkShape.SourceAnchor.FromShape = shape; } else { linkShape.SourceAnchor.FromShape = this.Diagram.MainElementShape; } linkShape.TargetAnchor = new TargetAnchor(this.Store); if (bSource) { linkShape.TargetAnchor.ToShape = this.Diagram.MainElementShape; } else { linkShape.TargetAnchor.ToShape = shape; } linkShape.RoutingMode = RoutingMode.Orthogonal; linkShape.DependencyShape = shape; linkShape.MainShape = this.Diagram.MainElementShape; this.Diagram.UpdateLinkShapePosition(linkShape, shape, this.Diagram.MainElementShape, bSource); this.Diagram.LinkShapes.Add(linkShape); }
/// <summary> /// Constuctor. /// </summary> /// <param name="viewModelStore">The store this view model belongs to.</param> /// <param name="diagram">The Diagram this item belongs to.</param> /// <param name="shapeElement">Model element, that is hosted by this view model.</param> public GraphicalDependencyLinkViewModel(ViewModelStore viewModelStore, DiagramSurfaceViewModel diagram, GraphicalDependencyLinkShape shapeElement) : base(viewModelStore, diagram, shapeElement) { }