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
BindingModeThe 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
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
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
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
AvaloniaPropertyMetadataThe base metadata to merge.
property
AvaloniaPropertyThe property to which the metadata is being applied.