Skip to content

Shapes and glyphs markup reference

Shape, Line, Rectangle, PathShape, and GlyphElement.

Receiver: GlyphElement.

Method Sets Summary
Foreground(Color value) Foreground Sets the foreground color, backed by ForegroundProperty so it participates in the same inheritance chain as text-bearing ancestors.
GlyphSize(double value) GlyphSize Sets the glyph size in DIPs.
Kind(GlyphKind value) Kind Sets the shape drawn.
StrokeThickness(double value) StrokeThickness Sets the stroke thickness in DIPs.

Receiver: Shape and derived types (where T : Shape).

Method Sets Summary
Fill(Brush value) Fill Sets the brush used to fill the shape interior; null draws no fill.
Fill(Color color) Fill Sets the fill to a solid color.
Stretch(Stretch value) Stretch Sets how the geometry is stretched to fill the available space; the default is None.
Stroke(Brush brush, double thickness = 1) Stroke, StrokeThickness Sets the stroke brush and thickness.
Stroke(Color color, double thickness = 1) Stroke, StrokeThickness Sets the stroke to a solid color with the given thickness.
StrokeStyle(StrokeStyle value) StrokeStyle Sets the stroke style (line cap, line join, dash pattern).
StrokeThickness(double value) StrokeThickness Sets the stroke thickness in DIPs.
Viewbox(Rect? value) Viewbox Sets the source rectangle a stretch maps onto the element, in the geometry’s own coordinates; null uses the geometry’s ink bounds.

Receiver: Line and derived types (where T : Line).

Method Sets Summary
Points(double x1, double y1, double x2, double y2) X1, Y1, X2, Y2 Sets the line start and end points.
X1(double value) X1 Sets the X coordinate of the start point in DIPs.
X2(double value) X2 Sets the X coordinate of the end point in DIPs.
Y1(double value) Y1 Sets the Y coordinate of the start point in DIPs.
Y2(double value) Y2 Sets the Y coordinate of the end point in DIPs.

Receiver: PathShape and derived types (where T : PathShape).

Method Sets Summary
Data(PathGeometry value) Data Sets the geometry that defines this path; null draws nothing.
Data(string svgPathData) Data Sets the path data from an SVG path data string.

Receiver: Rectangle and derived types (where T : Rectangle).

Method Sets Summary
CornerRadius(double radius) Sets equal corner radius for both axes.
CornerRadius(double radiusX, double radiusY) RadiusX, RadiusY Sets the corner radii.
RadiusX(double value) RadiusX Sets the X-axis corner radius in DIPs.
RadiusY(double value) RadiusY Sets the Y-axis corner radius in DIPs.