Table of Contents

Class SolidColorBrush

Namespace
Avalonia.Media
Assembly
Avalonia.Base.dll

Fills an area with a solid color.

public sealed class SolidColorBrush : Brush, INotifyPropertyChanged, ISolidColorBrush, IBrush
Inheritance
SolidColorBrush
Implements
Inherited Members
Extension Methods

Constructors

SolidColorBrush()

Initializes a new instance of the SolidColorBrush class.

public SolidColorBrush()

SolidColorBrush(Color, double)

Initializes a new instance of the SolidColorBrush class.

public SolidColorBrush(Color color, double opacity = 1)

Parameters

color Color

The color to use.

opacity double

The opacity of the brush.

SolidColorBrush(uint)

Initializes a new instance of the SolidColorBrush class.

public SolidColorBrush(uint color)

Parameters

color uint

The color to use.

Fields

ColorProperty

Defines the Color property.

public static readonly StyledProperty<Color> ColorProperty

Field Value

StyledProperty<Color>

Properties

Color

Gets or sets the color of the brush.

public Color Color { get; set; }

Property Value

Color

Methods

Parse(string)

Parses a brush string.

public static SolidColorBrush Parse(string s)

Parameters

s string

The brush string.

Returns

SolidColorBrush

The Color.

Remarks

Whereas Parse(string) may return an immutable solid color brush, this method always returns a mutable SolidColorBrush.

ToImmutable()

Creates an immutable clone of the brush.

public IImmutableBrush ToImmutable()

Returns

IImmutableBrush

The immutable clone.

ToString()

Returns a string representation of the brush.

public override string ToString()

Returns

string

A string representation of the brush.