Пример #1
0
 public override void UpdateEdge(bool updateLabel = true)
 {
     if (!ShowArrows)
     {
         if (EdgePointerForTarget != null)
         {
             EdgePointerForTarget?.Hide();
             EdgePointerForTarget = null;
         }
         if (EdgePointerForSource != null)
         {
             EdgePointerForSource?.Hide();
             EdgePointerForSource = null;
         }
     }
     base.UpdateEdge(updateLabel);
     if (((VisualEdge)Edge).Edge.Weight == null)
     {
         EdgeLabelControl?.Hide();
     }
     else
     {
         EdgeLabelControl?.Show();
     }
 }
Пример #2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (!ShowArrows)
            {
                // Hide arrow
                EdgePointerForSource?.Hide();
                EdgePointerForTarget?.Hide();

                // Force line length to connect source/target
                _linegeometry = new PathGeometry(new[]
                {
                    new PathFigure(Source.GetCenterPosition(), new [] {
                        new LineSegment(Target.GetCenterPosition(), isStroked: true)
                    }, closed: false)
                });

                LinePathObject.Data = _linegeometry;
            }
        }