I have set the routing to Orthogonal. The link reshaping does not work as I would expect it to. It seems to be missing the vertices nearest the ends of the links and only allows moving the other central vertices either horizontally or vertically but not both.
I want vertices at the ends of the links that only allow horizontal moves and central vertices that move both horizontally and vertically.
I attempted to override the UpdateAdornments method in the LinkReshapingTool. I was able to get the vertices at the ends of the links acting like I want. However, the vertices between these now do not move at all even though the ReshapeBehavior is set to ReshapeBehavior.All.
public override void UpdateAdornments(Part part) { Link link = part as Link; if (link == null) return; // no Nodes Adornment adornment = null; if (link.IsSelected) { FrameworkElement selelt = link.Path; if (selelt != null && link.CanReshape() && Part.IsVisibleElement(selelt)) { adornment = link.GetAdornment(ToolCategory); if (adornment == null) { Route route = link.Route; IEnumerable<Point> pts = route.Points; int numpts = route.PointsCount; if (numpts < 2) return; // this Adornment consists of a LinkPanel holding a bunch of ToolHandles LinkPanel panel = new LinkPanel(); int firstindex = route.FirstPickIndex; int lastindex = route.LastPickIndex; for (int i = firstindex; i <= lastindex; i++) { //if (i > firstindex) //{ // the handle at each vertex point: FrameworkElement h = new ToolHandle() { Width = 6, Height = 6, Fill = Brushes.Yellow, Stroke = Brushes.Black, StrokeThickness = 1 }; NodePanel.SetFigure(h, NodeFigure.Rectangle); // identify the segment for this particular handle LinkPanel.SetIndex(h, i); // allow reshape behavior if not at either end if (i == firstindex || i == lastindex) { SetReshapeBehavior(h, ReshapeBehavior.Horizontal); h.Cursor = Cursors.SizeWE; } else { SetReshapeBehavior(h, ReshapeBehavior.All); h.Cursor = Cursors.SizeAll; } panel.Children.Add(h); } adornment = new Adornment(); adornment.AdornedElement = selelt; adornment.Category = ToolCategory; adornment.Content = panel; // just provide the FrameworkElement as the Content and as the Visual Child adornment.LocationSpot = Spot.TopLeft; } } if (adornment != null) { Point loc = link.GetElementPoint(selelt, Spot.TopLeft); adornment.Position = loc; //adornment.RotationAngle = link.GetAngle(selelt); adornment.Remeasure(); } } link.SetAdornment(ToolCategory, adornment); } }Do you have any suggestions?