Exemplo n.º 1
0
        public void Invalidate()
        {
            this.EdgeLabel.InvokeInUiThread(() =>
            {
                this.UpdateVisibility(this.Edge);
                if (!this.Edge.IsVisible)
                {
                    return;
                }

                this.EdgePath.Data = VisualsFactory.CreateEdgePath(Edge.GeometryEdge.Curve);

                // arrows should be nulled and removed if they are nor required anymore.
                // revist on graphic property editing
                // --wgross 28.09.2018
                if (this.Edge.Attr.ArrowAtSource)
                {
                    this.SourceArrowHeadPath.Data = VisualsFactory.CreateEdgeSourceArrow(this.Edge.GeometryEdge.EdgeGeometry, this.PathStrokeThickness);
                }
                if (this.Edge.Attr.ArrowAtTarget)
                {
                    this.TargetArrowHeadPath.Data = VisualsFactory.CreateEdgeTargetArrow(this.Edge.GeometryEdge.EdgeGeometry, this.PathStrokeThickness);
                }

                this.SetPathStroke();

                if (VLabel != null)
                {
                    ((IInvalidatable)VLabel).Invalidate();
                }
            });
        }
Exemplo n.º 2
0
        public (FrameworkElement edgeLabel, Path edgePath, Path edgeSourceArrow, Path edgeTargetArrow) SetupEdgeVisuals(FrameworkElement edgeLabel)
        {
            // nope: this must be VLabel//edgeLabel.Tag = this;

            var edgePath = new Path
            {
                Data = VisualsFactory.CreateEdgePath(this.Edge.GeometryEdge.Curve),
                Tag  = this
            };

            var edgeSourceArrow = this.Edge.Attr.ArrowAtSource ?
                                  new Path
            {
                Data = VisualsFactory.CreateEdgeSourceArrow(this.Edge.GeometryEdge.EdgeGeometry, this.PathStrokeThickness),
                Tag  = this
            } : null;

            var edgeTargetArrow = this.Edge.Attr.ArrowAtTarget ?
                                  new Path
            {
                Data = VisualsFactory.CreateEdgeTargetArrow(this.Edge.GeometryEdge.EdgeGeometry, this.PathStrokeThickness),
                Tag  = this
            } : null;

            return(edgeLabel, edgePath, edgeSourceArrow, edgeTargetArrow);
        }