How to draw a circle divided by one third in XAML?

In my WPF application, I would like to draw a circle divided into three equal arcs, such as a peace symbol or a pie chart.

In other words, I would like to do this: http://i.stack.imgur.com/7Mxwn.jpg

I know how to create System.Windows.Shapes. The path for it is in the code, but not how to do it in XAML.

What is the proper XAML markup for creating a Path element for such a form?

Update : the answers received make me understand that I do not understand what I am looking for: I would like to have a Geometry object (one path or geometry) for each one of three closed sectors (pie slices).

+5
source share
2 answers

, , :

<Image Width="200" Height="200">
    <Image.Source>
        <DrawingImage>
            <DrawingImage.Drawing>
                <GeometryDrawing>
                    <GeometryDrawing.Pen>
                        <Pen Brush="Red"/>
                    </GeometryDrawing.Pen>
                    <GeometryDrawing.Geometry>
                        <GeometryGroup>
                        <PathGeometry>
                            <PathFigure StartPoint="100,100">
                                <PathFigure.Segments>
                                    <LineSegment Point="100,0"/>
                                </PathFigure.Segments>
                            </PathFigure>
                        </PathGeometry>
                        <PathGeometry>
                            <PathFigure StartPoint="100,100">
                                <PathFigure.Segments>
                                    <LineSegment Point="186.6,150"/>
                                </PathFigure.Segments>
                            </PathFigure>
                        </PathGeometry>
                        <PathGeometry>
                            <PathFigure StartPoint="100,100">
                                <PathFigure.Segments>
                                    <LineSegment Point="13.4,150"/>
                                </PathFigure.Segments>
                            </PathFigure>
                        </PathGeometry>
                        <EllipseGeometry Center="100,100" RadiusX="100" RadiusY="100"/>

                        </GeometryGroup>
                    </GeometryDrawing.Geometry>
                </GeometryDrawing>
            </DrawingImage.Drawing>
        </DrawingImage>
    </Image.Source>
</Image>

enter image description here

- :

<GeometryGroup>
    <PathGeometry Figures="M100,100 L100,0"/>
    <PathGeometry Figures="M100,100 L186.6,150"/>
    <PathGeometry Figures="M100,100 L13.4,150"/>
    <EllipseGeometry Center="100,100" RadiusX="100" RadiusY="100"/>
</GeometryGroup>

, .

ArcSegments, .

: ArcSegment:

<Image Width="200" Height="200" Margin="20">
    <Image.Source>
        <DrawingImage>
            <DrawingImage.Drawing>
                <DrawingGroup>

                    <GeometryDrawing Brush="Red">
                        <GeometryDrawing.Pen>
                            <Pen Brush="Black" />
                        </GeometryDrawing.Pen>
                        <GeometryDrawing.Geometry>
                            <PathGeometry>
                                <PathFigure StartPoint="100,100">
                                    <PathFigure.Segments>
                                        <LineSegment Point="100,0"/>
                                        <ArcSegment Point="186.6,150"  SweepDirection="Clockwise" Size="100,100"/>
                                        <LineSegment Point="100,100"/>
                                    </PathFigure.Segments>
                                </PathFigure>
                            </PathGeometry>
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>

                    <GeometryDrawing Brush="Blue">
                        <GeometryDrawing.Pen>
                            <Pen Brush="Black"/>
                        </GeometryDrawing.Pen>
                        <GeometryDrawing.Geometry>
                            <PathGeometry>
                                <PathFigure StartPoint="100,100">
                                    <PathFigure.Segments>
                                        <LineSegment Point="186.6,150"/>
                                        <ArcSegment Point="13.4,150" SweepDirection="Clockwise" Size="100,100"/>
                                        <LineSegment Point="100,100"/>
                                    </PathFigure.Segments>
                                </PathFigure>
                            </PathGeometry>
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>

                    <GeometryDrawing Brush="Green">
                        <GeometryDrawing.Pen>
                            <Pen Brush="Black"/>
                        </GeometryDrawing.Pen>
                        <GeometryDrawing.Geometry>
                            <PathGeometry>
                                <PathFigure StartPoint="100,100">
                                    <PathFigure.Segments>
                                        <LineSegment Point="13.4,150"/>
                                        <ArcSegment Point="100,0" SweepDirection="Clockwise" Size="100,100"/>
                                        <LineSegment Point="100,100"/>
                                    </PathFigure.Segments>
                                </PathFigure>
                            </PathGeometry>
                        </GeometryDrawing.Geometry>
                    </GeometryDrawing>

                </DrawingGroup>
            </DrawingImage.Drawing>
        </DrawingImage>
    </Image.Source>
</Image>

enter image description here

:

<GeometryDrawing Brush="Red" Geometry="M100,100 L100,0 A100,100,0,0,1,186.6,150 L100,100"/>
<GeometryDrawing Brush="Blue" Geometry="M100,100 L186.6,150 A100,100,0,0,1,13.4,150 L100,100"/>
<GeometryDrawing Brush="Green" Geometry="M100,100 L13.4,150 A100,100,0,0,1,100,0 L100,100"/>

, ArcSegment.Size , "100 100", .

+17

, , . :

    <Path Width="200" Height="200" Stroke="Black" StrokeThickness="3" Stretch="Uniform">
        <Path.Data>
            <GeometryGroup>
                <EllipseGeometry Center="1,1" RadiusX="1" RadiusY="1"/>
                <LineGeometry StartPoint="1,1" EndPoint="1,0"/>
                <LineGeometry StartPoint="1,1" EndPoint="1.866,1.5"/>
                <LineGeometry StartPoint="1,1" EndPoint="0.134,1.5"/>
            </GeometryGroup>
        </Path.Data>
    </Path>
+2

All Articles