Reputation: 15
WPF beginner here...
Please explain why the third Path in this XAML document is not being rendered in the window. The first and second paths render as they should, but the third does not.
<Canvas>
<Path Stroke="Blue" StrokeThickness="5" Canvas.Top="20">
<Path.Data>
<PathGeometry>
<PathFigure StartPoint="10, 10">
<BezierSegment Point1="130,30" Point2="40,140" Point3="150,150"></BezierSegment>
</PathFigure>
</PathGeometry>
</Path.Data>
</Path>
<Path Stroke="Green" StrokeThickness="2" StrokeDashArray="5 2" Canvas.Top="20">
<Path.Data>
<GeometryGroup>
<LineGeometry StartPoint="10,10" EndPoint="130,30"></LineGeometry>
<LineGeometry StartPoint="40,140" EndPoint="150,150"></LineGeometry>
</GeometryGroup>
</Path.Data>
</Path>
<!-- This path is not being rendered for some reason -->
<Path Fill="Red" StrokeThickness="8" Canvas.Top="20">
<Path.Data>
<GeometryGroup>
<EllipseGeometry Center="130 30"></EllipseGeometry>
<EllipseGeometry Center="40 140"></EllipseGeometry>
</GeometryGroup>
</Path.Data>
</Path>
</Canvas>
Upvotes: 0
Views: 45
Reputation:
You are missing Stroke="Red":
<Path Fill="Red" Stroke="Red" StrokeThickness="8" Canvas.Top="20">
<Path.Data>
<GeometryGroup>
<EllipseGeometry Center="130 30"></EllipseGeometry>
<EllipseGeometry Center="40 140"></EllipseGeometry>
</GeometryGroup>
</Path.Data>
</Path>
You could also experiment like this:
<Path Fill="Blue" Stroke="Red" StrokeThickness="2" Canvas.Top="20">
<Path.Data>
<GeometryGroup>
<EllipseGeometry Center="130 30" RadiusX="5" RadiusY="5"></EllipseGeometry>
<EllipseGeometry Center="40 140" RadiusX="5" RadiusY="5"></EllipseGeometry>
</GeometryGroup>
</Path.Data>
</Path>
Upvotes: 1