Skip to main content

SolidColorBrush Class

Definition

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia

Fills an area with a solid color.

public class SolidColorBrush

Inheritance: object -> AvaloniaObject -> Animatable -> Brush -> SolidColorBrush

Implements: IBrush, IMutableBrush, ISolidColorBrush

Constructors

NameDescription
SolidColorBrush (3 overloads)Initializes a new instance of the Avalonia.Media.SolidColorBrush class.

SolidColorBrush overloads

SolidColorBrush Constructor

Initializes a new instance of the Avalonia.Media.SolidColorBrush class.

public SolidColorBrush()

SolidColorBrush Constructor

Initializes a new instance of the Avalonia.Media.SolidColorBrush class.

public SolidColorBrush(Avalonia.Media.Color color, double opacity)
Parameters

color Avalonia.Media.Color

The color to use.

opacity double

The opacity of the brush.

SolidColorBrush Constructor

Initializes a new instance of the Avalonia.Media.SolidColorBrush class.

public SolidColorBrush(uint color)
Parameters

color uint

The color to use.

Methods

NameDescription
ParseParses a brush string.
ToImmutableNo summary available.
ToStringReturns a string representation of the brush.
Bind (8 overloads)Binds a Avalonia.AvaloniaProperty to an Avalonia.Data.BindingBase. Inherited from AvaloniaObject.
CheckAccessReturns a value indicating whether the current thread is the UI thread. Inherited from AvaloniaObject.
ClearValue (4 overloads)Clears a Avalonia.AvaloniaProperty's local value. Inherited from AvaloniaObject.
CoerceValueCoerces the specified Avalonia.AvaloniaProperty. Inherited from AvaloniaObject.
EqualsCompares two objects using reference equality. Inherited from AvaloniaObject.
GetBaseValueInherited from AvaloniaObject.
GetHashCodeGets the hash code for the object. Inherited from AvaloniaObject.
GetValue (3 overloads)Gets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
IsAnimatingChecks whether a Avalonia.AvaloniaProperty is animating. Inherited from AvaloniaObject.
IsSetChecks whether a Avalonia.AvaloniaProperty is set on this object. Inherited from AvaloniaObject.
SetCurrentValue (2 overloads)Sets the value of a dependency property without changing its value source. Inherited from AvaloniaObject.
SetValue (3 overloads)Sets a Avalonia.AvaloniaProperty value. Inherited from AvaloniaObject.
VerifyAccessChecks that the current thread is the UI thread and throws if not. Inherited from AvaloniaObject.

Parse Method

Parses a brush string.

public Avalonia.Media.SolidColorBrush Parse(string s)

Parameters

s string

The brush string.

Returns

Avalonia.Media.SolidColorBrush

The Avalonia.Media.SolidColorBrush.Color.

Remarks

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

ToImmutable Method

public Avalonia.Media.IImmutableBrush ToImmutable()

Returns

Avalonia.Media.IImmutableBrush

ToString Method

Returns a string representation of the brush.

public string ToString()

Returns

string

A string representation of the brush.

Properties

NameDescription
ColorGets or sets the color of the brush.
OpacityGets or sets the opacity of the brush. Inherited from Brush.
TransformGets or sets the transform of the brush. Inherited from Brush.
TransformOriginGets or sets the origin of the brush Avalonia.Media.Brush.Transform Inherited from Brush.
TransitionsGets or sets the property transitions for the control. Inherited from Animatable.
DispatcherReturns the Avalonia.AvaloniaObject.Dispatcher that this Avalonia.AvaloniaObject is associated with. Inherited from AvaloniaObject.
ItemInherited from AvaloniaObject.

Color Property

Gets or sets the color of the brush.

public Avalonia.Media.Color Color { get; set; }

Fields

NameDescription
ColorPropertyDefines the Avalonia.Media.SolidColorBrush.Color property.
OpacityPropertyDefines the Avalonia.Media.Brush.Opacity property. Inherited from Brush.
TransformOriginPropertyDefines the Avalonia.Media.Brush.TransformOrigin property Inherited from Brush.
TransformPropertyDefines the Avalonia.Media.Brush.Transform property. Inherited from Brush.
TransitionsPropertyDefines the Avalonia.Animation.Animatable.Transitions property. Inherited from Animatable.

ColorProperty Field

Defines the Avalonia.Media.SolidColorBrush.Color property.

public Avalonia.StyledProperty<TValue><Avalonia.Media.Color> ColorProperty

Events

NameDescription
PropertyChangedRaised when a Avalonia.AvaloniaProperty value changes on this object. Inherited from AvaloniaObject.