It seems that there is no straight forward approach of converting a geometry to a single PathFigure. To achieve this you can convert the Geometry to PathGeometry and then put all segments of all figures of the geometry to the Segments collection of a new PathFigure object. However, using this approach you will probably need to include additional segments because the final figure won't be the one you are expecting.
Another approach could be to create the formatted text geometry in the CreateGometry() override and merge its Figures collection with the line geometry's Figures. For example:
CustomConnection : RadDiagramConnection
System.Windows.Media.PathFigure CreateTargetCapGeometry(System.Windows.Point startPoint, System.Windows.Point endPoint,
.targetCapGeometryStart = startPoint;
Geometry CreateGeometry(Telerik.Windows.Diagrams.Core.BridgeType bridgeType,
var geometry =
FormattedText formattedText =
), 32, Brushes.Black);
var capGeometry = PathGeometry.CreateFromGeometry(formattedText.BuildGeometry(
var pathGeometry = (PathGeometry)geometry;
I hope this is useful.
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Telerik Feedback Portal
and vote to affect the priority of the items