Compartir a través de


GradientBrush.GradientStops Property

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Gets or sets the brush's gradient stops.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

Syntax

'Declaration
Public Property GradientStops As GradientStopCollection
public GradientStopCollection GradientStops { get; set; }
<gradientBrush>
  oneOrMoreGradientStops
</gradientBrush>

XAML Values

  • oneOrMoreGradientStops
    One or more GradientStop objects, declared using object element syntax.

Property Value

Type: System.Windows.Media.GradientStopCollection
A collection of the GradientStop objects associated with the brush, each of which specifies a color and an offset along the brush's gradient axis. The default is an empty GradientStopCollection.

Remarks

Dependency property identifier field: GradientStopsProperty

The XAML syntax for GradientStops is an example of an implicit collection syntax, where you can omit the GradientStopCollection object element, as well as the brushobject.GradientStops property element. Instead, you generally include one or more GradientStop object elements as child elements of a practical GradientBrush. For more information about XAML implicit collection syntax, see XAML Overview. (Explicitly including a GradientStopCollection object element is permissible XAML syntax, and might be useful if you intend to name the collection in XAML and manipulate its contents later.)

Generally a GradientStopCollection contains a minimum of two gradient stops.

Version Information

Silverlight

Supported in: 5, 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

See Also

Reference

Other Resources