Stroke Property

Gets or sets the Brush that specifies how to paint the Shape outline.

XAML
<object Stroke="Color" .../>
-or-
<object>
  <object.Stroke>
    <Brush .../>
  </object.Stroke>
</object>
Scripting
value = object.Stroke
object.Stroke = value

XAML Values

Color The Color for a SolidColorBrush expressed as an attribute string. See Color.
Brush Within opening and closing property elements for object.Stroke, exactly one object element for an object that derives from Brush. The object element can be one of the following: LinearGradientBrush, RadialGradientBrush, ImageBrush, SolidColorBrush, VideoBrush.

Property Value

Brush

A Brush that specifies how the Shape outline is painted.

This property is read/write. The default value is null.

Remarks

Setting the Stroke for a line (Line or Polyline) defines its entire brush-defined appearance. Setting Fill for a line has no effect.

Some brush types (SolidColorBrush) support a XAML attribute syntax, whereas other brush types (ImageBrush, LinearGradientBrush, RadialGradientBrush) only support an object element syntax. This is why two versions of XAML syntax are shown for this property.

Applies To

Ellipse, Line, Path, Polygon, Polyline, Rectangle, Shape

See Also

Shapes Overview
Silverlight Brushes Overview
Object Layout in Silverlight

Community Additions

Show: