Path::Data Property
Gets or sets a Geometry that specifies the shape to be drawn.
Assembly: PresentationFramework (in PresentationFramework.dll)
To draw simple shapes, use the EllipseGeometry, LineGeometry, and RectangleGeometry objects. To draw curves, arcs, or complex shapes, use the PathGeometry object. To create a composite geometry, use a GeometryGroup. To combine geometries, use a CombinedGeometry.
<Path>
<Path.Data>
singleGeometry
</Path.Data>
</Path>
<object Data="moveAndDrawCommands"/>
- singleGeometry
A single object element that derives from Geometry. This can be one of the following:
One of the simple geometries EllipseGeometry, LineGeometry, or RectangleGeometry.
A single GeometryGroup, which supports other geometries as child elements. See XAML Values section for GeometryGroup.
A PathGeometry, which supports child object elements that establish a path geometry object model of figures and segments. See XAML Values section for PathGeometry.
- moveAndDrawCommands
One or more move and draw commands. For the complete syntax, see Path Markup Syntax.
Identifier field | |
Metadata properties set to true |
The following example shows how to create a Path element and set the Data property by using code.
//Add the Path Element myPath = gcnew Path(); myPath->Stroke = Brushes::Black; myPath->Fill = Brushes::MediumSlateBlue; myPath->StrokeThickness = 4; myPath->HorizontalAlignment = HorizontalAlignment::Left; myPath->VerticalAlignment = VerticalAlignment::Center; EllipseGeometry^ myEllipseGeometry = gcnew EllipseGeometry(); myEllipseGeometry->Center = Point(50, 50); myEllipseGeometry->RadiusX = 25; myEllipseGeometry->RadiusY = 25; myPath->Data = myEllipseGeometry; myGrid->Children->Add(myPath);
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0