コード例 #1
0
        public VEdge(Edge edge, FrameworkElement labelFrameworkElement, Func <double> pathStrokeThicknessFunc)
        {
            Edge = edge;

            PathStrokeThicknessFunc = pathStrokeThicknessFunc;

            CurvePath = new Path
            {
                Data = GetICurveGeometry(edge.GeometryEdge.Curve),
                Tag  = this
            };

            EdgeAttrClone = edge.Attr.Clone();

            if (edge.Attr.ArrowAtSource)
            {
                SourceArrowHeadPath = new Path
                {
                    Data = DefiningSourceArrowHead(),
                    Tag  = this
                }
            }
            ;

            if (edge.Attr.ArrowAtTarget)
            {
                TargetArrowHeadPath = new Path
                {
                    Data = DefiningTargetArrowHead(Edge.GeometryEdge.EdgeGeometry, PathStrokeThickness),
                    Tag  = this
                }
            }
            ;

            SetPathStroke();

            if (labelFrameworkElement != null)
            {
                LabelFrameworkElement = labelFrameworkElement;
                Common.PositionFrameworkElement(LabelFrameworkElement, edge.Label.Center, 1);
            }
            edge.Attr.VisualsChanged += (sender, args) => Invalidate();

            edge.IsVisibleChanged += obj =>
            {
                foreach (var frameworkElement in FrameworkElements)
                {
                    frameworkElement.Visibility = edge.IsVisible ? Visibility.Visible : Visibility.Collapsed;
                }
            };
        }
コード例 #2
0
 public override string ToString()
 {
     return(Edge.ToString());
 }
コード例 #3
0
 public VEdge(Edge edge, LgLayoutSettings lgSettings)
 {
     Edge          = edge;
     EdgeAttrClone = edge.Attr.Clone();
 }