Table of Contents

Class AvaloniaPropertyMetadata

Namespace
Avalonia
Assembly
Avalonia.Base.dll

Base class for avalonia property metadata.

public abstract class AvaloniaPropertyMetadata
Inheritance
AvaloniaPropertyMetadata
Derived
Inherited Members

Constructors

AvaloniaPropertyMetadata(BindingMode, bool?)

Initializes a new instance of the AvaloniaPropertyMetadata class.

public AvaloniaPropertyMetadata(BindingMode defaultBindingMode = BindingMode.Default, bool? enableDataValidation = null)

Parameters

defaultBindingMode BindingMode

The default binding mode.

enableDataValidation bool?

Whether the property is interested in data validation.

Properties

DefaultBindingMode

Gets the default binding mode for the property.

public BindingMode DefaultBindingMode { get; }

Property Value

BindingMode

EnableDataValidation

Gets a value indicating whether the property is interested in data validation.

public bool? EnableDataValidation { get; }

Property Value

bool?

Remarks

Data validation is validation performed at the target of a binding, for example in a view model using the INotifyDataErrorInfo interface. Only certain properties on a control (such as a TextBox's Text property) will be interested in receiving data validation messages so this feature must be explicitly enabled by setting this flag.

IsReadOnly

Gets whether this instance is read-only and can't be modified.

public bool IsReadOnly { get; }

Property Value

bool

Methods

Freeze()

Makes this instance read-only. No further modifications are allowed after this call.

public void Freeze()

GenerateTypeSafeMetadata()

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

public abstract 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 virtual 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.