Skip to main content
Home Forums Silverlight Programming Programming with .NET - General Invalid PathGeometry data?
4 replies. Latest Post by StefanWick on October 7, 2008.
(0)
endquote
Member
4 points
24 Posts
10-07-2008 1:32 AM |
If I use this markup, I get an error: "Invalid attribute value M0,0 L200,100 L0,100 z for property Figures." But it works fine in Blend and in a WPF app. I'm adding it to a GeometryCollection. Tried a few other random pastes from Blend without luck either.
StefanWick
Contributor
2864 points
438 Posts
10-07-2008 1:50 AM |
Please include the markup that triggered this error.
Thanks, Stefan Wick
10-07-2008 2:01 AM |
Here it is. World derives from Panel and Body derives from ContentControl. Shapes is a DP of type GeometryCollection.
<UserControl x:Class="AgTest.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:box2d="clr-namespace:AgRender;assembly=AgRender" Width="400" Height="300"> <Grid x:Name="LayoutRoot" Background="White"> <box2d:World x:Name="World"> <box2d:Body X="20" x:Name="TestBody"> <Button Width="100" Height="100" /> <box2d:Body.Shapes> <PathGeometry Figures="M0,0 L200,100 L0,100 z" /> </box2d:Body.Shapes> </box2d:Body> </box2d:World> </Grid></UserControl>
10-07-2008 2:03 AM |
It may also be worth noting that if I put an EllipseGeometry or RectangleGeometry in place of the PathGeometry, it works fine.
10-07-2008 7:32 PM |
The PathGeometry.Figures property does not support the path "mini-language" syntax in Silverlight. You have to use the verbose explicit markup to describe those figures in your XAML.