Partager via


GradientStopCollection

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

Represents a collection of GradientStop objects that can be individually accessed by index.

<GradientStopCollection   ...>
  oneOrMoreGradientStops
</GradientStopCollection>

XAML Values

Value

Description

oneOrMoreGradientStops

One or more GradientStop object elements.

Managed Equivalent

GradientStopCollection

Remarks

The LinearGradientBrush and RadialGradientBrush objects use GradientStopCollection to store GradientStop information.

GradientStopCollection defines no methods or properties beyond the basic Collection methods and properties. Methods such as Add or GetItem will expect or return objects that are of type LinearGradientBrush or RadialGradientBrush.

The XAML syntax for properties that use a GradientStopCollection is an example of implicit collection syntax, in which you can omit an actual GradientStopCollection object element. 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 through script later.

For more information on basic concepts, see Brushes. Note that the Brushes topic is written primarily for users of the managed API, and may not have code examples or specific information that address the JavaScript API scenarios.