GradientBrush GradientBrush GradientBrush GradientBrush Class


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

public : class GradientBrush : Brush, IGradientBrush
struct winrt::Windows::UI::Xaml::Media::GradientBrush : Brush, IGradientBrush
public class GradientBrush : Brush, IGradientBrush
Public 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)


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() GradientBrush()

Provides base class initialization behavior for GradientBrush -derived classes.


ColorInterpolationMode ColorInterpolationMode ColorInterpolationMode ColorInterpolationMode

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

ColorInterpolationModeProperty ColorInterpolationModeProperty ColorInterpolationModeProperty ColorInterpolationModeProperty

Identifies the ColorInterpolationMode dependency property.

Dispatcher Dispatcher Dispatcher Dispatcher

Gets the CoreDispatcher that this object is associated with. The CoreDispatcher represents a facility that can access the DependencyObject on the UI thread even if the code is initiated by a non-UI thread.

(Inherited from DependencyObject)
GradientStops GradientStops GradientStops GradientStops

Gets or sets the brush's gradient stops.

GradientStopsProperty GradientStopsProperty GradientStopsProperty GradientStopsProperty

Identifies the GradientStops dependency property.

MappingMode 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.

MappingModeProperty MappingModeProperty MappingModeProperty MappingModeProperty

Identifies the MappingMode dependency property.

Opacity Opacity Opacity Opacity

Gets or sets the degree of opacity of a Brush.

(Inherited from Brush)
OpacityProperty OpacityProperty OpacityProperty OpacityProperty

Identifies the Opacity dependency property.

(Inherited from Brush)
RelativeTransform RelativeTransform RelativeTransform RelativeTransform

Gets or sets the transformation that is applied to the brush using relative coordinates.

(Inherited from Brush)
RelativeTransformProperty RelativeTransformProperty RelativeTransformProperty RelativeTransformProperty

Identifies the RelativeTransform dependency property.

(Inherited from Brush)
SpreadMethod 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.

SpreadMethodProperty SpreadMethodProperty SpreadMethodProperty SpreadMethodProperty

Identifies the SpreadMethod dependency property.

Transform Transform Transform Transform

Gets or sets the transformation that is applied to the brush.

(Inherited from Brush)
TransformProperty TransformProperty TransformProperty TransformProperty

Identifies the Transform dependency property.

(Inherited from Brush)


ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Clears the local value of a dependency property.

(Inherited from DependencyObject)
GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Returns any base value established for a dependency property, which would apply in cases where an animation is not active.

(Inherited from DependencyObject)
GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Returns the current effective value of a dependency property from a DependencyObject.

(Inherited from DependencyObject)
ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if a local value is set.

(Inherited from DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Registers a notification function for listening to changes to a specific DependencyProperty on this DependencyObject instance.

(Inherited from DependencyObject)
SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Sets the local value of a dependency property on a DependencyObject.

(Inherited from DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Cancels a change notification that was previously registered by calling RegisterPropertyChangedCallback.

(Inherited from DependencyObject)

See Also