Forums - C# Corner

Forum guidelines

WPF: How to "draw" a spline.

May 4 2019 4:33 AM
Hi :)
 
I'm trying to create a spline (dynamically, "drawn" by the user) that will connect two nodes in a graph.
I've tried using a path consisting of QuadraticBezierSegments but doing it that way seems to require different XAML setups, depending on the start- and endpoint configuration relative to each others (i.e. if the end point is left of the start point, the curve requires more segments).
 
I need all splines to exit out of the start node going right, and entering the end node from left to right.
 
Is there a better way to do this, or do I absolutely have to create different QuadraticBezierSegment-setups for each spline configuration? 

Answers (2)