ToShortLength not working

Hello! I’m trying to implement the Short Length property, but does not work … I pass code

                    <go:Route 
                        Curve="{Binding Path=Data.Curve, Mode=TwoWay}" 
                        Corner="{Binding Path=Data.Corner, Mode=TwoWay}" 
                        Routing="{Binding Path=Data.Routing, Mode=TwoWay}" 
                        Curviness="{Binding Path=Data.Curviness, Mode=TwoWay}" 
                        Smoothness="{Binding Path=Data.Smoothness, Mode=TwoWay}" 
                        ToShortLength="{Binding Path=Data.ToShortLength, Mode=TwoWay}"
                        FromShortLength="{Binding Path=Data.FromShortLength, Mode=TwoWay}"
                        RelinkableFrom="True" RelinkableTo="True" />
                </go:Link.Route>

and the event in c# is:

                        (part.Data as Enlace).ToShortLength = 50; 
                        (part.Data as Enlace).FromShortLength = 50; 

and result is:

Can help me please?

The “short length” is limited by the length of the last segment (Route.ToEndSegmentLength or Node.GetToEndSegmentLength of the port element), which defaults to 10. So setting it to 50 or 9999 would not result in a link path that was any shorter than it is now.

And it looks as if it actually is about 10 diagram coordinate units “short” from the tip of the arrowhead, assuming the diagram is zoomed in more than normal. So I think it is working correctly.

Sorry but how i can to fix the last graph because i want that be most beautiful

Because i want that the arrow is separate from the line

I just mentioned that the ToShortLength is limited by the ToEndSegmentLength, so I would increase the ToEndSegmentLength.

yes, but i change the value:

                    <go:Route 
                        Curve="{Binding Path=Data.Curve, Mode=TwoWay}" 
                        Corner="{Binding Path=Data.Corner, Mode=TwoWay}" 
                        Routing="{Binding Path=Data.Routing, Mode=TwoWay}" 
                        Curviness="{Binding Path=Data.Curviness, Mode=TwoWay}" 
                        Smoothness="{Binding Path=Data.Smoothness, Mode=TwoWay}" 
                        ToShortLength="{Binding Path=Data.ToShortLength, Mode=TwoWay}"
                        FromShortLength="{Binding Path=Data.FromShortLength, Mode=TwoWay}"
                        ToEndSegmentLength ="{Binding Path=Data.ToEndSegmentLength, Mode=TwoWay}"
                        FromEndSegmentLength ="{Binding Path=Data.FromEndSegmentLength , Mode=TwoWay}"
                        RelinkableFrom="True" RelinkableTo="True" />

Event:
(part.Data as Enlace).ToEndSegmentLength = 150;
(part.Data as Enlace).FromEndSegmentLength = 150;
(part.Data as Enlace).ToShortLength = 50;
(part.Data as Enlace).FromShortLength = 50;

and i have this result


with FROM its work, but with TO its not working… why?

Interesting – that appears to be a bug only when the routing is orthogonal and the curve is Bezier. It works correctly for regular orthogonal links, with or without any jumps. Thanks for reporting the bug.

Ok. but i have other problem… when i execute this event:

                        (part.Data as Enlace).ToShortLength = 10;
                        (part.Data as Enlace).FromShortLength = 10; 

the graph is broken with ARROW OF TO… you can watch this problem in this video


can you help me please?

I just tried this, and it worked well for me.

Here’s the relevant part of my Link template:

        <go:Link.Route>
          <go:Route Routing="Orthogonal" Corner="4" Curve="JumpOver" 
                    FromEndSegmentLength="40" FromShortLength="20"
                    ToEndSegmentLength="40" ToShortLength="{Binding Path=Data.Param, Mode=TwoWay}"
                    RelinkableFrom="True" RelinkableTo="True" />
        </go:Link.Route>

Here’s my Button click event:

    private void Button_Click_1(object sender, RoutedEventArgs e) {
      var link = myDiagram.SelectedLink;
      if (link != null) {
        myDiagram.StartTransaction("change link");
        ((Wire)link.Data).Param += 10.0;  // requires setter calling RaisePropertyChanged
        //link.Route.ToShortLength += 10.0;  // requires TwoWay Binding
        myDiagram.CommitTransaction("change link");
      }
    }

I tried implementing the change to Route.ToShortLength both ways – modifying a link data property named “Param” and modifying the link.Route.ToShortLength property directly. The latter is commented out above.

Both ways worked just fine.