Skip to main content

DirectPropertyBase<TValue> Class

Definition

Namespace:Avalonia
Assembly:Avalonia.Base
Package:Avalonia

Base class for direct properties.

public class DirectPropertyBase<TValue>

Inheritance: AvaloniaProperty<> -> DirectPropertyBase<TValue>

Remarks

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

Methods

NameDescription
GetMetadata (2 overloads)Gets the Avalonia.AvaloniaPropertyMetadata which applies to this property when it is used with the specified object.
GetUnsetValue (2 overloads)Gets the unset value for the property on the specified object.
OverrideMetadata (2 overloads)No summary available.

GetMetadata overloads

GetMetadata Method

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

public Avalonia.DirectPropertyMetadata<TValue><TValue> GetMetadata(Avalonia.AvaloniaObject owner)
Parameters

owner Avalonia.AvaloniaObject

The object for which to retrieve metadata.

Returns

Avalonia.DirectPropertyMetadata<TValue><TValue>

GetMetadata Method

public Avalonia.DirectPropertyMetadata<TValue><TValue> GetMetadata(Type type)
Parameters

type Type

The type for which to retrieve metadata.

Returns

Avalonia.DirectPropertyMetadata<TValue><TValue>

Remarks

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

GetUnsetValue overloads

GetUnsetValue Method

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

public TValue GetUnsetValue(Avalonia.AvaloniaObject owner)
Parameters

owner Avalonia.AvaloniaObject

The object.

Returns

TValue

The unset value.

GetUnsetValue Method

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 overloads

OverrideMetadata Method

public void OverrideMetadata<T>(Avalonia.DirectPropertyMetadata<TValue><TValue> metadata)
Parameters

metadata Avalonia.DirectPropertyMetadata<TValue><TValue>

Type Parameters

T

OverrideMetadata Method

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

type Type

metadata Avalonia.DirectPropertyMetadata<TValue><TValue>

Properties

NameDescription
OwnerGets the type that registered the property.

Owner Property

Gets the type that registered the property.

public Type Owner { get; set; }