tesrt
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
viewtopic.php?t=515#p2637

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

Tags:
 
User avatar
sfernandez
Site Admin
Posts: 1918
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: No registered users and 1 guest