Topic Author
Posts: 7
Joined: 08 Mar 2020, 15:17

How to set data to a Path

05 Apr 2020, 15:13

How can I set Data to a path
I'm looking at this post

But for me 'Path' does not contain a definition for 'SetData'.
What am I missing ?

User avatar
Site Admin
Posts: 2336
Joined: 22 Dec 2011, 19:20

Re: How to set data to a Path

06 Apr 2020, 10:22

Hi, our API has evolved a lot since that post, making it more compatible with WPF. Now you can set the Data geometry as a property:
Path arc = new Path;

StreamGeometry geometry = new StreamGeometry();
using (StreamGeometryContext context = geom.Open())
    context.BeginFigure(startPoint, false, false);
    context.ArcTo(enPoint, arcSize, rotationAngle, isLargeArc, SweepDirection.Clockwise, false, false);

arc.Data = geometry;

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 0 guests