Skip to main content

StyledPropertyMetadata<TValue> Class

Definition​

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia

Metadata for styled avalonia properties.

public class StyledPropertyMetadata<TValue>

Inheritance: object -> AvaloniaPropertyMetadata -> StyledPropertyMetadata<TValue>

Constructors​

NameDescription
StyledPropertyMetadata<TValue>No summary available.

StyledPropertyMetadata<TValue> Constructor​

public StyledPropertyMetadata<TValue>(Avalonia.Data.Optional<T><TValue> defaultValue, Avalonia.Data.BindingMode defaultBindingMode, Func<Avalonia.AvaloniaObject, TValue, TValue> coerce, bool enableDataValidation)

Parameters​

defaultValue Avalonia.Data.Optional<T><TValue>

defaultBindingMode Avalonia.Data.BindingMode

coerce Func<Avalonia.AvaloniaObject, TValue, TValue>

enableDataValidation bool

Methods​

NameDescription
FreezeMakes this instance read-only. No further modifications are allowed after this call. Inherited from AvaloniaPropertyMetadata.
GenerateTypeSafeMetadataGets a copy of this object configured for use with any owner type.
MergeMerges the metadata with the base metadata.

GenerateTypeSafeMetadata Method​

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

public Avalonia.AvaloniaPropertyMetadata GenerateTypeSafeMetadata()

Returns​

Avalonia.AvaloniaPropertyMetadata

Remarks​

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

Merge Method​

Merges the metadata with the base metadata.

public void Merge(Avalonia.AvaloniaPropertyMetadata baseMetadata, Avalonia.AvaloniaProperty property)

Parameters​

baseMetadata Avalonia.AvaloniaPropertyMetadata

The base metadata to merge.

property Avalonia.AvaloniaProperty

The property to which the metadata is being applied.

Properties​

NameDescription
CoerceValueGets the value coercion callback, if any.
DefaultBindingModeGets the default binding mode for the property. Inherited from AvaloniaPropertyMetadata.
DefaultValueGets the default value for the property.
EnableDataValidationGets a value indicating whether the property is interested in data validation. Inherited from AvaloniaPropertyMetadata.
IsReadOnlyGets whether this instance is read-only and can't be modified. Inherited from AvaloniaPropertyMetadata.

CoerceValue Property​

Gets the value coercion callback, if any.

public Func<Avalonia.AvaloniaObject, TValue, TValue> CoerceValue { get; set; }

DefaultValue Property​

Gets the default value for the property.

public TValue DefaultValue { get; set; }