GradientBrush GradientBrush GradientBrush Class


An abstract class that describes a gradient, composed of gradient stops. Parent class for LinearGradientBrush.

public class GradientBrush : Brush, IGradientBrushpublic class GradientBrush : Brush, IGradientBrushPublic Class GradientBrush Inherits Brush Implements IGradientBrush
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Inherited Members

Inherited methods

Inherited properties


You describe the color composition of a LinearGradientBrush using the GradientStops property. Each GradientStop therein expresses a Color and an Offset. Offset values should be between 0 and 1. Color values can be any value expressed as a named color or one of the conversion syntaxes; see notes in GradientStop.Color, particularly the XAML syntax.

GradientBrush derived classes

GradientBrush is the parent class for LinearGradientBrush. The Windows Runtime XAML vocabulary doesn't support RadialGradientBrush.


GradientBrush() GradientBrush() GradientBrush()

Provides base class initialization behavior for GradientBrush -derived classes.

protected GradientBrush()protected GradientBrush()Protected Sub New()


ColorInterpolationMode ColorInterpolationMode ColorInterpolationMode

Gets or sets a ColorInterpolationMode enumeration value that specifies how the gradient's colors are interpolated.

public ColorInterpolationMode ColorInterpolationMode { get; set; }public ColorInterpolationMode ColorInterpolationMode { get; set; }Public ReadWrite Property ColorInterpolationMode As ColorInterpolationMode
<gradientBrush ColorInterpolationMode="colorInterpolationModeMemberName"/>
ColorInterpolationMode ColorInterpolationMode ColorInterpolationMode

Specifies how the colors in a gradient are interpolated. The default is SRgbLinearInterpolation.


ColorInterpolationModeProperty ColorInterpolationModeProperty ColorInterpolationModeProperty

Identifies the ColorInterpolationMode dependency property.

public static DependencyProperty ColorInterpolationModeProperty { get; }public static DependencyProperty ColorInterpolationModeProperty { get; }Public Static ReadOnly Property ColorInterpolationModeProperty As DependencyProperty
DependencyProperty DependencyProperty DependencyProperty

The identifier for the ColorInterpolationMode dependency property.


GradientStops GradientStops GradientStops

Gets or sets the brush's gradient stops.

public GradientStopCollection GradientStops { get; set; }public GradientStopCollection GradientStops { get; set; }Public ReadWrite Property GradientStops As GradientStopCollection
GradientStopCollection GradientStopCollection 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.


GradientStopsProperty GradientStopsProperty GradientStopsProperty

Identifies the GradientStops dependency property.

public static DependencyProperty GradientStopsProperty { get; }public static DependencyProperty GradientStopsProperty { get; }Public Static ReadOnly Property GradientStopsProperty As DependencyProperty
DependencyProperty DependencyProperty DependencyProperty

The identifier for the GradientStops dependency property.


MappingMode MappingMode MappingMode

Gets or sets a BrushMappingMode enumeration value that specifies whether the positioning coordinates of the gradient brush are absolute or relative to the output area.

public BrushMappingMode MappingMode { get; set; }public BrushMappingMode MappingMode { get; set; }Public ReadWrite Property MappingMode As BrushMappingMode
<gradientBrush MappingMode="Absolute"/>
<gradientBrush MappingMode="RelativeToBoundingBox"/>
BrushMappingMode BrushMappingMode BrushMappingMode

A BrushMappingMode value that specifies how to interpret the gradient brush's positioning coordinates. The default is RelativeToBoundingBox.


MappingModeProperty MappingModeProperty MappingModeProperty

Identifies the MappingMode dependency property.

public static DependencyProperty MappingModeProperty { get; }public static DependencyProperty MappingModeProperty { get; }Public Static ReadOnly Property MappingModeProperty As DependencyProperty
DependencyProperty DependencyProperty DependencyProperty

The identifier for the MappingMode dependency property.


SpreadMethod SpreadMethod SpreadMethod

Gets or sets the type of spread method that specifies how to draw a gradient that starts or ends inside the bounds of the object to be painted.

public GradientSpreadMethod SpreadMethod { get; set; }public GradientSpreadMethod SpreadMethod { get; set; }Public ReadWrite Property SpreadMethod As GradientSpreadMethod
<gradientBrush SpreadMethod="Pad"/>
<gradientBrush SpreadMethod="Reflect"/>
<gradientBrush SpreadMethod="Repeat"/>
GradientSpreadMethod GradientSpreadMethod GradientSpreadMethod

The type of spread method used to paint the gradient. The default is Pad.


SpreadMethodProperty SpreadMethodProperty SpreadMethodProperty

Identifies the SpreadMethod dependency property.

public static DependencyProperty SpreadMethodProperty { get; }public static DependencyProperty SpreadMethodProperty { get; }Public Static ReadOnly Property SpreadMethodProperty As DependencyProperty
DependencyProperty DependencyProperty DependencyProperty

The identifier for the SpreadMethod dependency property.


See Also