Show / Hide Table of Contents

Class GradientBrush

An abstract class that describes a gradient, composed of gradient stops. Classes that derive from GradientBrush describe different ways of interpreting gradient stops.

Inheritance
System.Object
DependencyObject
Brush
GradientBrush
LinearGradientBrush
RadialGradientBrush
Inherited Members
Brush.OpacityProperty
Brush.Opacity
Brush.RelativeTransformProperty
Brush.RelativeTransform
Brush.TransformProperty
Brush.Transform
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.INTERNAL_OnAttachedToVisualTree()
DependencyObject.INTERNAL_OnDetachedFromVisualTree()
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Media
Assembly: OpenSilver.dll
Syntax
public class GradientBrush : Brush, IDependencyObject

Constructors

| Improve this Doc View Source

GradientBrush()

Initializes a new instance of the GradientBrush class.

Declaration
protected GradientBrush()

Fields

| Improve this Doc View Source

ColorInterpolationModeProperty

Identifies the ColorInterpolationMode dependency property.

Declaration
[NotImplemented]
public static readonly DependencyProperty ColorInterpolationModeProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

GradientStopsProperty

Identifies the GradientStops dependency property.

Declaration
public static readonly DependencyProperty GradientStopsProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

MappingModeProperty

Identifies the MappingMode dependency property.

Declaration
public static readonly DependencyProperty MappingModeProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

SpreadMethodProperty

Identifies the SpreadMethod dependency property.

Declaration
public static readonly DependencyProperty SpreadMethodProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

ColorInterpolationMode

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

Declaration
[NotImplemented]
public ColorInterpolationMode ColorInterpolationMode { get; set; }
Property Value
Type Description
ColorInterpolationMode

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

| Improve this Doc View Source

GradientStops

Gets or sets the brush's gradient stops.

Declaration
public GradientStopCollection GradientStops { get; set; }
Property Value
Type Description
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.

| Improve this Doc View Source

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.

Declaration
public BrushMappingMode MappingMode { get; set; }
Property Value
Type Description
BrushMappingMode

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

| Improve this Doc View Source

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.

Declaration
public GradientSpreadMethod SpreadMethod { get; set; }
Property Value
Type Description
GradientSpreadMethod

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

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
  • Improve this Doc
  • View Source