Skip to main content

Microsoft Silverlight

Answered Question Invalid PathGeometry data?RSS Feed

(0)

endquote
endquote

Member

Member

4 points

24 Posts

Invalid PathGeometry data?

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
StefanWick

Contributor

Contributor

2864 points

438 Posts

Microsoft

Re: Invalid PathGeometry data?

Please include the markup that triggered this error.

Thanks, Stefan Wick

Microsoft Silverlight | http://blogs.msdn.com/swick/

endquote
endquote

Member

Member

4 points

24 Posts

Re: Invalid PathGeometry data?

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>

endquote
endquote

Member

Member

4 points

24 Posts

Re: Re: Invalid PathGeometry data?

It may also be worth noting that if I put an EllipseGeometry or RectangleGeometry in place of the PathGeometry, it works fine.

StefanWick
StefanWick

Contributor

Contributor

2864 points

438 Posts

Microsoft
Answered Question

Re: Re: Invalid PathGeometry data?

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.

Thanks, Stefan Wick

Microsoft Silverlight | http://blogs.msdn.com/swick/
  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities