I have a strange error with a simple PathGeometry object, and I cannot figure out how to figure it out. I would appreciate it if someone could explain to me why this is not working.
Here is an example of a work path that draws a small triangle:
<Path Data="M 8,4 L 12,12 4,12 8,4 Z" Stroke="White" />
Here is an example of a path that doesn't seem to work for me:
<Path Stroke="White"> <Path.Data> <PathGeometry Figures="M 8,4 L 12,12 4,12 8,4 Z" /> </Path.Data> </Path>
The line in the data and picture properties is identical, but the last example throws an exception:
Invalid attribute value M 8.4 L 12.12 4.12 8.4 Z for a property.
Ultimately, I would like to make PathGeometry in a ResourceDictionary and specify it as {StaticResource} so that I can reuse my shapes.
Edit:
My solution was to instead of referencing a PathGeometry to a StaticResource instead of referencing a string resource.
<sys:String x:Key="TriangleShape">M 8,4 L 12,12 4,12 8,4 Z</sys:String> ... <Path Data={StaticResource TriangleShape}" />
path windows-phone-7 silverlight pathgeometry
justin.m.chase
source share