Skip to main content

AvaloniaPropertyMetadata Class

Definition​

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia

Base class for avalonia property metadata.

public class AvaloniaPropertyMetadata

Inheritance: object -> AvaloniaPropertyMetadata

Constructors​

NameDescription
AvaloniaPropertyMetadataNo summary available.

AvaloniaPropertyMetadata Constructor​

public AvaloniaPropertyMetadata(Avalonia.Data.BindingMode defaultBindingMode, Nullable<bool> enableDataValidation)

Parameters​

defaultBindingMode Avalonia.Data.BindingMode

enableDataValidation Nullable<bool>

Methods​

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

Freeze Method​

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

public void Freeze()

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
DefaultBindingModeGets the default binding mode for the property.
EnableDataValidationGets a value indicating whether the property is interested in data validation.
IsReadOnlyGets whether this instance is read-only and can't be modified.

DefaultBindingMode Property​

Gets the default binding mode for the property.

public Avalonia.Data.BindingMode DefaultBindingMode { get; set; }

EnableDataValidation Property​

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

public Nullable<bool> EnableDataValidation { get; set; }

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 Property​

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

public bool IsReadOnly { get; set; }