Table of Contents

Class StyledPropertyMetadata<TValue>

Namespace
Avalonia
Assembly
Avalonia.Base.dll

Metadata for styled avalonia properties.

public class StyledPropertyMetadata<TValue> : AvaloniaPropertyMetadata, IStyledPropertyMetadata

Type Parameters

TValue
Inheritance
StyledPropertyMetadata<TValue>
Implements
Inherited Members

Constructors

StyledPropertyMetadata(Optional<TValue>, BindingMode, Func<AvaloniaObject, TValue, TValue>?, bool)

Initializes a new instance of the StyledPropertyMetadata<TValue> class.

public StyledPropertyMetadata(Optional<TValue> defaultValue = default, BindingMode defaultBindingMode = BindingMode.Default, Func<AvaloniaObject, TValue, TValue>? coerce = null, bool enableDataValidation = false)

Parameters

defaultValue Optional<TValue>

The default value of the property.

defaultBindingMode BindingMode

The default binding mode.

coerce Func<AvaloniaObject, TValue, TValue>

A value coercion callback.

enableDataValidation bool

Whether the property is interested in data validation.

Properties

CoerceValue

Gets the value coercion callback, if any.

public Func<AvaloniaObject, TValue, TValue>? CoerceValue { get; }

Property Value

Func<AvaloniaObject, TValue, TValue>

DefaultValue

Gets the default value for the property.

public TValue DefaultValue { get; }

Property Value

TValue

Methods

GenerateTypeSafeMetadata()

Gets a copy of this object configured for use with any owner type.

public override AvaloniaPropertyMetadata GenerateTypeSafeMetadata()

Returns

AvaloniaPropertyMetadata

Remarks

For example, delegates which receive the owner object should be removed.

Merge(AvaloniaPropertyMetadata, AvaloniaProperty)

Merges the metadata with the base metadata.

public override void Merge(AvaloniaPropertyMetadata baseMetadata, AvaloniaProperty property)

Parameters

baseMetadata AvaloniaPropertyMetadata

The base metadata to merge.

property AvaloniaProperty

The property to which the metadata is being applied.