Exemple #1
0
 public void SetTargetPortForEdgeRouting(Point portLocation)
 {
     if (TargetPortCircle == null)
     {
         TargetPortCircle = CreatePortPath();
         GraphCanvas.Children.Add(TargetPortCircle);
     }
     TargetPortCircle.Width           = TargetPortCircle.Height = UnderlyingPolylineCircleRadius;
     TargetPortCircle.StrokeThickness = TargetPortCircle.Width / 10;
     Wpf2MsaglConverters.PositionFrameworkElement(TargetPortCircle, portLocation, 1);
 }
Exemple #2
0
        public KosmographViewerEdge(DrawingEdge edge, FrameworkElement labelFrameworkElement)
        {
            this.Edge     = edge;
            this.EdgePath = new Path
            {
                Data = VisualsFactory.CreateEdgePath(this.Edge.GeometryEdge.Curve),
                Tag  = this
            };

            (this.EdgeLabel, this.EdgePath, this.SourceArrowHeadPath, this.TargetArrowHeadPath) = this.SetupEdgeVisuals(labelFrameworkElement);
            this.SetPathStroke();

            Wpf2MsaglConverters.PositionFrameworkElement(this.EdgeLabel, this.Edge.Label.Center, 1);

            // events sent from the MSAGL graphs
            this.Edge.Attr.VisualsChanged += (a, b) => Invalidate();
            this.Edge.IsVisibleChanged    += this.UpdateVisibility;
        }
        private Rectangle SetGraphBackgroundSize(Rectangle graphBackground)
        {
            if (this.GeometryGraph is null)
            {
                return(graphBackground);
            }

            // Canvas.SetLeft(_rectToFillGraphBackground, geomGraph.Left);
            // Canvas.SetTop(_rectToFillGraphBackground, geomGraph.Bottom);
            graphBackground.Width  = this.GeometryGraph.Width;
            graphBackground.Height = this.GeometryGraph.Height;
            graphBackground.Fill   = this.Graph.Attr.BackgroundColor.ToWpf();

            Panel.SetZIndex(graphBackground, -1);

            Wpf2MsaglConverters.PositionFrameworkElement(graphBackground, this.GeometryGraph.BoundingBox.Center, 1);

            return(graphBackground);
        }