Table of Contents

Class DirectPropertyBase<TValue>

Namespace
Avalonia
Assembly
Avalonia.Base.dll

Base class for direct properties.

public abstract class DirectPropertyBase<TValue> : AvaloniaProperty<TValue>, IEquatable<AvaloniaProperty>, IPropertyInfo

Type Parameters

TValue

The type of the property's value.

Inheritance
DirectPropertyBase<TValue>
Implements
Derived
DirectProperty<TOwner, TValue>
Inherited Members

Remarks

Whereas DirectProperty<TOwner, TValue> is typed on the owner type, this base class provides a non-owner-typed interface to a direct property.

Properties

Owner

Gets the type that registered the property.

public Type Owner { get; }

Property Value

Type

Methods

GetMetadata(AvaloniaObject)

Gets the AvaloniaPropertyMetadata which applies to this property when it is used with the specified object.

public DirectPropertyMetadata<TValue> GetMetadata(AvaloniaObject owner)

Parameters

owner AvaloniaObject

The object for which to retrieve metadata.

Returns

DirectPropertyMetadata<TValue>

GetMetadata(Type)

Gets the AvaloniaPropertyMetadata which applies to this property when it is used with the specified type.

public DirectPropertyMetadata<TValue> GetMetadata(Type type)

Parameters

type Type

The type for which to retrieve metadata.

Returns

DirectPropertyMetadata<TValue>

Remarks

For performance, prefer the GetMetadata(AvaloniaObject) overload when possible.

GetUnsetValue(AvaloniaObject)

Gets the unset value for the property on the specified object.

public TValue GetUnsetValue(AvaloniaObject owner)

Parameters

owner AvaloniaObject

The object.

Returns

TValue

The unset value.

GetUnsetValue(Type)

Gets the unset value for the property on the specified type.

public TValue GetUnsetValue(Type type)

Parameters

type Type

The type.

Returns

TValue

The unset value.

OverrideMetadata(Type, DirectPropertyMetadata<TValue>)

Overrides the metadata for the property on the specified type.

public void OverrideMetadata(Type type, DirectPropertyMetadata<TValue> metadata)

Parameters

type Type

The type.

metadata DirectPropertyMetadata<TValue>

The metadata.

OverrideMetadata<T>(DirectPropertyMetadata<TValue>)

Overrides the metadata for the property on the specified type.

public void OverrideMetadata<T>(DirectPropertyMetadata<TValue> metadata) where T : AvaloniaObject

Parameters

metadata DirectPropertyMetadata<TValue>

The metadata.

Type Parameters

T

The type.