AvaloniaPropertyRegisterAttachedTOwner, THost, TValue(String, TValue, Boolean, BindingMode, FuncTValue, Boolean, FuncAvaloniaObject, TValue, TValue) Method

Registers an attached AvaloniaProperty.

Definition

Namespace: Avalonia
Assembly: Avalonia.Base (in Avalonia.Base.dll) Version: 11.3.999
public static AttachedProperty<TValue> RegisterAttached<TOwner, THost, TValue>(
	string name,
	TValue defaultValue = null,
	bool inherits = false,
	BindingMode defaultBindingMode = BindingMode.OneWay,
	Func<TValue, bool>? validate = null,
	Func<AvaloniaObject, TValue, TValue>? coerce = null
)
where THost : AvaloniaObject

Parameters

name  String
The name of the property.
defaultValue  TValue  (Optional)
The default value of the property.
inherits  Boolean  (Optional)
Whether the property inherits its value.
defaultBindingMode  BindingMode  (Optional)
The default binding mode for the property.
validate  FuncTValue, Boolean  (Optional)
A value validation callback.
coerce  FuncAvaloniaObject, TValue, TValue  (Optional)
A value coercion callback.

Type Parameters

TOwner
The type of the class that is registering the property.
THost
The type of the class that the property is to be registered on.
TValue
The type of the property's value.

Return Value

AttachedPropertyTValue
A AvaloniaPropertyTValue

See Also