Table of Contents

Class RadialGradientBrush

Namespace
Avalonia.Media
Assembly
Avalonia.Base.dll

Paints an area with a radial gradient.

public sealed class RadialGradientBrush : GradientBrush, INotifyPropertyChanged, IRadialGradientBrush, IGradientBrush, IBrush
Inheritance
RadialGradientBrush
Implements
Inherited Members
Extension Methods

Constructors

RadialGradientBrush()

public RadialGradientBrush()

Fields

CenterProperty

Defines the Center property.

public static readonly StyledProperty<RelativePoint> CenterProperty

Field Value

StyledProperty<RelativePoint>

GradientOriginProperty

Defines the GradientOrigin property.

public static readonly StyledProperty<RelativePoint> GradientOriginProperty

Field Value

StyledProperty<RelativePoint>

RadiusProperty

Defines the Radius property.

[Obsolete("Use RadiusX/RadiusY, note that those properties use _relative_ values, so Radius=0.55 would become RadiusX=55% RadiusY=55%. Radius property is always relative even if the rest of the brush uses absolute values.")]
public static readonly StyledProperty<double> RadiusProperty

Field Value

StyledProperty<double>

RadiusXProperty

Defines the RadiusX property.

public static readonly StyledProperty<RelativeScalar> RadiusXProperty

Field Value

StyledProperty<RelativeScalar>

RadiusYProperty

Defines the RadiusX property.

public static readonly StyledProperty<RelativeScalar> RadiusYProperty

Field Value

StyledProperty<RelativeScalar>

Properties

Center

Gets or sets the start point for the gradient.

public RelativePoint Center { get; set; }

Property Value

RelativePoint

GradientOrigin

Gets or sets the location of the two-dimensional focal point that defines the beginning of the gradient.

public RelativePoint GradientOrigin { get; set; }

Property Value

RelativePoint

Radius

Gets or sets the horizontal and vertical radius of the outermost circle of the radial gradient.

[Obsolete("Use RadiusX/RadiusY, note that those properties use _relative_ values, so Radius=0.55 would become RadiusX=55% RadiusY=55%. Radius property is always relative even if the rest of the brush uses absolute values.")]
public double Radius { get; set; }

Property Value

double

RadiusX

Gets or sets the horizontal radius of the outermost circle of the radial gradient.

[DependsOn("Radius")]
public RelativeScalar RadiusX { get; set; }

Property Value

RelativeScalar

RadiusY

Gets or sets the vertical radius of the outermost circle of the radial gradient.

[DependsOn("Radius")]
public RelativeScalar RadiusY { get; set; }

Property Value

RelativeScalar

Methods

OnPropertyChanged(AvaloniaPropertyChangedEventArgs)

Called when a avalonia property changes on the object.

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)

Parameters

change AvaloniaPropertyChangedEventArgs

The property change details.

ToImmutable()

Creates an immutable clone of the brush.

public override IImmutableBrush ToImmutable()

Returns

IImmutableBrush

The immutable clone.