Hello, in Silverlight 3 for Mobile, how do I get at a Path's figure points, so I can ultimately get at it's Points (X, Y coordinates)? From what I've been reading, it sounds like the tree structures of the PathGeometry isn't stored in Silverlight 3 for Mobile (I'm doing this for WP7)... Is there another way around this? All I want is the Points collection of the Path. Below is the code I've written to parse the Path's Segments to get at the Points, BUT, the Figures collection is always empty, so I can't even get at the Segments. I've also tried using XamlReader.load to read in the Path XAML, but that has the same results, an empty Figures collection. I've also pasted the Path XAML below.
Thanks for reading, and hope someone can point me in the right direction :) Tim
private List<Point> getShapePathPoints(Path shapePath)
{
List<Point> shapePathPoints = new List<Point>();
PathGeometry pathGeometry = (PathGeometry)shapePath.Data;
foreach (PathFigure pathFigure in pathGeometry.Figures)
{
foreach (PolyLineSegment segment in pathFigure.Segments)
{
foreach (Point point in segment.Points)
{
shapePathPoints.Add(point);
}
}
}
return shapePathPoints;
}